Skip to content

Commit ba5639b

Browse files
Tim Goverpopcornmix
authored andcommitted
watchdog: bcm2835: Ignore params after the partition number
Use sscanf to extract the partition number and ignore extra parameters which are only relevant to other reboot notifiers.
1 parent cdcd165 commit ba5639b

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎drivers/watchdog/bcm2835_wdt.c‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,12 @@ static int bcm2835_restart(struct watchdog_device *wdog,
126126
{
127127
struct bcm2835_wdt *wdt = watchdog_get_drvdata(wdog);
128128

129-
unsigned long long val;
129+
unsigned long val;
130130
u8 partition = 0;
131131

132-
if (data && !kstrtoull(data, 0, &val) && val <= 63)
132+
// Allow extra arguments separated by spaces after
133+
// the partition number.
134+
if (data && sscanf(data, "%lu", &val) && val < 63)
133135
partition = val;
134136

135137
__bcm2835_restart(wdt, partition);

0 commit comments

Comments
 (0)