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:	Sun, 28 Feb 2016 15:07:39 +0100
From:	Wim Van Sebroeck <wim@...ana.be>
To:	One Thousand Gnomes <gnomes@...rguk.ukuu.org.uk>
Cc:	William Breathitt Gray <vilhelm.gray@...il.com>,
	linux@...ck-us.net, linux-watchdog@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3] watchdog: Add watchdog timer support for the WinSystems EBC-C384

> > +static int ebc_c384_wdt_set_timeout(struct watchdog_device *wdev, unsigned t)
> > +{
> > +	/* resolution is in minutes for timeouts greater than 255 seconds */
> > +	if (t > 255) {
> > +		/* truncate second resolution to minute resolution */
> > +		t /= 60;
> > +		wdev->timeout = t * 60;
> > +
> > +		/* set watchdog timer for minutes */
> > +		outb(0x00, CFG_ADDR);
> 
> If ask for 299 seconds surely I should get 300 not 240 ?
> (Whether to round off or round up is an interesting question for the
> middle range - does it go off early or late - I'd have said late but...)

This is my preference:
	if (t > 255)
		t = (((t - 1) / 60) + 1) * 60;

Which basically is a round-up to minutes
t = 256 -> gives 300
t = 299 -> gives 300 
t = 300 -> gives 300
t = 301 -> gives 360
t = 15299 -> gives 15300
t = 15300 -> gives 15300
t = 15301 -> gives 15360

So I am also for going late.

Kind regards,
Wim.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ