Skip to contentSkip to conversation

scsi: aha152x: fix aha152x_setup() __setup handler return value

PATCH Applied Randy Dunlap 2 participants 3 messages Feb 23, 2022 – Mar 2, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi: aha152x: fix aha152x_setup() __setup handler return value

__setup() handlers should return 1 if the command line option is handled and 0 if not (or maybe never return 0; doing so just pollutes init's environment with strings that are not init arguments/parameters).

Return 1 from aha152x_setup() to indicate that the boot option has been handled.

Link lore.kernel.org/r/[email protected]
Cc "Juergen E. Fischer" <[email protected]>
Cc "James E.J. Bottomley" <[email protected]>
Cc "Martin K. Petersen" <[email protected]>

---
Builds but not tested -- no such hardware.

 drivers/scsi/aha152x.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/scsi/aha152x.c +2 -4
@@ -3375,13 +3375,11 @@ static int __init aha152x_setup(char *st
 	setup[setup_count].synchronous = ints[0] >= 6 ? ints[6] : 1;
 	setup[setup_count].delay       = ints[0] >= 7 ? ints[7] : DELAY_DEFAULT;
 	setup[setup_count].ext_trans   = ints[0] >= 8 ? ints[8] : 0;
-	if (ints[0] > 8) {                                                /*}*/
+	if (ints[0] > 8)
 		printk(KERN_NOTICE "aha152x: usage: aha152x=<IOBASE>[,<IRQ>[,<SCSI ID>"
 		       "[,<RECONNECT>[,<PARITY>[,<SYNCHRONOUS>[,<DELAY>[,<EXT_TRANS>]]]]]]]\n");
-	} else {
+	else
 		setup_count++;
-		return 0;
-	}
 
 	return 1;
 }
#1 lore raw

Randy,

Quoted 3 lines

__setup() handlers should return 1 if the command line option is handled and 0 if not (or maybe never return 0; doing so just pollutes init's environment with strings that are not init arguments/parameters).

Applied to 5.18/scsi-staging, thanks!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering
#2 lore raw
In reply to Randy Dunlap
Quoted 8 lines · Randy Dunlap

__setup() handlers should return 1 if the command line option is handled and 0 if not (or maybe never return 0; doing so just pollutes init's environment with strings that are not init arguments/parameters).

Return 1 from aha152x_setup() to indicate that the boot option has been handled.

[...]

Applied to 5.18/scsi-queue, thanks!

[1/1] scsi: aha152x: fix aha152x_setup() __setup handler return value

      https://git.kernel.org/mkp/scsi/c/cc8294ec4738
Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering