From patchwork Tue Jul 9 06:30:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Chevallier X-Patchwork-Id: 13727338 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D5420C2BD09 for ; Tue, 9 Jul 2024 06:34:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=au751q6uXgdNnQ+9HA8qxp8WnsnVyZHIPDFw4WURLBk=; b=L+VJmChtf3wndD4ZcjAsnLKXyb 7YB4/QnfZkHa0o7Xu1qYsWXkqQX8OI2gS9ecW7jdPHko/07a3czRaS3T3YjTsqMN2sDXAji9fJKt+ LDyfdgppYDREzNPEMw+mRvqRZQ7HqDu7AqYwCb/zP2fDoxCmOvN7xJu59/u23qOtiX7Dt+7/kqbpU 22IB2V+FfmX9GFN5/xA0lj+Dfr3zazd7gcgHvj0ElPTgZDD8wNcBp3CMZxN6ihiOzKaagwIYFvUc5 msRwfcWMl54TNwf1sWN4WRFVE2owrzVjVM7vvZE5dlZ5sTNe4A2d545tbZx+pFhL2pIP3nvAScwO1 vvSC5uyQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sR4QE-000000065pZ-00Ve; Tue, 09 Jul 2024 06:33:54 +0000 Received: from relay8-d.mail.gandi.net ([217.70.183.201]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sR4NT-000000064W6-2WoE for linux-arm-kernel@lists.infradead.org; Tue, 09 Jul 2024 06:31:05 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id C22CA1BF204; Tue, 9 Jul 2024 06:31:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1720506662; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=au751q6uXgdNnQ+9HA8qxp8WnsnVyZHIPDFw4WURLBk=; b=mU814nPArkaFVMKrSrcmWZmTHMLjh+Kt4RZ9LqZRo5YYWXOxFdmabkkHWrXgSIaaY4QjdW cz0WP7VjIY9p9L/m0LC0OMTrKFptuXP7ln78ZFR4IjaIrW4dlA1PbHi9no8jD53JItwqif ne1GOkWbeU3eoUzRj3onGqMTa8v+DMMQJCL4TJe5qPTYyq56e9vEcmVE3VBwiEreQgDnLl WHWZ4JeKereHdKoCdKMVqk45sBVr4sv1vPako7r6EVeJ23yZR3XpedFhVUcIBfvb6PPFwH 5+suGQW/PerQ+zR37Il53KexX8NyN5nNcBj9ctc/eXCzbVxamUOpIVHXlZbLKg== From: Maxime Chevallier To: davem@davemloft.net Cc: Maxime Chevallier , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, thomas.petazzoni@bootlin.com, Andrew Lunn , Jakub Kicinski , Eric Dumazet , Paolo Abeni , Russell King , linux-arm-kernel@lists.infradead.org, Christophe Leroy , Herve Codina , Florian Fainelli , Heiner Kallweit , Vladimir Oltean , =?utf-8?q?K=C3=B6ry_Maincent?= , Jesse Brandeburg , =?utf-8?q?Marek_Beh=C3=BAn?= , Piergiorgio Beruto , Oleksij Rempel , =?utf-8?q?Nicol=C3=B2_Veronese?= , Simon Horman , mwojtas@chromium.org, Nathan Chancellor , Antoine Tenart , Marc Kleine-Budde , Dan Carpenter , Romain Gantois , kernel test robot Subject: [PATCH net-next v17 12/14] net: ethtool: strset: Remove unnecessary check on genl_info Date: Tue, 9 Jul 2024 08:30:35 +0200 Message-ID: <20240709063039.2909536-13-maxime.chevallier@bootlin.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240709063039.2909536-1-maxime.chevallier@bootlin.com> References: <20240709063039.2909536-1-maxime.chevallier@bootlin.com> MIME-Version: 1.0 X-GND-Sasl: maxime.chevallier@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240708_233103_807512_07220B44 X-CRM114-Status: GOOD ( 12.84 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org All call paths coming from genetlink initialize the genl_info structure, so that command handlers may use them. Remove an un-needed check for NULL when crafting error messages in the strset command. This prevents smatch from assuming this pointer may be NULL, and therefore warn if it's being used without a NULL check. Signed-off-by: Maxime Chevallier Reported-by: Simon Horman Reported-by: kernel test robot Reported-by: Dan Carpenter Closes: https://lore.kernel.org/r/202407030529.aOYGI0u2-lkp@intel.com/ Reviewed-by: Christophe Leroy Tested-by: Christophe Leroy --- net/ethtool/strset.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/ethtool/strset.c b/net/ethtool/strset.c index c678b484a079..56b99606f00b 100644 --- a/net/ethtool/strset.c +++ b/net/ethtool/strset.c @@ -289,8 +289,7 @@ static int strset_prepare_data(const struct ethnl_req_info *req_base, for (i = 0; i < ETH_SS_COUNT; i++) { if ((req_info->req_ids & (1U << i)) && data->sets[i].per_dev) { - if (info) - GENL_SET_ERR_MSG(info, "requested per device strings without dev"); + GENL_SET_ERR_MSG(info, "requested per device strings without dev"); return -EINVAL; } }