forked from mirrors/linux
		
	tools: ynl: fix get_mask utility routine
Fix get_mask utility routine in order to take into account possible gaps
in the elements list.
Fixes: be5bea1cc0 ("net: add basic C code generators for Netlink")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
			
			
This commit is contained in:
		
							parent
							
								
									8f76a4f80f
								
							
						
					
					
						commit
						bf51d27704
					
				
					 1 changed files with 2 additions and 4 deletions
				
			
		| 
						 | 
					@ -138,10 +138,8 @@ class SpecEnumSet(SpecElement):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def get_mask(self):
 | 
					    def get_mask(self):
 | 
				
			||||||
        mask = 0
 | 
					        mask = 0
 | 
				
			||||||
        idx = self.yaml.get('value-start', 0)
 | 
					        for e in self.entries.values():
 | 
				
			||||||
        for _ in self.entries.values():
 | 
					            mask += e.user_value()
 | 
				
			||||||
            mask |= 1 << idx
 | 
					 | 
				
			||||||
            idx += 1
 | 
					 | 
				
			||||||
        return mask
 | 
					        return mask
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue