Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp579627ybm; Wed, 27 May 2020 02:53:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzWlsnL4PyBe78xSQFo2ARuXzuGlP3h1qo0TxXXQR+zVrLR6TbDAGQ11z2DWoIndhr1OfyP X-Received: by 2002:a17:906:4bc1:: with SMTP id x1mr4988441ejv.13.1590573219610; Wed, 27 May 2020 02:53:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590573219; cv=none; d=google.com; s=arc-20160816; b=OShAhMsQiO8nrN2HB82ujQoWvJ2DRkmp4D8jCiKAPuoeLe/M+HCfxvRqOCEaYseqDa V74D90rPWJ2V26YoE71cYwOK95iPBk2Yc4e9yQlMk5xxtrxu5zkY5zgIGJT3oCiUV2ZK CZ2HDZYyd8RhnX0q+9KkV6iUC5Te8qW4zVJ5VIR4DQeJ7+M2bwKFjaX4djt83GosHLVz b7QIVCxqGTpQcJc5oL1F8VwoQ94IpDkQkF/auLX0gry/PVQgA+W/0aqsjuvLgZI+rBG/ Y5U0kg+SFA5yY+oF3Wvwl8tV/xqKqgzKY5ZGUGUVLiQHiQykotY0YUdHQs4DEADkVVO/ 2edg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=8bElIwlLcxBa2p2mrgEjCxqLeCmJ7w/ViW/yu1ziFkI=; b=UZukWYvD82daKtdHT5T5VEs4z9dPrZXg9RbONDrK7B7O97BEgAR7n86v77UKMDJbmj 8NcfGMOTsNR8FR8ipCcXVaBoqiKtF6xM9H28L3UZBGzRSgDdsCWXUnUpf4XrQsIbg5jr h5VotslQCKZLYxlGhFZK73e2rvglHy+txbB9z2EMVu/EJn0thkjJKa4vWSDDOdtE/NU3 E2Y5CtV5J0NcGVqpirkG17anlfIoAVwYvAomflgZIN+5dplssqWMYdr7QUtF4sFkVVIh bgf3OGqAZsr8zC5uHxvhweP8Dd8UC2t3e9aMXm4q4Ya00Fsut16pNBjLZsfdtduJ9C67 A36g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=Plwh6gvE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r15si1599805ejx.650.2020.05.27.02.53.16; Wed, 27 May 2020 02:53:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=Plwh6gvE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726910AbgE0FCz (ORCPT + 99 others); Wed, 27 May 2020 01:02:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41280 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725294AbgE0FCz (ORCPT ); Wed, 27 May 2020 01:02:55 -0400 Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0F57C061A0F; Tue, 26 May 2020 22:02:53 -0700 (PDT) Received: by mail-pf1-x444.google.com with SMTP id e11so10355197pfn.3; Tue, 26 May 2020 22:02:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=8bElIwlLcxBa2p2mrgEjCxqLeCmJ7w/ViW/yu1ziFkI=; b=Plwh6gvE6jlUISumm8BdAcJCoeOeJ2vAjCnRsBDuAZIztQFMvNCQQDFPfsxhtcvpjl hk3/dFwajdYGna1ns3GnblTHNzPKfKaxnAI9qLS+a7YKUxSbcmJcVFZ7NpMgc4pa6LfQ YeHoF24i/65mmgNlHXca2PsC199Khjc/Oia7RiREptp34cgrGrmZ5zHiKRFRLvVVn8Pu 6XilIV5ItpOK6WpQp8SHLueTiUnEfnJjmizFkX/YlBqSqmyoYvTVhu26xeEOaTcMXtnh wO5C3zPpPwA3EIMlNgItzLbOfrosfBBZ2TGZNGwnsjTDUx9mL1C4clkNcej4HSVAZ9G9 udAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=8bElIwlLcxBa2p2mrgEjCxqLeCmJ7w/ViW/yu1ziFkI=; b=WltRsI625RwOHNJktfJtjQIqh81AZnJX4QmhpPsw7p+TDZxq3EmNt5j0YkQc5B6Iiw jv21s3nim30VBN9QJuwsyMfBGoK2Kzu2OoZ90it6y1MuEIvBpXKHdqKNStQZ/UrKWjm9 vdtaN8z3Af9qiB8gX7pkE4+52x1J5/plptxcOEwiUwJczRFAsYrtqFHD0X95T/GxE/9g xTT301tm1oK4OwYszPZ9IuMhy32C/dsmO/GmOaL1R908xj/wd+AhSrPAkxYtoNo5Ecxm T0Kqn5bSoRW1kvYsSOfu5K0S7gy/PwDKHnElF1q83ZGbTdYDb6YMJX/rGisgPNXxX9NO MS8Q== X-Gm-Message-State: AOAM531zYP4Ke1Pa/Vk9IdpKs7v2cfOatJ72qPr1LLKQW7hMGmY0wYH0 jWHk3R+DyDJJWEH+BPgwv+LRl7NS X-Received: by 2002:a63:4c0b:: with SMTP id z11mr2300834pga.348.1590555773430; Tue, 26 May 2020 22:02:53 -0700 (PDT) Received: from localhost ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id m15sm1006382pgv.45.2020.05.26.22.02.52 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 May 2020 22:02:53 -0700 (PDT) Date: Tue, 26 May 2020 22:02:52 -0700 From: Guenter Roeck To: yuechao.zhao@advantech.com.cn Cc: 345351830@qq.com, amy.shih@advantech.com.tw, oakley.ding@advantech.com.tw, jia.sui@advantech.com.cn, Jean Delvare , linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [v2,1/1] hwmon:(nct7904) Set default timeout Message-ID: <20200527050252.GA2934@roeck-us.net> References: <1590551390-40177-1-git-send-email-yuechao.zhao@advantech.com.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1590551390-40177-1-git-send-email-yuechao.zhao@advantech.com.cn> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 27, 2020 at 03:49:50AM +0000, yuechao.zhao@advantech.com.cn wrote: > From: Yuechao Zhao > > The timeout module parameter should not be used for setting the default > timeout. Because, if you set the timeout = 0, the default timeout will > be meaningless. And the timeout module parameter of 0 means "no timeout > module paraameter specified". > > Signed-off-by: Yuechao Zhao You should also replace static int timeout = WATCHDOG_TIMEOUT; with static int timeout; to ensure that the module parameter is only evaluated if it is actually set. Otherwise your patch has no real impact except if someone explicitly specifies a timeout parameter of 0 which doesn't really make much sense. Thanks, Guenter > --- > - modify subject to 'hwmon:(nct7904) Set default timeout' > --- > drivers/hwmon/nct7904.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/hwmon/nct7904.c b/drivers/hwmon/nct7904.c > index 18c95be..27eb276 100644 > --- a/drivers/hwmon/nct7904.c > +++ b/drivers/hwmon/nct7904.c > @@ -1147,7 +1147,7 @@ static int nct7904_probe(struct i2c_client *client, > data->wdt.ops = &nct7904_wdt_ops; > data->wdt.info = &nct7904_wdt_info; > > - data->wdt.timeout = timeout * 60; /* in seconds */ > + data->wdt.timeout = WATCHDOG_TIMEOUT * 60; /* Set default timeout */ > data->wdt.min_timeout = MIN_TIMEOUT; > data->wdt.max_timeout = MAX_TIMEOUT; > data->wdt.parent = &client->dev; > -- > 1.8.3.1 >