Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp708889imm; Wed, 26 Sep 2018 05:43:42 -0700 (PDT) X-Google-Smtp-Source: ACcGV62JEwaYOAGDRM3Rvfw4jPLzZP6vjqOzy+rSizhv5RdTkRv3Uf1i7UNf9L54itFkRGn7NHT7 X-Received: by 2002:a17:902:d893:: with SMTP id b19-v6mr6099515plz.51.1537965822229; Wed, 26 Sep 2018 05:43:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537965822; cv=none; d=google.com; s=arc-20160816; b=RCSFWaHuc6gxd24ut1oBfDTD92gmyQf4kWxRPZ5A861T/r7lva03tOcQ0LiRCtfDPW CzhLIeMhTZrh1CSzctgq/JBdw1WRfovH3Ow4V/i5581CqpcgbB2yXXiRxyJ2ekMTXfPr 2jb/G/tw5g6YXv75i+C+jqeeOMi2ODbLXaXJM1RbU+K+5DmROLBa6w0Df1/hu7IpQ+RJ W/++exQfaKJjwg8LcW3w6T8MpXLVaWTxRgRaCvoJG15MfpNjhq3KyuqhBUWFo98EGLSt 1zEToYJlVyCyXCjwQ5g/kqoHLezMor5OrJ7woo+cCyHMTePPklif1BjpQW6enTbR8JPy yFPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=AWhkG17ziVxvYTJlUkOXL0mFjWTLfD4aThoofrp2Q7c=; b=NBChwdCq9T77CSVCjraXjpTlH+S8+xOHYoE5QFmQIaVNTBtwCmU1gMk265c7/dq3qv T5bun5ZDKAy/xi/w06/pGd8Y0CUPhq7i8yO0x6AT9uiVVPl4os2ZZZYMF6euGxX3ZrAh NbL136REvtumZJGCbSuXcRYOqsc4M5zZCpB00Ig4WiiHe6F8DOINw9LDzjbEbuclzo7s AU/zNpVJjgbc6gCpjvT9ktcHa5+LX32t8jxMc99PMiPlusHXlHOn58GpC7dAitBOizcV 1Y67KZGD58d0p0YIb/VF5YEYPeW1LYRwmHUyb+e15Agclu4bdwF7e/nM+QR37Ckyvmsd 6n8Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d30-v6si5281262pld.452.2018.09.26.05.43.26; Wed, 26 Sep 2018 05:43:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727380AbeIZS4K (ORCPT + 99 others); Wed, 26 Sep 2018 14:56:10 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:13127 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726315AbeIZS4K (ORCPT ); Wed, 26 Sep 2018 14:56:10 -0400 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 25E947D989FAC; Wed, 26 Sep 2018 20:43:17 +0800 (CST) Received: from linux-ibm.site (10.175.102.37) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.399.0; Wed, 26 Sep 2018 20:43:17 +0800 From: zhong jiang To: , CC: , , Subject: [PATCH v2] NFC: st-nci: remove a redundant null pointer check Date: Wed, 26 Sep 2018 20:30:50 +0800 Message-ID: <1537965050-16579-1-git-send-email-zhongjiang@huawei.com> X-Mailer: git-send-email 1.7.12.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.102.37] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The dev is impossible is NULL. hence the check is redundant. We never will hit it. Signed-off-by: zhong jiang --- v1->v2: - According to Greg's suggestion. just remove the null pointer will be better. drivers/nfc/st-nci/spi.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/drivers/nfc/st-nci/spi.c b/drivers/nfc/st-nci/spi.c index 1470559..864fd90 100644 --- a/drivers/nfc/st-nci/spi.c +++ b/drivers/nfc/st-nci/spi.c @@ -233,13 +233,6 @@ static int st_nci_spi_probe(struct spi_device *dev) dev_dbg(&dev->dev, "%s\n", __func__); dev_dbg(&dev->dev, "IRQ: %d\n", dev->irq); - /* Check SPI platform functionnalities */ - if (!dev) { - pr_debug("%s: dev is NULL. Device is not accessible.\n", - __func__); - return -ENODEV; - } - phy = devm_kzalloc(&dev->dev, sizeof(struct st_nci_spi_phy), GFP_KERNEL); if (!phy) -- 1.7.12.4