From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8C385EE4993 for ; Tue, 22 Aug 2023 13:11:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234618AbjHVNLL (ORCPT ); Tue, 22 Aug 2023 09:11:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40350 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233327AbjHVNLL (ORCPT ); Tue, 22 Aug 2023 09:11:11 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3CF95D7 for ; Tue, 22 Aug 2023 06:11:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1692709869; x=1724245869; h=message-id:date:mime-version:subject:to:references:cc: from:in-reply-to:content-transfer-encoding; bh=b3bOQh8s2MNIWOzb+6lIclctOMPenXqfybuUgl8Tq3M=; b=1kc8bGHnkZP/5xShJVxkQiK7U/V+dLOqAFbzcYeD4x07SIykBHfHm+C1 zIEud4n3H1OdUZcdR3UoVXkIV33gGiAodCPNeObkVgAuIoAk4Q7fDqZAH AjTJBT9rOPcnoousNW6Bl5GZL2mA0Bi/9qPRYMyO+Z4y15pUMMpAGyKLE dLCoTiOHdm6HGf0zMMSqsEkOH7+yYL8Ebmj7mkTbLSsUzZ6qVzY8dur/6 kTgIt4j7wd+4e740uffoafxXVDiiagN+sjy9tVvbkF9o1ifLuzx89O922 +9ihnbbdCxqpvAHQYCitDzKVk+Zih8QttbVwIZdR6V3csIkCuDNSvKDzO Q==; X-IronPort-AV: E=Sophos;i="6.01,193,1684825200"; d="scan'208";a="671407" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 22 Aug 2023 06:11:08 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Tue, 22 Aug 2023 06:11:07 -0700 Received: from [10.159.245.205] (10.10.115.15) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.2507.21 via Frontend Transport; Tue, 22 Aug 2023 06:11:05 -0700 Message-ID: <52e3a5df-41ae-db71-fe4c-f46db22db4c3@microchip.com> Date: Tue, 22 Aug 2023 15:11:01 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH -next] spi: at91-usart: Use PTR_ERR_OR_ZERO() to simplify code Content-Language: en-US, fr-FR To: Jinjie Ruan , , , Radu Pirea , Mark Brown , Alexandre Belloni , Claudiu Beznea References: <20230822124643.987079-1-ruanjinjie@huawei.com> CC: Russell King - ARM Linux From: Nicolas Ferre Organization: microchip In-Reply-To: <20230822124643.987079-1-ruanjinjie@huawei.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org On 22/08/2023 at 14:46, Jinjie Ruan wrote: > Return PTR_ERR_OR_ZERO() instead of return 0 or PTR_ERR() to > simplify code. > > Signed-off-by: Jinjie Ruan Do we really need these changes?... oh well, no strong opinion but is it worth the effort? Regards, Nicolas > --- > drivers/spi/spi-at91-usart.c | 5 +---- > 1 file changed, 1 insertion(+), 4 deletions(-) > > diff --git a/drivers/spi/spi-at91-usart.c b/drivers/spi/spi-at91-usart.c > index 75d9bc606442..b11d0f993cc7 100644 > --- a/drivers/spi/spi-at91-usart.c > +++ b/drivers/spi/spi-at91-usart.c > @@ -485,10 +485,7 @@ static int at91_usart_gpio_setup(struct platform_device *pdev) > > cs_gpios = devm_gpiod_get_array_optional(&pdev->dev, "cs", GPIOD_OUT_LOW); > > - if (IS_ERR(cs_gpios)) > - return PTR_ERR(cs_gpios); > - > - return 0; > + return PTR_ERR_OR_ZERO(cs_gpios); > } > > static int at91_usart_spi_probe(struct platform_device *pdev) > -- > 2.34.1 > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F11C9EE4993 for ; Tue, 22 Aug 2023 13:11:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:CC:References:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=W0PUkLd6KQwYQoXAw4L0i5HU2t/DJgUshXO+/VZzeCY=; b=OXJ1FjMmWgjzTx xYXFGkgbfVG+nI46Iyv50t7xOBI3V4TCqEMGTi9z160inocw4AoAf+rqHGuDCTOGNXP9bTcm9gFUy Fh2prWryFX5zxIN0hCFw/SF5QPuWg6REuHODlMZPsJ7j3pt4J4vKaskMJvsrBzy/VatHuK6by5AlD S/tM4jukRuD30V0ryJc080rCosGg2sSSLx3zKC9BKO0dp/qA4zjaPvjCXKTy86PdKA1d9oMIcIjZk v065YdI+CC7MGg+dx/ShlM9TqzZfcuio5Vllm4PjU6BcCEUsE49PXoTC3PHuLzKI7qqn6SlEhZx1J 8efa5JSpgDI7ELMrkwoA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qYRAF-00FxPH-30; Tue, 22 Aug 2023 13:11:19 +0000 Received: from esa.microchip.iphmx.com ([68.232.153.233]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qYRAC-00FxOt-2l for linux-arm-kernel@lists.infradead.org; Tue, 22 Aug 2023 13:11:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1692709876; x=1724245876; h=message-id:date:mime-version:subject:to:references:cc: from:in-reply-to:content-transfer-encoding; bh=b3bOQh8s2MNIWOzb+6lIclctOMPenXqfybuUgl8Tq3M=; b=OYra6Zj2GVGyTP7ZbHrvan1AlD0a/v6v02ppPDYIu+HJUJrLlfd+hXra twvwGF9hTkJi60EPjpYcc0+QPMB8nHCHQ2AVlCxOGSQzkT9RvMPBRt7yA dAeFiqNPGw/CeJ92CGx0W9KtTHSXxg6dfUVXgxDSTAWgEVid8bKB1SAkY mXU4douT2x6260Avmj93kWAw3oVvXb0HrdWY98cJE3SVgTSxOvqdcHlgc MGGdHoRKK7U9fUH1DU57yrfkdp0xQLoYlmnUAnL2vZx2exvYDv8KKFGVf d1t1vtUSbHedP0FuVAGQ94zzSfaWoDVaEfCql91gcu3yFgWUqSfRGVofv Q==; X-IronPort-AV: E=Sophos;i="6.01,193,1684825200"; d="scan'208";a="671407" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 22 Aug 2023 06:11:08 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Tue, 22 Aug 2023 06:11:07 -0700 Received: from [10.159.245.205] (10.10.115.15) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.2507.21 via Frontend Transport; Tue, 22 Aug 2023 06:11:05 -0700 Message-ID: <52e3a5df-41ae-db71-fe4c-f46db22db4c3@microchip.com> Date: Tue, 22 Aug 2023 15:11:01 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH -next] spi: at91-usart: Use PTR_ERR_OR_ZERO() to simplify code Content-Language: en-US, fr-FR To: Jinjie Ruan , , , Radu Pirea , Mark Brown , Alexandre Belloni , Claudiu Beznea References: <20230822124643.987079-1-ruanjinjie@huawei.com> CC: Russell King - ARM Linux From: Nicolas Ferre Organization: microchip In-Reply-To: <20230822124643.987079-1-ruanjinjie@huawei.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230822_061117_041148_98FCEC1D X-CRM114-Status: GOOD ( 18.00 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 22/08/2023 at 14:46, Jinjie Ruan wrote: > Return PTR_ERR_OR_ZERO() instead of return 0 or PTR_ERR() to > simplify code. > > Signed-off-by: Jinjie Ruan Do we really need these changes?... oh well, no strong opinion but is it worth the effort? Regards, Nicolas > --- > drivers/spi/spi-at91-usart.c | 5 +---- > 1 file changed, 1 insertion(+), 4 deletions(-) > > diff --git a/drivers/spi/spi-at91-usart.c b/drivers/spi/spi-at91-usart.c > index 75d9bc606442..b11d0f993cc7 100644 > --- a/drivers/spi/spi-at91-usart.c > +++ b/drivers/spi/spi-at91-usart.c > @@ -485,10 +485,7 @@ static int at91_usart_gpio_setup(struct platform_device *pdev) > > cs_gpios = devm_gpiod_get_array_optional(&pdev->dev, "cs", GPIOD_OUT_LOW); > > - if (IS_ERR(cs_gpios)) > - return PTR_ERR(cs_gpios); > - > - return 0; > + return PTR_ERR_OR_ZERO(cs_gpios); > } > > static int at91_usart_spi_probe(struct platform_device *pdev) > -- > 2.34.1 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel