Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1472204ybi; Sat, 25 May 2019 02:49:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqzjNhNShyryPPsszjX4OWWwvTkTECBemhxg8IUOcM7nDwSjMn/RWcOiYgMjWyEkmWGUJa7F X-Received: by 2002:a65:4544:: with SMTP id x4mr88235791pgr.323.1558777744491; Sat, 25 May 2019 02:49:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558777744; cv=none; d=google.com; s=arc-20160816; b=R1gGuTm1FrZx2RiL2XPfQR5tL090wJPt8MDXmKrPBzNUh7sESh8sSQiNV+WYP2w4MH wiVJbIuhUPD9plhJdNIJsg/eTLHFkNXhxoYUoLsO2kJ7gnwNWiVxW502uirWAY1fkt8+ HXKi7EDP7nZ7GTJZkZARo8e5KsKagnrWvBXQq4pW9x1EIGX0lfhKTQVz4wRoP9d5/eq9 B7ZDs3oxmNjrCvlH9zk+J/qQCnaTPeQZOySTIYNnf709teHRLV5ngQqLDZakJlut8Evc ySnb7a1ACDCqmePAHs9Zp5dU5SJR1PkLig8e6Fx7zgVHC6srvXmIei/nEaHSKlDkAoI6 IqCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:to:from:date:dkim-signature; bh=tGUCp9c5wnxFVDmV13FsPi0t87+DzwUF5FU9Ec++uMg=; b=bwBMY+t+riS6cvURsNYgSs2oM0SzJeN8gNRqj43sX96wYrFJepqCnkNDvA6r19tZVy gsC7kFLxvVGlcmvnmrCW53/kn8i5Bv+CfnhVSgh6HziUbbHAnTxqWSI7SxoQf9xX9Ap7 HtthC5H+0ayP5ADsHd/rrHkq1i24p3SLI61hqt9DLoUCEq1rzd4S7J8YHhZ+BEly9E3D sIlhD36HBABR6WGmT+JJFHO3pg7nQqOtDhRan6erf/vekZXs6/9w9JFbXQtpz4LfvThK HPuujJg+yeufZPwz3ivmRThZJfHD4bOeEgZdDHMnuQivwKJEN3LZ7s+VOMXTDWSSza1U OJnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=nPmtw3rk; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o4si8100419pfb.274.2019.05.25.02.48.49; Sat, 25 May 2019 02:49:04 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=nPmtw3rk; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726818AbfEYJrK (ORCPT + 99 others); Sat, 25 May 2019 05:47:10 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:41750 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726645AbfEYJrK (ORCPT ); Sat, 25 May 2019 05:47:10 -0400 Received: by mail-pg1-f193.google.com with SMTP id z3so1772718pgp.8; Sat, 25 May 2019 02:47:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mime-version:content-disposition :user-agent; bh=tGUCp9c5wnxFVDmV13FsPi0t87+DzwUF5FU9Ec++uMg=; b=nPmtw3rk6HBITFHR79yR9mZysxXRqXplFe/kkob+20rGnH3L/+pii/aBt0QB83xlkR JiiBxYAx7QdbZK/5ggKHjs8g7d9wiUyanQ9PgMN7sexESF87z2O9vqzPn7Kz65x9cfWp Z3WkzWGE/w4WnOcVuw7DZcdwZKVH9/8glkn4NPHBbDVF9M63wnlSuT+ubBIaKvCWJAzo +WXOA2E5yGnIg0fCR23aY0Z6Cnrv8ZSgSgtGqroK4a48VISar6x/uBAsk9VC0foTiidH 3lIP1nU1S4g7hblj+B3Lbtm+zfR1/FDcZ2daXrfnctpj6zmoPF5+rklKOdswGD0z5x62 zdug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition:user-agent; bh=tGUCp9c5wnxFVDmV13FsPi0t87+DzwUF5FU9Ec++uMg=; b=odHblhbnlQ1lesjl7kv3Lmh7gxSudNLM/X51rTRw+Xb2abAWZtF+HX9g8WLbacTiH3 SG/h6XkN2FzvyyO341/VZHubRIU4oH8IaBYERQkM6AAPqW1BdTYpSfaboeADwh3ZS6D7 9tR26ROQqFIqUH9yk6CXraNlsIyEXGvfiVTrw+breSTtgvL8Jso4U2k29omoLXEYNjO8 SZEEsB1fxjOM8yh1adskqE0xXmBVb+bsg+P9XicR0YeNzCYidFzNXlsg1RhG0bgofBhF /W1MHK6DN8qNxtkt3jxIH+D7uv3pdBQwiqyylhLlHsVnsL47rnjONfOBINRWOdtoA9Jn zIQQ== X-Gm-Message-State: APjAAAV1Jf2FFJhgvDeei/ZLU3Lvlgjw/ZDw6m/WiB5oukj5xTXk9+rS 2dZvU9n1FIvf6DKt9xZ45zVkYsg+ X-Received: by 2002:aa7:8683:: with SMTP id d3mr73048882pfo.145.1558777629558; Sat, 25 May 2019 02:47:09 -0700 (PDT) Received: from hari-Inspiron-1545 ([183.83.92.73]) by smtp.gmail.com with ESMTPSA id h14sm4391022pgj.8.2019.05.25.02.47.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 25 May 2019 02:47:09 -0700 (PDT) Date: Sat, 25 May 2019 15:17:05 +0530 From: Hariprasad Kelam To: Mark Brown , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] spi: gpio: fix warning PTR_ERR_OR_ZERO can be used Message-ID: <20190525094705.GA23374@hari-Inspiron-1545> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org fix below warning reported by coccicheck ./drivers/spi/spi-gpio.c:302:1-3: WARNING: PTR_ERR_OR_ZERO can be used Signed-off-by: Hariprasad Kelam --- drivers/spi/spi-gpio.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/spi/spi-gpio.c b/drivers/spi/spi-gpio.c index 487ee55..8c5b98a 100644 --- a/drivers/spi/spi-gpio.c +++ b/drivers/spi/spi-gpio.c @@ -299,10 +299,8 @@ static int spi_gpio_request(struct device *dev, struct spi_gpio *spi_gpio) return PTR_ERR(spi_gpio->miso); spi_gpio->sck = devm_gpiod_get(dev, "sck", GPIOD_OUT_LOW); - if (IS_ERR(spi_gpio->sck)) - return PTR_ERR(spi_gpio->sck); - return 0; + return PTR_ERR_OR_ZERO(spi_gpio->sck); } #ifdef CONFIG_OF -- 2.7.4