Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp409120pxa; Fri, 31 Jul 2020 15:47:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJu0EUiEyx7bgcBr4eh6LW+YhDGf9a5QdxxmNtcMFFxT/PMc7lZCTacWgx4Wyr2Q/mR2O1 X-Received: by 2002:aa7:ce91:: with SMTP id y17mr6079619edv.105.1596235632757; Fri, 31 Jul 2020 15:47:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596235632; cv=none; d=google.com; s=arc-20160816; b=c763Y1X0ZUv9xVSKm4B+HmyRQwCz28YiHQkeb3lCkBk8/onYo37IKfSvU2TWsSCJxd KRftHbhvajE28qUzy4fNrWu5strtihLmiE6D8DOXVf+cA6Z738nKdrpAfIwMFfeU/yej JdSPVBJ9sl/cbbhpeBHReC1BuoUnNlRjUmChoWAC7r4R6xIUnd+FTovHMNtj7BY8ydzl C9HSOiL8rTPFLr15ImYvzIJ3DAbs1oaLGy29043QMldRGX3eGTcwFKIIULD6QLwBJKdm rN4BqP2FFOshMnxEPa/hxEsBiSp0rMFdgTzgybrpbiYRMkKL+Ny9IU2kEoVToyx7ED+8 Lw3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:lines:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=7BDPs079rl+NOOYZCPnU4bq9MlzNo7Pk2Nf+MPgUi1E=; b=zkNKIR4b7qAiiTE1kLdj/bIWcYPSUWb2wAKxY/yMjyDrvMfxcoLgq50d9ldIztciDw pfbOqe26vzylTb4IZBzICp+zAAjPiiZF5HuzelgbDVyMFxa0erGht3oqWmbXJ3gzIni/ 2OFRoMnthI0096PghdCIZOXepjUMMQeR8ElTSzsYWQw04VrEOUrBX+kfIuatECAStHij aCxvpE/Gv9knqs+tAa7JbMY3L3lS605v1FziOtQJJDgvlcpBtGXEyEznhZV+nkZDvQnj GQdL5RG8S8/7C+CV9Y5X6ZP9MEMvbiLJqcsrBn9H0b4cKpyMTn7saQkG/8churUk/rpu W2VQ== ARC-Authentication-Results: i=1; mx.google.com; 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 t14si5762688ejb.435.2020.07.31.15.46.50; Fri, 31 Jul 2020 15:47:12 -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; 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 S1727015AbgGaWnp (ORCPT + 99 others); Fri, 31 Jul 2020 18:43:45 -0400 Received: from mx2.suse.de ([195.135.220.15]:54720 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726099AbgGaWnp (ORCPT ); Fri, 31 Jul 2020 18:43:45 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id C2701AB7D; Fri, 31 Jul 2020 22:43:56 +0000 (UTC) Received: by lion.mk-sys.cz (Postfix, from userid 1000) id 63166604C2; Sat, 1 Aug 2020 00:43:42 +0200 (CEST) Date: Fri, 31 Jul 2020 15:54:56 +0200 From: Michal Kubecek To: Gaurav Singh Cc: "David S. Miller" , Jakub Kicinski , Florian Fainelli , Andrew Lunn , Oleksij Rempel , YueHaibing , Aya Levin , "open list:NETWORKING [GENERAL]" , open list Subject: Re: [PATCH] [net/ethtool] ethnl_set_linkmodes: remove redundant null check Message-ID: <20200731135456.gbzznq6x2f5pznx6@carpenter.suse.cz> References: <20200731045908.32466-1-gaurav1086@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ltnqnoysjs5z4x72" Content-Disposition: inline In-Reply-To: <20200731045908.32466-1-gaurav1086@gmail.com> Lines: 66 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --ltnqnoysjs5z4x72 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jul 31, 2020 at 12:58:44AM -0400, Gaurav Singh wrote: > info cannot be NULL here since its being accessed earlier > in the function: nlmsg_parse(info->nlhdr...). Remove this > redundant NULL check. This is what the static checker tells you but it could still mean the other place is missing the check. The actual reason why this check is superfluous is that the function is only used as ->doit() handler which is never called with null info. > Signed-off-by: Gaurav Singh The subject should rather start with "ethtool: " (instead of "[net/ethtool]= "). For the change itself: Reviewed-by: Michal Kubecek Michal > --- > net/ethtool/linkmodes.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) >=20 > diff --git a/net/ethtool/linkmodes.c b/net/ethtool/linkmodes.c > index fd4f3e58c6f6..b595d87fa880 100644 > --- a/net/ethtool/linkmodes.c > +++ b/net/ethtool/linkmodes.c > @@ -406,8 +406,7 @@ int ethnl_set_linkmodes(struct sk_buff *skb, struct g= enl_info *info) > =20 > ret =3D __ethtool_get_link_ksettings(dev, &ksettings); > if (ret < 0) { > - if (info) > - GENL_SET_ERR_MSG(info, "failed to retrieve link settings"); > + GENL_SET_ERR_MSG(info, "failed to retrieve link settings"); > goto out_ops; > } > =20 > --=20 > 2.17.1 >=20 --ltnqnoysjs5z4x72 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEWN3j3bieVmp26mKO538sG/LRdpUFAl8kIqYACgkQ538sG/LR dpVuQwf/ZIW2LoV7UbsdkhDsyo2zBbjP+Ae033JR/gd0DPSYClAtBvdQIPAPKST1 5Tz2kJO1peojJcp0G3lr1EDvWzlxeCqkpq3JzN4823O1j/C2GBfRnbQx7fMO5Jj4 Ejujz+Pxkg/MVs7wgvUCuJswSuOKH9V756ClMo1BqeHwQj7vcEovdOxRQ3g+GPRc fnKh+9DO38uWU2B0CSkrwGYeRE2K5toPj0Q2+chdNQGwJJONVUhpB9fxPNPvt3fk A/rQrJFLv1VgNdVrw2DhV4/c1Ar9w6rlsKTDuRJg4AUUTfKjsUqW51DIZtgiMFA3 EA47sXhsxbjb/DCoFkj/101gby8VGQ== =NBhY -----END PGP SIGNATURE----- --ltnqnoysjs5z4x72--