Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp315472rwe; Wed, 24 Aug 2022 01:11:47 -0700 (PDT) X-Google-Smtp-Source: AA6agR7TUjUesMPFqmMPX/jbfXVKS8tDBungKm2hcKVkhbKzkWdx6/LFAjBK7ZDnCISuYxznRL49 X-Received: by 2002:a17:907:9727:b0:73d:981d:de2c with SMTP id jg39-20020a170907972700b0073d981dde2cmr2154697ejc.484.1661328707003; Wed, 24 Aug 2022 01:11:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661328706; cv=none; d=google.com; s=arc-20160816; b=nSeJZEX56RXGSM6iIHpwCuStWTAAO7L0rjSKt4EcgUgtNVSKsGVcprnpUkZE96rBY6 YFPfnZoV31w5bdKqVf1gsQHEd/Pq0M1FQK/ZNuCisKY3DKd+IR4schNhLGZpSnmjXp5n iFn7LWt/IUybqaAoHD7LY7cYEmZ9it1oT+G5G0YHoXziX/vk/gqYvrmXDGVv0JX2Wsqr WUguyh9IggkT+M7byRfXwiHxAI1Gvyi7HZEdn8Ci6/ZywLYc59MXec+wadY8Gj83Jq2Y NgFTSTql7gDVl5Yn/7anK+6kicXQKbbVzRCPn2RPXiuscoIzu5t2/P5plAm6R5sFdyMo g2ZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=1vKgNm6BRFVeZ7Pdv+a4C7Ti+m9SsZu4s1UQ5Y46htk=; b=k30uT7STXsfIEbsAhw76F1Ta+OOgnb17vtFqXSOcmA4V8WD4R+1lm51W+SMBIoIkhi wrMhE+46QvruA3WjmjAO1RkVh/2YPLy20RqM6IcYlb+wk1DKcIWOjQlm7l2B2Ew+1ETK LruAyQ1RzKNWemC/2iWOzjSH96GpPuh8giOYM0mQKv92LV0oRIc+sZ69MeCvylUq78a2 442wF2uzE/n/cjyLzg4adN/xhv1DfctMMXpHah0JoxanoyOc+BrktD2x0VM/Y8pb37Xl kRoIu992o9Rraq4rLPz87MoDErHp4nblnYYc8+Vhr2eOA5LawuawwkJDlVeUgyoOvtCc Boqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="Yy0w9y1/"; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y14-20020a056402358e00b004466a9af14esi4095109edc.461.2022.08.24.01.11.20; Wed, 24 Aug 2022 01:11:46 -0700 (PDT) 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=@gmail.com header.s=20210112 header.b="Yy0w9y1/"; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235563AbiHXIFR (ORCPT + 99 others); Wed, 24 Aug 2022 04:05:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234332AbiHXIFP (ORCPT ); Wed, 24 Aug 2022 04:05:15 -0400 Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A7A13CBF8; Wed, 24 Aug 2022 01:05:08 -0700 (PDT) Received: by mail-pf1-x429.google.com with SMTP id x19so12982068pfq.1; Wed, 24 Aug 2022 01:05:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc; bh=1vKgNm6BRFVeZ7Pdv+a4C7Ti+m9SsZu4s1UQ5Y46htk=; b=Yy0w9y1//Bgd7r4+OGNU18as32pSRUhuzqra+9fP202lb5VUPLhHjmi85mLeMqvqD5 6AfpAmcpypr+g5tZlGenfK1E0NcwNmUyqQtqiVvAQtj1kMZ4Cf8kD33HMpqnkTgShndT IYWP1dlWBSyzQ1QuNstaqCnLvOvmt0vHco24o78ea7LuH1yHNvJeP2YfYSY1QtZB2Hg7 kcTAK1SGx78Jv/xej8Oe4vgNU5sMlRYtUpo7j2/9ujKvzFkWKF/2En5py9OF1JLs323E wBFAJ0TSfgmpLx3Xc8as+V1HhP4VOUYCqS5rnWZCCbDqMTd6s63Tma4Ub3rvuJ4552ED AE+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc; bh=1vKgNm6BRFVeZ7Pdv+a4C7Ti+m9SsZu4s1UQ5Y46htk=; b=raX5xDQH1jGDiVPTOtCgJ1qIQgr99GN3FNCf7HjztT4VzpBZWQkhsorMLoCtW/Pjgz LZlIR05uilU4URYmEr2gu00+xqt8KCfpNGHQ9L0Rm6KFmmqFqdSJ/sjEsAw/IS8SmbRw x8KlvbAunp00MWK9bRSmrE+Gcx0BvpbAyGJnsC/cwwiOZjHnmIz/8+5bxyOCqfnrfz08 ZJVK+a+uo3TYGoXhs6Z22oRIdE9hUdEpa5TF2Z8CDeyrRgp6/5I/M6EV+4dayoAhPYqN eyZ4jAk9WJOVk2F7V8ViMNPRgLOuBESvs5GaEi3rWqscA2jzancXJcg5wU6+Xt4qF0Rc PUmA== X-Gm-Message-State: ACgBeo1omITjRD7G2bTrXoeiL32IELWCFojtb0sigBkES7NzH6BmwgBK mGXXtrdZiqyumyGNSzJvyqM= X-Received: by 2002:a63:da13:0:b0:42a:7f03:a00e with SMTP id c19-20020a63da13000000b0042a7f03a00emr14362124pgh.332.1661328307440; Wed, 24 Aug 2022 01:05:07 -0700 (PDT) Received: from localhost.localdomain ([193.203.214.57]) by smtp.gmail.com with ESMTPSA id p7-20020a170902ebc700b00172b27404a2sm8028805plg.120.2022.08.24.01.05.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 01:05:07 -0700 (PDT) From: cgel.zte@gmail.com X-Google-Original-From: chi.minghao@zte.com.cn To: dennis.dalessandro@cornelisnetworks.com Cc: jgg@ziepe.ca, leon@kernel.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, Minghao Chi , Zeal Robot Subject: [PATCH] infiniband: remove unnecessary null check Date: Wed, 24 Aug 2022 08:05:03 +0000 Message-Id: <20220824080503.221680-1-chi.minghao@zte.com.cn> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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: Minghao Chi container_of is never null, so this null check is unnecessary. Reported-by: Zeal Robot Signed-off-by: Minghao Chi --- drivers/infiniband/sw/rdmavt/vt.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/infiniband/sw/rdmavt/vt.c b/drivers/infiniband/sw/rdmavt/vt.c index 59481ae39505..b2d83b4958fc 100644 --- a/drivers/infiniband/sw/rdmavt/vt.c +++ b/drivers/infiniband/sw/rdmavt/vt.c @@ -50,8 +50,6 @@ struct rvt_dev_info *rvt_alloc_device(size_t size, int nports) struct rvt_dev_info *rdi; rdi = container_of(_ib_alloc_device(size), struct rvt_dev_info, ibdev); - if (!rdi) - return rdi; rdi->ports = kcalloc(nports, sizeof(*rdi->ports), GFP_KERNEL); if (!rdi->ports) -- 2.25.1