Skip to content

Commit eb0994a

Browse files
petrpavludkruces
authored andcommitted
module: Avoid unnecessary return value initialization in move_module()
All error conditions in move_module() set the return value by updating the ret variable. Therefore, it is not necessary to the initialize the variable when declaring it. Remove the unnecessary initialization. Signed-off-by: Petr Pavlu <[email protected]> Reviewed-by: Sami Tolvanen <[email protected]> Reviewed-by: Daniel Gomez <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Daniel Gomez <[email protected]> Message-ID: <[email protected]>
1 parent ca3881f commit eb0994a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

kernel/module/main.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2696,9 +2696,8 @@ static int find_module_sections(struct module *mod, struct load_info *info)
26962696

26972697
static int move_module(struct module *mod, struct load_info *info)
26982698
{
2699-
int i;
2699+
int i, ret;
27002700
enum mod_mem_type t = MOD_MEM_NUM_TYPES;
2701-
int ret = -ENOMEM;
27022701
bool codetag_section_found = false;
27032702

27042703
for_each_mod_mem_type(type) {

0 commit comments

Comments
 (0)