Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp14526705rwb; Mon, 28 Nov 2022 02:02:28 -0800 (PST) X-Google-Smtp-Source: AA0mqf6dKRJM5aCfWZof9p7W1PADUkatUSKXXqzYpFmEK5oeR5FbSdzDTPFmVM6WAcUrmfb5jmWf X-Received: by 2002:a62:19cf:0:b0:574:3750:3589 with SMTP id 198-20020a6219cf000000b0057437503589mr27311134pfz.7.1669629748459; Mon, 28 Nov 2022 02:02:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669629748; cv=none; d=google.com; s=arc-20160816; b=A4ZE2USc/h1LkBLq9KjOU1NagXCrz044WCmbJMwm4ZKtc4mZf4qC67qlDjy+Qdmigh OOZIMpWuyPT7/oRfLW8Rt8UkGbrmnsiOib31uYWiFK4Yfcxi4RsCmdYy6NjM8PqKoOyU ijk8wPFfQMKeApbPeKqDY9ALP2qqpDaiE3OeSB3oYYnV7S9utYPClv6b9oNdm7/I4skH T/4MewYP7ADbOQAElegGjCHKFHAeIUZ8jXyit6tYuAsieCs40bt7AYdJzSvHVUCDKDuQ 9/iIfoNlRlzp02eP7fIzG4e3xCj2en4S97HApJfBoVg/j1uT11S+ZQsB5T/+M/9faGef MLDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=tGtPFt5Aj3PxW1SafeVvkLfaozAAV43dov8pkUuOsQg=; b=sm1OpHyfUBzfVNvASsSgoCASlfFf4W8P2pxJr2HkeCjCVEnnAXgnPbtT1IAtyHLuDP brQcv1MBt8aFPhZ6nTeq+x9Galpopzp/g0eWasM6uKahowkJt8vLwVamES3dez+1/PYE xYmskgHINi/P7mtkO3FbAmJYt/IHmm/GLO1+G1uvajeXh0Wix00/v37EKYK5y7x4xIYN /2AH2Yci8DiCsqUCBJhWiWC2vnpZxWG3N8TOnQH6s8eHH/GwwVEi5v5pvgyy3HjetJUI sGrZRyyCVefVdLJy9TuUKDT5WvfL8MNK1Ws94mNyMkY20M9ryDQyP4k71VhYCZmu5nVj SAHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bQo1kOIC; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o15-20020a170902d4cf00b001871d062940si12299239plg.400.2022.11.28.02.02.16; Mon, 28 Nov 2022 02:02:28 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bQo1kOIC; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229916AbiK1Juw (ORCPT + 85 others); Mon, 28 Nov 2022 04:50:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35108 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230062AbiK1Juo (ORCPT ); Mon, 28 Nov 2022 04:50:44 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C27F193D4; Mon, 28 Nov 2022 01:50:44 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 920A36103F; Mon, 28 Nov 2022 09:50:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 79253C433D6; Mon, 28 Nov 2022 09:50:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669629043; bh=McOiQh02HDb8i7KkG9Ud2wisjbbZoHR/rp2t+eUVynU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=bQo1kOICYyPdXGDjuwVkT6nksMt+ENmxk+f56vg0YgFqDfzeoW2N5NDZMcCYQ/mEl 8NyyOOiDv/6A8+5dsSmGgdNA6pAzRIYijbMUY2tPg2+UnKQVL1OAOkPPqYFZTYloQR eF6j5vQDvjYsyPPx2W+lcfSSUH2A7CuyxUI6XoHCm98Bbd67RS+tNJFKBeEJyoYliK TczbY11IefCYy2Rhky16RjzdEKi58Rr9tvQhSUemejvuSJmz8wDa6T2An/w4BfewcB F51Bdz3VLu6RYjlstBJjOIIUGAjSfIsMT5AhNW2HKdTexHDJ5riMHXFOLeneosPzUU 4JUOfln8f7fJg== Date: Mon, 28 Nov 2022 11:50:38 +0200 From: Leon Romanovsky To: zhang.songyi@zte.com.cn Cc: yishaih@nvidia.com, jgg@ziepe.ca, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH linux-next] RDMA/mlx4: NULL check before dev_{put, hold} functions is not? needed Message-ID: References: <202211231708254077305@zte.com.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202211231708254077305@zte.com.cn> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 On Wed, Nov 23, 2022 at 05:08:25PM +0800, zhang.songyi@zte.com.cn wrote: > 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 warnings: > /drivers/infiniband/hw/mlx4/main.c:1311:2-10: WARNING: > WARNING NULL check before dev_{put, hold} functions is not needed. > > /drivers/infiniband/hw/mlx4/main.c:148:2-10: WARNING: > WARNING NULL check before dev_{put, hold} functions is not needed. > > /drivers/infiniband/hw/mlx4/main.c:1959:3-11: WARNING: > WARNING NULL check before dev_{put, hold} functions is not needed. > > /drivers/infiniband/hw/mlx4/main.c:1962:3-10: WARNING: > WARNING NULL check before dev_{put, hold} functions is not needed. > > Signed-off-by: zhang songyi > --- > drivers/infiniband/hw/mlx4/main.c | 12 ++++-------- > 1 file changed, 4 insertions(+), 8 deletions(-) This patch doesn't apply to rdma-next tree. Please fix commit title "not?" -> "not" and resubmit. Thanks