Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp160427lqm; Tue, 30 Apr 2024 16:47:48 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX8E4WLexrBuz2P52wg7GLRP66Uud959ruxeEncaeavQjSOPGzGiGSiE6BpvIJzieyg9DT/hqlA5bRWCi7NT13rULHWlhIqvAqYoW3Pfg== X-Google-Smtp-Source: AGHT+IGOh227Vip6xafvgIe+VY9HZUbyihkPC+9XULjy+qUHJtX2CP0C60cYJOCKy/+SdZ8vwPfT X-Received: by 2002:a17:902:e88d:b0:1eb:ac3c:d174 with SMTP id w13-20020a170902e88d00b001ebac3cd174mr1130583plg.2.1714520868214; Tue, 30 Apr 2024 16:47:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714520868; cv=pass; d=google.com; s=arc-20160816; b=0BehQqs8+U2rVcaYyU2muciv33m21wYLWIrFjKvh52Cziw3+q6ofYJtdkDwd+Lh1ap mjacW8VbYAdHyxquXdCKI0vxO9AOfGc0eNv5tf6VHp7wrMWWqoV3e3yQZuBM95hbg6qh 5JfmucfOercgI3WMc99h+8DekLEhg59AGwOWnrTUXJ1F4ns3shb66TyVY0qISgmsBhVD BluLMBXB2yqTegzCBsZtEJ+3x1UUn4OLkw0pvDAJtpLXuCnQoXFYDyQHzRgX1kxKuUx+ eHiJQ/IL+Nre82xhOE07AFT1CcEruM50EVVd3McadjEumCWUk4fsC++zfh5bwDW86Jvb c35A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:message-id:subject:cc:to:from:date :dkim-signature; bh=kLTYhyNn9aGD98LGwc7cNb8xE+/23y9UFFLHfFKNA8w=; fh=ujugmvWyDP5OlietvSefvJzo8MivSxA/HAsVYZtqzbc=; b=O449ITqr+DcN24s6YbHj607m0vbwy8lt7+7lkUEmwggz4213LCoTwNYvNqL6NShHPJ Q5N1aGwXSvHSnnWSkb/lZbpmgnGSCLkMJPooZhvJNuF9OUrKcrtq319/v7xetDsid5k7 mRcaduAr1d0kRAtaJD/AtWTk98r+FrcF9UovuN/Aw5uIuXgz+G/mwZuKhhmc1xvYItvT uIhdYCQeRSk+Q8EH0Qqj59pAkALplRnULlKx7Wa9X0FwXQndFlSXAeyoShlzfSjtJ6C+ Lgh3ZPd6s1t12uSkg/9YwNtKpITPxD/r+P1DgAn8Iw/YcXwtUR6RPiKIp/WGbTaGvKlZ 0hSA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="U/hM6/74"; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-164803-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-164803-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id lw6-20020a1709032ac600b001e23d5d66ecsi1099845plb.191.2024.04.30.16.47.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 16:47:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-164803-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="U/hM6/74"; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-164803-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-164803-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id B59DD284F46 for ; Tue, 30 Apr 2024 23:47:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 195691C0DEC; Tue, 30 Apr 2024 23:47:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="U/hM6/74" Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (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 C3D2F1BED90; Tue, 30 Apr 2024 23:47:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714520859; cv=none; b=klmK+TFB+rtSrDjc2sQfIIvlVRECgQtHNfPQgg9EpBXKOa/oo/Q2eQlJKG5kV8pToeCcDWCKrJZBDUqatlRbHaVGEqWU41SE+M3cJGm+De6NCr4WCIrS6pFZCIi5G0Be/qbpuxrCiqDpN5Ur4kgrMavQXFwIY8fvNlX40zdAOLE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714520859; c=relaxed/simple; bh=0f7aPbWLeez6QzdgFkMH6OaPb4xqp+8j+iosLZwnXpQ=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=U8CrtG9M6vz9k1ULb5vMcjzrynsDDGU7oMhhDQSHYeSyyaN/jtZKkoyN5zV1C4vzTzh6SQgWtIVS+4KrKiMstU3eDbfrS1LFP1EoNAYIwz6xy2moQN7EPiZtHhKI/9gkQt2ktykBNY4jsa/GqVfcgCQhrmrw2xt6f/IRJZ9KV1c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=U/hM6/74; arc=none smtp.client-ip=209.85.128.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-41bca450fa3so29369245e9.2; Tue, 30 Apr 2024 16:47:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714520856; x=1715125656; darn=vger.kernel.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=kLTYhyNn9aGD98LGwc7cNb8xE+/23y9UFFLHfFKNA8w=; b=U/hM6/74IkGdSnyvClM0+yAotqCVRsX8neMvbdmCUlrciYYKJc1b8kvueatjxA1R/N G/N/IM0+Ab67dDJaq1E/1U+PFPASlWSxvBPPp0iKWGO8Krfxvpw82Mt78fGzTPJQ2tsc iTbx2k34i5un5pthcvTc6xyKUX6nF1MVVi2wdcWFfKV7ZCJ+NstOlyvdD1Ng6pG2wBKG bLcOCY+qj2Arbq5JrTYb3OzxcQcZwXWQIJlSTO3gjFj5tHpqoEsSawZxT1Skf+QM84iA 9uwgzYY4VmV6PzNkXMgv2jor5qsH+/oF3wS/o40g4lKml/Rk+CulanBwleCMj9Zpkdn7 wXrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714520856; x=1715125656; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=kLTYhyNn9aGD98LGwc7cNb8xE+/23y9UFFLHfFKNA8w=; b=PJ9D0KcvymeOERqDkmbedszRzKcaLNHWL9VciJrNnbG7YVMrNNX4z+N+YHJyt55br8 AwA66d0sIVbAB8f3TBeiD53mokhYBv8rl1mRH2lDet3bsNzEyva1VEo7QLK7t1KT71Vm ljyHRPBsAR+hyXE2k9SC15v4A23n2SXcWU4tDPLzTxAY6MvP/RwyN9ST7DokDSuwJqap kNO37z4kZUulHQaIT0JH+JKoGxQzGucNoKeux9HI1HPeDBPIcAip0kHML9IHs+XJOidl M2UtTDava6IyBD4E3vXkyBW5xKyU91mWv/JwxzzG6ohwrLVw4Mpg+I4UJXDZEsORumrx H+sQ== X-Forwarded-Encrypted: i=1; AJvYcCV5QVFF61U3ZmJQWIkZnugEqRyVZ9mi74/VpBZUJXl6YwNtaX2z+Vy+NMlXo6Imq/9bkSL0v7XPZlZtMIJMr6kp+SJFNWHj6LAT2Iq0QPMQlRTBCvYvuA1LCDYeMUaMJFsHSPNkxYvE/w== X-Gm-Message-State: AOJu0YzK58IRbsBi6zbuFSLslk3+6cUSseqYDCdJjY6e6Yb79KrQDyV4 ZoRPcDqSt0wG2c3RTnA6zXXmEinEdnaa4sCGXO+fr+gs2BwdyEkruOReTW4= X-Received: by 2002:a05:600c:46ce:b0:41b:e609:bc97 with SMTP id q14-20020a05600c46ce00b0041be609bc97mr698348wmo.2.1714520855909; Tue, 30 Apr 2024 16:47:35 -0700 (PDT) Received: from octinomon.home (182.179.147.147.dyn.plus.net. [147.147.179.182]) by smtp.gmail.com with ESMTPSA id t15-20020a05600c198f00b0041c02589a7csm386836wmq.40.2024.04.30.16.47.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 16:47:35 -0700 (PDT) Date: Wed, 1 May 2024 00:47:33 +0100 From: Jules Irenge To: leon@kernel.org Cc: jgg@ziepe.ca, linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, lishifeng@sangfor.com.cn, gustavoars@kernel.org Subject: [PATCH] RDMA/ipoib: Remove NULL check before dev_{put, hold} Message-ID: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Coccinelle reports a warning WARNING: NULL check before dev_{put, hold} functions is not needed The reason is the call netdev_{put, hold} of dev_{put,hold} will check NULL There is no need to check before using dev_{put, hold} Signed-off-by: Jules Irenge --- drivers/infiniband/ulp/ipoib/ipoib_main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c index 6f2a688fccbf..4abec0124ea3 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c @@ -329,8 +329,7 @@ static struct net_device *ipoib_get_master_net_dev(struct net_device *dev) rcu_read_lock(); master = netdev_master_upper_dev_get_rcu(dev); - if (master) - dev_hold(master); + dev_hold(master); rcu_read_unlock(); if (master) -- 2.43.2