Linux-Watchdog Archive on lore.kernel.org
 help / color / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Wolfram Sang <wsa@the-dreams.de>
Cc: Wolfram Sang <wsa+renesas@sang-engineering.com>,
	linux-watchdog@vger.kernel.org,
	linux-renesas-soc@vger.kernel.org
Subject: Re: [PATCH 01/16] watchdog: refactor watchdog_init_timeout
Date: Sun, 14 Apr 2019 07:03:52 -0700
Message-ID: <7007b01a-854c-67d9-66f5-e12d8c97afc6@roeck-us.net> (raw)
In-Reply-To: <20190414134238.aj6c42pjj7xjbtxo@ninjato>

On 4/14/19 6:42 AM, Wolfram Sang wrote:
> 
>>> The function is not easy to read and has two problems: a) -EINVAL is
>>> returned when the module parameter is invalid but the DT parameter is
>>> OK, and b) for the module parameter, zero is a valid value but for DT it
>>> is invalid.
>>>
>>
>> That was on purpose: A module parameter of 0 reflects that no module parameter
>> was provided, which is not an error. An explicit DT property with value 0 _is_
>> an error and does not make sense. "use the default", in the DT case, can and
>> should be expressed by providing no property, not by providing a property with
>> value 0.
> 
> OK, I can fix the code to do that as before. And add some documentation
> to describe that. Please let me know if it is documented already and I
> just missed it.
> 
The existing documentation is indeed a bit vague. Explicitly documenting the
expected behavior would be a good idea.  I keep having to explain how this is
supposed to work for almost every new driver. The most difficult part is to
get people to understand that the 'timeout' module parameter value should _not_
be pre-initialized with the default timeout but with 0.

Thanks,
Guenter

  reply index

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-14 10:26 [PATCH 00/16] watchdog: refactor init_timeout and update users Wolfram Sang
2019-04-14 10:26 ` [PATCH 01/16] watchdog: refactor watchdog_init_timeout Wolfram Sang
2019-04-14 13:25   ` Guenter Roeck
2019-04-14 13:42     ` Wolfram Sang
2019-04-14 14:03       ` Guenter Roeck [this message]
2019-04-15  8:21   ` Sergei Shtylyov
2019-04-14 10:26 ` [PATCH 02/16] watchdog: add error messages when initializing timeout fails Wolfram Sang
2019-04-14 10:26 ` [PATCH 03/16] watchdog: cadence_wdt: drop warning after calling watchdog_init_timeout Wolfram Sang
2019-04-14 10:26 ` [PATCH 04/16] watchdog: cadence_wdt: still probe if user supplied timeout is invalid Wolfram Sang
2019-04-14 10:26 ` [PATCH 05/16] watchdog: ebc-c384_wdt: drop warning after calling watchdog_init_timeout Wolfram Sang
2019-04-14 10:26 ` [PATCH 06/16] watchdog: hpwdt: " Wolfram Sang
2019-04-14 10:26 ` [PATCH 07/16] watchdog: i6300esb: " Wolfram Sang
2019-04-14 10:26 ` [PATCH 08/16] watchdog: imx_sc_wdt: " Wolfram Sang
2019-04-14 10:26 ` [PATCH 09/16] watchdog: ni903x_wdt: " Wolfram Sang
2019-04-14 10:26 ` [PATCH 10/16] watchdog: nic7018_wdt: " Wolfram Sang
2019-04-14 10:26 ` [PATCH 11/16] watchdog: renesas_wdt: " Wolfram Sang
2019-04-14 10:26 ` [PATCH 12/16] watchdog: sp5100_tco: " Wolfram Sang
2019-04-14 10:26 ` [PATCH 13/16] watchdog: st_lpc_wdt: " Wolfram Sang
2019-04-14 10:26 ` [PATCH 14/16] watchdog: stm32_iwdg: " Wolfram Sang
2019-04-14 10:26 ` [PATCH 15/16] watchdog: xen_wdt: " Wolfram Sang
2019-04-14 10:26 ` [PATCH 16/16] watchdog: ziirave_wdt: " Wolfram Sang
2019-04-14 10:30 ` [PATCH 00/16] watchdog: refactor init_timeout and update users Wolfram Sang
2019-04-14 15:41 ` Guenter Roeck

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7007b01a-854c-67d9-66f5-e12d8c97afc6@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=wsa+renesas@sang-engineering.com \
    --cc=wsa@the-dreams.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-Watchdog Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-watchdog/0 linux-watchdog/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-watchdog linux-watchdog/ https://lore.kernel.org/linux-watchdog \
		linux-watchdog@vger.kernel.org
	public-inbox-index linux-watchdog

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-watchdog


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git