mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	module: Fix ERRORs reported by checkpatch.pl
Checkpatch reports following errors:
ERROR: do not use assignment in if condition
+	if ((colon = strnchr(name, MODULE_NAME_LEN, ':')) != NULL) {
ERROR: do not use assignment in if condition
+		if ((mod = find_module_all(name, colon - name, false)) != NULL)
ERROR: do not use assignment in if condition
+			if ((ret = find_kallsyms_symbol_value(mod, name)) != 0)
ERROR: do not initialise globals to 0
+int modules_disabled = 0;
Fix them.
The following one has to remain, because the condition has to be evaluated
multiple times by the macro wait_event_interruptible_timeout().
ERROR: do not use assignment in if condition
+	if (wait_event_interruptible_timeout(module_wq,
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
			
			
This commit is contained in:
		
							parent
							
								
									ae39e9ed96
								
							
						
					
					
						commit
						ecc726f145
					
				
					 2 changed files with 7 additions and 4 deletions
				
			
		| 
						 | 
					@ -466,14 +466,17 @@ unsigned long module_kallsyms_lookup_name(const char *name)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* Don't lock: we're in enough trouble already. */
 | 
						/* Don't lock: we're in enough trouble already. */
 | 
				
			||||||
	preempt_disable();
 | 
						preempt_disable();
 | 
				
			||||||
	if ((colon = strnchr(name, MODULE_NAME_LEN, ':')) != NULL) {
 | 
						colon = strnchr(name, MODULE_NAME_LEN, ':');
 | 
				
			||||||
		if ((mod = find_module_all(name, colon - name, false)) != NULL)
 | 
						if (colon) {
 | 
				
			||||||
 | 
							mod = find_module_all(name, colon - name, false);
 | 
				
			||||||
 | 
							if (mod)
 | 
				
			||||||
			ret = find_kallsyms_symbol_value(mod, colon + 1);
 | 
								ret = find_kallsyms_symbol_value(mod, colon + 1);
 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
		list_for_each_entry_rcu(mod, &modules, list) {
 | 
							list_for_each_entry_rcu(mod, &modules, list) {
 | 
				
			||||||
			if (mod->state == MODULE_STATE_UNFORMED)
 | 
								if (mod->state == MODULE_STATE_UNFORMED)
 | 
				
			||||||
				continue;
 | 
									continue;
 | 
				
			||||||
			if ((ret = find_kallsyms_symbol_value(mod, name)) != 0)
 | 
								ret = find_kallsyms_symbol_value(mod, name);
 | 
				
			||||||
 | 
								if (ret)
 | 
				
			||||||
				break;
 | 
									break;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -119,7 +119,7 @@ static void mod_update_bounds(struct module *mod)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Block module loading/unloading? */
 | 
					/* Block module loading/unloading? */
 | 
				
			||||||
int modules_disabled = 0;
 | 
					int modules_disabled;
 | 
				
			||||||
core_param(nomodule, modules_disabled, bint, 0);
 | 
					core_param(nomodule, modules_disabled, bint, 0);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Waiting for a module to finish initializing? */
 | 
					/* Waiting for a module to finish initializing? */
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue