Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1988379rwb; Wed, 30 Nov 2022 00:16:12 -0800 (PST) X-Google-Smtp-Source: AA0mqf45JCURz1ZOgAfeatI+ls1PkXHW20JKY89+fxb/ec9vvjE2nI89xHRTRpT4njDqXH4j0y/H X-Received: by 2002:a62:1812:0:b0:56c:afe:e8bf with SMTP id 18-20020a621812000000b0056c0afee8bfmr41639243pfy.51.1669796172342; Wed, 30 Nov 2022 00:16:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669796172; cv=none; d=google.com; s=arc-20160816; b=fDq1trGi3PPKICYzJIHeA/mouXw6i/CJBzzqMRC2B9lh6vtkcbyJhV74QKKmFOyrte XwrQQdsVOWGHkAYjtdXJTnrKXhUms6qsVBPNBGjLmGkDh6iD2yC/UrHvv2+A4TFkGqmU j32yalfpMiQt/NZDqDf/7tskpGZ7idHd34ofsrT1uoxqrDj55TL4ynl2R182HpKP6B/c m8o8gmhA24Gevvqr/LsdMuptGYNH97mHrN5PyyQceSeVjeoIQEOAaNOX+Pe5iEQaBbTf hgp5fsl3Oln6mfehAzPnrDM709t6SEed7VlDOR41gLVgYgkVCLZQ/rZwgzo310lSbqUN xxsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:mime-version:message-id:date; bh=5o6V/AEdD0ywiEqySwCUpNN819WZqvzl6WSpFVXPHCU=; b=h7Wvoxc1PCFbJI+MHHPn1iiVt1bqtt0yfGLuAceegGql6PTJ/F608u2lOTUl35nORI QuWWvHk03qVXekr3tftPB8TiOV90bjLMziojneso80m82XdW6t+wK6qua6N3Vuv0FMi5 SU+JqUpuTeJkrLoeSEchXzjM7KU2CyW++lExHqx0PWvyieuyyP0cg9RX/tD0GQmJNG+x dr3Sd2NaBkZXwkmtPWCHHp34mC2lBPG0HFWDjUT4wnSh21ehEPPxeXZUHtkUb7ZhVzRM 5kZQZflgH8QUob3mBRVQAYFrUxgT5hBxve32/43E2yA5dlJ0iloxplC0v9CaTuHvBJ0l eM8A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y5-20020a63ce05000000b00477810a445asi631157pgf.589.2022.11.30.00.16.01; Wed, 30 Nov 2022 00:16:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234107AbiK3Hlo (ORCPT + 84 others); Wed, 30 Nov 2022 02:41:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230049AbiK3Hll (ORCPT ); Wed, 30 Nov 2022 02:41:41 -0500 Received: from mxhk.zte.com.cn (mxhk.zte.com.cn [63.216.63.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A04005B5A5; Tue, 29 Nov 2022 23:41:40 -0800 (PST) Received: from mse-fl1.zte.com.cn (unknown [10.5.228.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mxhk.zte.com.cn (FangMail) with ESMTPS id 4NMWNz0ttpz8RTZM; Wed, 30 Nov 2022 15:41:39 +0800 (CST) Received: from xaxapp01.zte.com.cn ([10.88.40.50]) by mse-fl1.zte.com.cn with SMTP id 2AU7fOKX001717; Wed, 30 Nov 2022 15:41:24 +0800 (+08) (envelope-from zhang.songyi@zte.com.cn) Received: from mapi (xaxapp01[null]) by mapi (Zmail) with MAPI id mid31; Wed, 30 Nov 2022 15:41:27 +0800 (CST) Date: Wed, 30 Nov 2022 15:41:27 +0800 (CST) X-Zmail-TransId: 2af9638709276644dd5b X-Mailer: Zmail v1.0 Message-ID: <202211301541270908055@zte.com.cn> Mime-Version: 1.0 From: To: , Cc: , , , , , , , , , , , , , Subject: =?UTF-8?B?W1BBVENIIG5ldC1uZXh0XSBuZXQvbWx4NTogcmVtb3ZlIE5VTEwgY2hlY2sgYmVmb3JlIGRldl97cHV0LCBob2xkfQ==?= Content-Type: text/plain; charset="UTF-8" X-MAIL: mse-fl1.zte.com.cn 2AU7fOKX001717 X-Fangmail-Gw-Spam-Type: 0 X-FangMail-Miltered: at cgslv5.04-192.168.250.137.novalocal with ID 63870933.000 by FangMail milter! X-FangMail-Envelope: 1669794099/4NMWNz0ttpz8RTZM/63870933.000/10.5.228.132/[10.5.228.132]/mse-fl1.zte.com.cn/ X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 63870933.000/4NMWNz0ttpz8RTZM X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: zhang songyi The call netdev_{put, hold} of dev_{put, hold} will check NULL, so there is no need to check before using dev_{put, hold}. Fix the following coccicheck warning: /drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c:1450:2-10: WARNING: WARNING NULL check before dev_{put, hold} functions is not needed. Signed-off-by: zhang songyi --- drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c b/drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c index 32c3e0a649a7..6ab3a6b6dd8d 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c @@ -1448,8 +1448,7 @@ struct net_device *mlx5_lag_get_roce_netdev(struct mlx5_core_dev *dev) } else { ndev = ldev->pf[MLX5_LAG_P1].netdev; } - if (ndev) - dev_hold(ndev); + dev_hold(ndev); unlock: spin_unlock_irqrestore(&lag_lock, flags); -- 2.25.1