Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp827111imm; Wed, 26 Sep 2018 07:24:17 -0700 (PDT) X-Google-Smtp-Source: ACcGV63bnoBJwFomvFjJRycn2DnjptkV7sToer0iRPWEMYrOEP/ILqGUOl26i8i8malhHXaTssLH X-Received: by 2002:a65:5188:: with SMTP id h8-v6mr5930118pgq.288.1537971857176; Wed, 26 Sep 2018 07:24:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537971857; cv=none; d=google.com; s=arc-20160816; b=HL+8b3H74RCbQanB4NZhxVdrLJ6vlb0fXW+NlxaBx1l28BKl7aW1ZbK+2sbfk6eTjr xTF/H+AzXxABqso345U3m0vPyzpd2zoOARWB1qf4TptMjBCIQGU4t/HwCI7hxLko4oVT +MySw1TmQveqOdOjS3VXsaorMBlokOv7DuugjuI53u3nHzCAg4fp6pyRaoOaAwfboDQJ 7kb8KQeLt+cFo6sGbMcskWDqdyFcjJzrmwvs7IdW/3rG3p4He59C0kYjIKUbdIZ4ZBx9 wGwuJKLmJvX5Yoaowlwv45vxdJFaqtI5GSJxyTEwxeRyn//2J8ni5ZBWhGed3ImvVsTn tNKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :references:subject:cc:to:mime-version:user-agent:from:date :message-id; bh=JzCJrRFI2VUm9e/PwpfOVV8YoZpW3voSXPkc+wt2pWk=; b=kdG08sETzZlk498FpBjBZ4b/OAcaUJl493OaJmVtyvDFUlJJb96CeAyw7d252fuOif /ZfP9RXpm/sZj3U5VYga0qrYPoHWVxlSGzjBTyTjW01FEeUxvYrDMfhV9uQ8Q30P8+er 8IQBEvSNW21fBuOAqsRGDWjUMjRt2us9qUSoYd9NMHEr4wX+YlKhPZGEf1E292LvJrpd ffZAYF2WIAtMBgsgVAq2fWNW5hLoXSUCInQc5dAGxqVV8SImrNbhRjH/X6knyDpkq2ub nCl23zIq/Sd0JAWGP7pIC6V5jwOBLntPncLwT+liaTfL/SM/M/NjWN9ZfPJVM4pObyu6 qh0Q== 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 v7-v6si4736875plp.263.2018.09.26.07.23.58; Wed, 26 Sep 2018 07:24:17 -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 S1728167AbeIZUgg (ORCPT + 99 others); Wed, 26 Sep 2018 16:36:36 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:13128 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727399AbeIZUgg (ORCPT ); Wed, 26 Sep 2018 16:36:36 -0400 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id CAF9F94A3D599; Wed, 26 Sep 2018 22:23:19 +0800 (CST) Received: from [127.0.0.1] (10.177.29.68) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.399.0; Wed, 26 Sep 2018 22:23:17 +0800 Message-ID: <5BAB9655.6080100@huawei.com> Date: Wed, 26 Sep 2018 22:23:17 +0800 From: zhong jiang User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: Andy Shevchenko , Greg KH , CC: LKML Subject: Re: [PATCH v2] NFC: st-nci: remove a redundant null pointer check References: <1537965050-16579-1-git-send-email-zhongjiang@huawei.com> <20180926140311.GU15943@smile.fi.intel.com> In-Reply-To: <20180926140311.GU15943@smile.fi.intel.com> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.29.68] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018/9/26 22:03, Andy Shevchenko wrote: > On Wed, Sep 26, 2018 at 08:30:50PM +0800, zhong jiang wrote: >> The dev is impossible is NULL. hence the check is redundant. We >> never will hit it. >> > Reviewed-by: Andy Shevchenko Thanks. >> 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 >>