Message ID | 20240211150535.3529-1-d.dulov@aladdin.ru |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-60810-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp1966726dyd; Sun, 11 Feb 2024 07:06:30 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUqiaGh5Uqe8p0S2Q7mJehDa9d+GAlYid0WriRhP5/iZnUZQTNjrdcJjjcU2P/5nEJO85Uarg1cRlJDzMDRSUiSXgBSLA== X-Google-Smtp-Source: AGHT+IHN7A8etFz5HxxSNjpbigANbR/wE3cxUnhlmXQeo6TVzjKPW/nigcI/ePEzZs66cY1JM4t5 X-Received: by 2002:a05:6214:21a9:b0:68c:c602:d3f9 with SMTP id t9-20020a05621421a900b0068cc602d3f9mr3294453qvc.10.1707663989896; Sun, 11 Feb 2024 07:06:29 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707663989; cv=pass; d=google.com; s=arc-20160816; b=nOp6YLyz4FXo2ojt55nU/Vhfhqjvjmcnp3aa5Isz6ynR/y3nx9AltvaBuYZNE1oRX3 zbMZ+YntPi7bSb9y/1H1iJR4fbaqkjjbN3vL8a/wQr5WEXfBShfLMY1jH3o7EdO2lPwv PEhK4pN73cEOkrv2kW2c/AVNf8zxb4AjBGtZ1YT6mNvqaV2h7R4vtGDx3IdrdrGgkGiA YFPoZSJZhxLt2+yWIbmUAmTTvQefx07Va8fiOqkOWAcWx6B5rAPWgIBNj5VGl5+9wdbY WDPqo6G4jIa64+vlmE+V87sp5iTX+xvepmZU4nX35JTz/kLLF+OV7pgYwCuY1HYus+ru 4g8A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=JiJMNHuWUt27aHbp77MNewC5nTaD1lGRVtCG8jv3klU=; fh=mD99Rif17/383dZg6K0w7Ewxb7NMda1lQh5PGK/zRZ0=; b=wOmWwKXczvMIE6CfHY1yTi58OTQ2GCmanqTsPaJ1TCNr7X3PYRs+4/WSWYxW+vIALc vYRjfjlskSNrUWqD5mVKrmwXqw6UPOKZkx1UWn6ehE/kye7fNRPs10Jv+FL8m0RgDJvs hdi5WFxPbC/dezC0VMffRR5kt6rD1jYo11Ka1HMuf57WpYj4KYfCLFZZ16ugEbIxdAcQ fwPNXxNVdGgK0/ojLef6k5Zm/nJQkpqHTUzThXFXrSTQcyP7Vs03n1p3V2jL/eNj25Ha XS7C1RMxPJAHx4/QSVhtrQ6BQ9Fc9L7vfsXG3GTuf9dQOpTNqKhnN0tKm3ZMgAR195ea F3aA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=aladdin.ru dmarc=pass fromdomain=aladdin.ru); spf=pass (google.com: domain of linux-kernel+bounces-60810-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60810-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aladdin.ru X-Forwarded-Encrypted: i=2; AJvYcCXHGCjJR0U4Dp0FC4abAEM5ObuwLOnIU4rtMc+LqEu5j55g2LNBcaYjdxK8kdlfmOjDJR+w+7zKwy3S5JwChgsFwNJ34g== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id gf6-20020a056214250600b0067f49d274besi6730146qvb.428.2024.02.11.07.06.29 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Feb 2024 07:06:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-60810-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=aladdin.ru dmarc=pass fromdomain=aladdin.ru); spf=pass (google.com: domain of linux-kernel+bounces-60810-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60810-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aladdin.ru Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 7605C1C20CE6 for <ouuuleilei@gmail.com>; Sun, 11 Feb 2024 15:06:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 767205C5F6; Sun, 11 Feb 2024 15:06:00 +0000 (UTC) Received: from mail-out.aladdin-rd.ru (mail-out.aladdin-rd.ru [91.199.251.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 409D75BAFE; Sun, 11 Feb 2024 15:05:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.199.251.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707663958; cv=none; b=pcNGWLbo/l5qCn18GlqA3zFBp6xODZKYgErfuG4sopZZ/mzrIkeCxt/4MEL0a8ASgRIIy8vykHNgHbwV7R14j9UhkQhj7dwizb0UG6U4FksfeNFb3x+DRHvsXhgyZ8wsYXp0QeHWfDh0RoQQUR4RloUUxLt1UZjkVJU3whuO5/A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707663958; c=relaxed/simple; bh=L2erQr5VOzvtZwSGbBtPRPaYAXK9HLpbI4kvy9KiY1c=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=CoprA593RD82lJjfCjkuRn3eEoc2pWbInxT5eA7iHfxolgO/ich9SxPoix9je2v25A0h1uFeFelBVXNDWkxZjv35ICYLt5CPr9mEsEy4s/vlw+WD9Ql1ul/YjyfaGrXdS9pjlKIYMQMdPYB5QNb1RdzAZasrT5JcbbCv5EGzQY8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=aladdin.ru; spf=pass smtp.mailfrom=aladdin.ru; arc=none smtp.client-ip=91.199.251.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=aladdin.ru Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=aladdin.ru From: Daniil Dulov <d.dulov@aladdin.ru> To: Wolfgang Grandegger <wg@grandegger.com> CC: Daniil Dulov <d.dulov@aladdin.ru>, Marc Kleine-Budde <mkl@pengutronix.de>, "David S. Miller" <davem@davemloft.net>, Jakub Kicinski <kuba@kernel.org>, Kurt Van Dijck <dev.kurt@vandijck-laurijssen.be>, <linux-can@vger.kernel.org>, <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <lvc-project@linuxtesting.org> Subject: [PATCH] can: softing: remove redundant NULL check Date: Sun, 11 Feb 2024 07:05:35 -0800 Message-ID: <20240211150535.3529-1-d.dulov@aladdin.ru> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: EXCH-2016-01.aladdin.ru (192.168.1.101) To EXCH-2016-01.aladdin.ru (192.168.1.101) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790615475852205264 X-GMAIL-MSGID: 1790615475852205264 |
Series |
can: softing: remove redundant NULL check
|
|
Commit Message
Daniil Dulov
Feb. 11, 2024, 3:05 p.m. UTC
In this case dev cannot be NULL, so remove redundant check.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Fixes: 03fd3cf5a179 ("can: add driver for Softing card")
Signed-off-by: Daniil Dulov <d.dulov@aladdin.ru>
---
drivers/net/can/softing/softing_fw.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Sun, Feb 11, 2024 at 07:05:35AM -0800, Daniil Dulov wrote: > In this case dev cannot be NULL, so remove redundant check. > > Found by Linux Verification Center (linuxtesting.org) with SVACE. > > Fixes: 03fd3cf5a179 ("can: add driver for Softing card") > Signed-off-by: Daniil Dulov <d.dulov@aladdin.ru> Hi Daniil, I am not sure that dev cannot be NULL. But I do see that the code assumes it is not, and would crash if it is. So I think that, functionally, your statement is correct. priv = netdev_priv(dev); card = priv->card; Reviewed-by: Simon Horman <horms@kernel.org>
Hi Simon, I have a general question on the "Fixes:" tag in this patch: On 16.02.24 18:27, Simon Horman wrote: > On Sun, Feb 11, 2024 at 07:05:35AM -0800, Daniil Dulov wrote: >> In this case dev cannot be NULL, so remove redundant check. >> >> Found by Linux Verification Center (linuxtesting.org) with SVACE. >> >> Fixes: 03fd3cf5a179 ("can: add driver for Softing card") IMHO this is simply an improvement which is done by all patches applied to the kernel but it does not really "fix" anything from a functional standpoint. Shouldn't we either invent a new tag or better leave it out to not confuse the stable maintainers? Best regards, Oliver >> Signed-off-by: Daniil Dulov <d.dulov@aladdin.ru> > > Hi Daniil, > > I am not sure that dev cannot be NULL. > But I do see that the code assumes it is not, and would crash if it is. > So I think that, functionally, your statement is correct. > > priv = netdev_priv(dev); > card = priv->card; > > Reviewed-by: Simon Horman <horms@kernel.org> >
On Fri, Feb 16, 2024 at 08:47:43PM +0100, Oliver Hartkopp wrote: > Hi Simon, > > I have a general question on the "Fixes:" tag in this patch: > > On 16.02.24 18:27, Simon Horman wrote: > > On Sun, Feb 11, 2024 at 07:05:35AM -0800, Daniil Dulov wrote: > > > In this case dev cannot be NULL, so remove redundant check. > > > > > > Found by Linux Verification Center (linuxtesting.org) with SVACE. > > > > > > Fixes: 03fd3cf5a179 ("can: add driver for Softing card") > > IMHO this is simply an improvement which is done by all patches applied to > the kernel but it does not really "fix" anything from a functional > standpoint. > > Shouldn't we either invent a new tag or better leave it out to not confuse > the stable maintainers? Hi Oliver, sorry for missing that in my review. Yes, I agree that this is probably not a fix, for which my rule of thumb is something that addresses a user-visible problem. So I agree it should not have a fixes tag. I would suggest that we can just change the text to something that has no tag. Something like: .. Introduced by 03fd3cf5a179 ("can: add driver for Softing card") Signed-of-by: ... > > Best regards, > Oliver > > > > Signed-off-by: Daniil Dulov <d.dulov@aladdin.ru> > > > > Hi Daniil, > > > > I am not sure that dev cannot be NULL. > > But I do see that the code assumes it is not, and would crash if it is. > > So I think that, functionally, your statement is correct. > > > > priv = netdev_priv(dev); > > card = priv->card; > > > > Reviewed-by: Simon Horman <horms@kernel.org> > > >
Hi Simon, On 2024-02-19 18:00, Simon Horman wrote: > On Fri, Feb 16, 2024 at 08:47:43PM +0100, Oliver Hartkopp wrote: >> Hi Simon, >> >> I have a general question on the "Fixes:" tag in this patch: >> >> On 16.02.24 18:27, Simon Horman wrote: >>> On Sun, Feb 11, 2024 at 07:05:35AM -0800, Daniil Dulov wrote: >>>> In this case dev cannot be NULL, so remove redundant check. >>>> >>>> Found by Linux Verification Center (linuxtesting.org) with SVACE. >>>> >>>> Fixes: 03fd3cf5a179 ("can: add driver for Softing card") >> >> IMHO this is simply an improvement which is done by all patches applied to >> the kernel but it does not really "fix" anything from a functional >> standpoint. >> >> Shouldn't we either invent a new tag or better leave it out to not confuse >> the stable maintainers? > > Hi Oliver, > > sorry for missing that in my review. > > Yes, I agree that this is probably not a fix, for which my > rule of thumb is something that addresses a user-visible problem. > So I agree it should not have a fixes tag. > > I would suggest that we can just change the text to something that > has no tag. Something like: > > ... > > Introduced by 03fd3cf5a179 ("can: add driver for Softing card") > Yes, but the "Introduced-by:" tag would be an optional tag for people that like blaming others, right? IMHO we should think about completely removing the "Fixes:" tag, when it has no user-visible effect that might be a candidate for stable kernels. It is common improvement work. And it has been so for years. Best regards, Oliver
On Mon, Feb 19, 2024 at 09:37:46PM +0100, Oliver Hartkopp wrote: > Hi Simon, > > On 2024-02-19 18:00, Simon Horman wrote: > > On Fri, Feb 16, 2024 at 08:47:43PM +0100, Oliver Hartkopp wrote: > > > Hi Simon, > > > > > > I have a general question on the "Fixes:" tag in this patch: > > > > > > On 16.02.24 18:27, Simon Horman wrote: > > > > On Sun, Feb 11, 2024 at 07:05:35AM -0800, Daniil Dulov wrote: > > > > > In this case dev cannot be NULL, so remove redundant check. > > > > > > > > > > Found by Linux Verification Center (linuxtesting.org) with SVACE. > > > > > > > > > > Fixes: 03fd3cf5a179 ("can: add driver for Softing card") > > > > > > IMHO this is simply an improvement which is done by all patches applied to > > > the kernel but it does not really "fix" anything from a functional > > > standpoint. > > > > > > Shouldn't we either invent a new tag or better leave it out to not confuse > > > the stable maintainers? > > > > Hi Oliver, > > > > sorry for missing that in my review. > > > > Yes, I agree that this is probably not a fix, for which my > > rule of thumb is something that addresses a user-visible problem. > > So I agree it should not have a fixes tag. > > > > I would suggest that we can just change the text to something that > > has no tag. Something like: > > > > ... > > > > Introduced by 03fd3cf5a179 ("can: add driver for Softing card") > > > > Yes, but the "Introduced-by:" tag would be an optional tag for people that > like blaming others, right? Yes, That does seem useful to me. > IMHO we should think about completely removing the "Fixes:" tag, when it has > no user-visible effect that might be a candidate for stable kernels. It is > common improvement work. And it has been so for years. Likewise, that does sound like a good idea to me.
diff --git a/drivers/net/can/softing/softing_fw.c b/drivers/net/can/softing/softing_fw.c index bad69a4abec1..5a3f9e4b0b62 100644 --- a/drivers/net/can/softing/softing_fw.c +++ b/drivers/net/can/softing/softing_fw.c @@ -436,7 +436,7 @@ int softing_startstop(struct net_device *dev, int up) return ret; bus_bitmask_start = 0; - if (dev && up) + if (up) /* prepare to start this bus as well */ bus_bitmask_start |= (1 << priv->index); /* bring netdevs down */