lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 14 Jan 2008 09:03:29 +0000
From:	Alan Cox <alan@...rguk.ukuu.org.uk>
To:	"Mike Frysinger" <vapier.adi@...il.com>
Cc:	"Marc Pignat" <marc.pignat@...s.ch>, wim@...ana.be,
	linux-kernel@...r.kernel.org
Subject: Re: [RFC, PATCH] watchdog on gpio

> > #include <linux/gpio_wdt.h>
> 
> perhaps "watchdog" rather than "wdt" considering it's already
> "linux/watchdog.h" ?

or _wdt/wdt_ like the rest of the watchdog code uses for watchdog names
(wdt ->watchdog timer).

>
> > +       case WDIOC_KEEPALIVE:
> > +               gpio_wdt_keepalive(wdt);
> > +               return 0;
> 
> this two lines should be merged.

No.

> > +       default:
> > +               return -ENOIOCTLCMD;
> 
> should be -ENOTTY like all the other watchdogs

Yes. That's a common confusion. -ENOIOCTLCMD is a magic code used
internally by some mid layers to indicate the driver doesn't know the
ioctl so use default behaviour. -ENOTTY (confusingly but this is Unix
history) is the right answer for unknowns.
> 
> > +static char banner[] __initdata = KERN_INFO PFX "fixed %d.%03d seconds timeout (nowayout= %d)\n";
> 
> this only gets used once in the init function ... having it be broken
> out like this is kind of silly

Saves memory - you can't make inlined strings __initdata without breaking
some compilers. So it is correct.

> 
> > +static int __init gpio_wdt_probe(struct platform_device *pdev)
> 
> shouldnt this be __devinit ?

IFF the device can be found/removed dynamically.

> > +       if (watchdog) {
> > +               printk(KERN_ERR PFX "only one device supported\n");
> > +               return -ENODEV;
> > +       }
> 
> why ?  it'd be trivial to abstract this driver away from a global
> "watchdog" state into a proper arbitrary # of gpio watchdogs.

The core watchdog code only supports one watchdog currently. This again
is correct.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ