Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1447759yba; Sat, 6 Apr 2019 12:34:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqwI0eVSyEw6+pXzCkcX2qZIF/bT7laT0SnM4o9WmeQ4WWx0ZbAI7l9fLBKN3nF/pNfgMrDb X-Received: by 2002:aa7:9294:: with SMTP id j20mr20389717pfa.64.1554579278117; Sat, 06 Apr 2019 12:34:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554579278; cv=none; d=google.com; s=arc-20160816; b=Lj/OWk3g/swzoXOJJFmRkYIGULuZK8mTOIi9aWJoxLLNcohiQj6nk9PTj2HbRhHc2h PCH/qbURjGydwJVzDBfESCZ6rnzY3u1Waasbjxr8FEdCVn6JQPMA+WwW6eblIOuMk3CR ycBwsfdedqnLVtJGrxW3XCgTZUWQiHHWXKzGHYuaU7LOYYPSQmNpx/kKQrh9lXpmoW4q KFRt1TU2mV0r86PbReYq8SJoKpLoa3K3qAcrhgIYLA/gH6g99K0jdyql3cqEcX440u4C iS6bZzOoDlLoToOwkwKXAI4eumXVt6NBk4OFm3mW1qTbKum/FwMNuPYWoTl5HR6BiZ5C t89w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject:dkim-signature; bh=2yaoJk61R7nWrPh3m3NjtylxYG5Sac+8txmfA7y56eM=; b=bh8OyA2wAminNXyu51J68gT9gfMWvBd88Q+BGqUN7UsllQq0CV6s17Sa6ZBSOZeIRn loyFmLhnDWm71cb9f09SKmxSxU0e4kR3rNhWJx2HsNOcIiyYOO4YiGOTyoBSJy8eIaBz HO13qDywG6d/TU6sqZ4CjwE/n8GtCdPBElrhPcrW+RrBPo3A2IXQQV3sHW9CDsET9ixQ M3+BUaZOT4pUDou0MwWbXsyf5mLd2o/JGivIqkVBJW7oQM4GSCuk59RWu7be7m6URbvv hFXXxP39y2b5S954+ENp+JKMEoLPpBE6R3UogH1kXoXKNLaZ/cM+dyvX5kzOO9R6qGZK Wi+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=YKlsue1O; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y73si11432774pgd.285.2019.04.06.12.34.11; Sat, 06 Apr 2019 12:34:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=YKlsue1O; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726606AbfDFTc5 (ORCPT + 99 others); Sat, 6 Apr 2019 15:32:57 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:37035 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726427AbfDFTc5 (ORCPT ); Sat, 6 Apr 2019 15:32:57 -0400 Received: by mail-pf1-f195.google.com with SMTP id 8so5178141pfr.4; Sat, 06 Apr 2019 12:32:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=2yaoJk61R7nWrPh3m3NjtylxYG5Sac+8txmfA7y56eM=; b=YKlsue1OlLw7uka+HoxtLktjQ0vuBewmbrTxbqlBK+yHwVKxtJ2Webs6kEmOqEbvLq eG8JNdjz77PzKvDU7udDYQH9BwrI9jrrTXYmUX9LEcD9Oc31l2/Ih4W9OAs23HSYrv5p UzzOjyWKKzOOalwIviSbTZm8dYtf0Kbs1bmEbea2SLClat456UHMd19rerHMDHtYvE51 8DnTutiEmV4eCNs9BsGoS5R7QbLOsQT/Wl/CsN7E3mkdwiVlYu4XI/AFlN/txcC9e/su KfHrRusQ+T/jZBCnnuauHedfhhn6RrM6U3kChhjod5eGnlCVneLVqqqU1oExOCeGfAAE OIrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=2yaoJk61R7nWrPh3m3NjtylxYG5Sac+8txmfA7y56eM=; b=Oi3pWu8ElOQDomh5TA63K+hrwMMNZ1fHx/QypHAVsS0TqT9+9w5C+t8sPtzzjNbsx+ 9wrsZFy1IdXfUqi0uzT9MPDEZk8l7eB1aQR3mrmi936oTgzaUBAwmI9+lgr1Q7jmIcHd MQVqbLCto9FezDrYoyHX4hmT1/3kzxoegOxWRB9Uac1dNMJhMHCOeyq6codKCrGKji4K 2OjXuAxohQOGw1ewFKBFqHelfbUU9yMjhIb28gCDWgExeC1OLnU85o/eYzZ+JatwG+Fz jlu0iaAy4u8ragyIiiY1WzI8gkrk47STbqz3A1t0wB+abg1YcToLhrdleU+q9ESGKUto ok0A== X-Gm-Message-State: APjAAAVoSb6YtRU1AeNq138RLQcUChxuafCrBHCnkmyl7wi4RajfaV51 wpaQ3pYX91oWHNlVjuTSnIpkq8e8 X-Received: by 2002:a63:29c8:: with SMTP id p191mr19468394pgp.197.1554579176130; Sat, 06 Apr 2019 12:32:56 -0700 (PDT) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id s19sm36399808pfe.74.2019.04.06.12.32.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 06 Apr 2019 12:32:55 -0700 (PDT) Subject: Re: [PATCH] watchdog: machzwd : fix warning Using plain integer as NULL pointer To: Hariprasad Kelam , Wim Van Sebroeck , linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org References: <20190406131415.GA3844@hari-Inspiron-1545> From: Guenter Roeck Message-ID: <3d381fb9-4721-d2a9-9829-56697afd727c@roeck-us.net> Date: Sat, 6 Apr 2019 12:32:53 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190406131415.GA3844@hari-Inspiron-1545> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/6/19 6:14 AM, Hariprasad Kelam wrote: > Changes passing function argument 0 to NULL to avoid below sparse > warning > > CHECK drivers/watchdog//machzwd.c > drivers/watchdog//machzwd.c:321:25: warning: Using plain integer as NULL > pointer > > Signed-off-by: Hariprasad Kelam [reluctantly] Reviewed-by: Guenter Roeck If anyone is still using the HW supported by this driver, it would be a prime target for conversion to use the watchdog subsystem. This would reduce code size and improve driver stability. _That_ would be useful. The only reason for replacing 0 with NULL is to make a static checker happy. This kind of change adds zero value to the code. Instead, it takes time from those who have to review the patches and apply them. If we ignore such patches, we'll get them again and again, taking away even more time. If we don't ignore them, we encourage submitters and get even more useless patches. If we try to discourage them, we risk being accused of being unfriendly. This is a perfect lose-lose situation for maintainers. Guenter > --- > drivers/watchdog/machzwd.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/watchdog/machzwd.c b/drivers/watchdog/machzwd.c > index 88d823d..c3926d0 100644 > --- a/drivers/watchdog/machzwd.c > +++ b/drivers/watchdog/machzwd.c > @@ -318,7 +318,7 @@ static long zf_ioctl(struct file *file, unsigned int cmd, unsigned long arg) > case WDIOC_GETBOOTSTATUS: > return put_user(0, p); > case WDIOC_KEEPALIVE: > - zf_ping(0); > + zf_ping(NULL); > break; > default: > return -ENOTTY; >