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 X-Spam-Level: X-Spam-Status: No, score=-8.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 477D1C3A5A1 for ; Thu, 22 Aug 2019 14:35:00 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 197AA2082F for ; Thu, 22 Aug 2019 14:35:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="OOVcMuZD" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 197AA2082F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:From:References:To:Subject:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=NgK/28Sl7Xla3jJGsya8i1ZlIbYMmbAaCCAvPB9B2r0=; b=OOVcMuZDGYCKLI aRN7Dh/v0Bk1fimATKM7NGrrYILHA3Voj3tb7ODi7NK0fvklLNEKw2wqjbtP/8bUjOePuUkayggfQ G7rlir1+VPuj+7WUh5Ayl+fPN9UcnKwuy/qAYelDBhnRY64OSXp90ixEdpX+IP2jpdAjM9bZhZIDT MddZwsMTKo+Xla7id5vqPOq5/klMWc4KaLYZ/kK3FhI9vjBSysbav80kmz0gVwHmbMeCvqHCn9Sp1 ZnxiyjBVZ7cS1n++uRFhjtVyEph3PiQKtVmKUm7nXOvHdmi0QjaNH52nEYTRcYHiON8sOdDn6ih4z ndjCUsEhGCU4EeEYh3ng==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1i0oB1-0008Ga-Ki; Thu, 22 Aug 2019 14:34:59 +0000 Received: from szxga07-in.huawei.com ([45.249.212.35] helo=huawei.com) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1i0oAw-00088Q-Op for linux-arm-kernel@lists.infradead.org; Thu, 22 Aug 2019 14:34:57 +0000 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 615BD2BC513CB4D2D3BC; Thu, 22 Aug 2019 22:34:43 +0800 (CST) Received: from [127.0.0.1] (10.133.213.239) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.439.0; Thu, 22 Aug 2019 22:34:38 +0800 Subject: Re: [PATCH -next] ASoC: sun4i-i2s: Use PTR_ERR_OR_ZERO in sun4i_i2s_init_regmap_fields() To: Maxime Ripard References: <20190822065252.74028-1-yuehaibing@huawei.com> <20190822141826.is6nizjpdgvhd7ra@flea> From: Yuehaibing Message-ID: <5b15becf-b79b-ae5d-91e2-6521ded50946@huawei.com> Date: Thu, 22 Aug 2019 22:34:37 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20190822141826.is6nizjpdgvhd7ra@flea> X-Originating-IP: [10.133.213.239] X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190822_073455_014005_E63FF208 X-CRM114-Status: GOOD ( 14.46 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Takashi Iwai , Liam Girdwood , Marcus Cooper , Chen-Yu Tsai , Mark Brown , Jaroslav Kysela , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2019/8/22 22:18, Maxime Ripard wrote: > Hi, > > On Thu, Aug 22, 2019 at 06:52:52AM +0000, YueHaibing wrote: >> Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR >> >> Signed-off-by: YueHaibing >> --- >> sound/soc/sunxi/sun4i-i2s.c | 5 +---- >> 1 file changed, 1 insertion(+), 4 deletions(-) >> >> diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c >> index 9e691baee1e8..2071c54265f3 100644 >> --- a/sound/soc/sunxi/sun4i-i2s.c >> +++ b/sound/soc/sunxi/sun4i-i2s.c >> @@ -1095,10 +1095,7 @@ static int sun4i_i2s_init_regmap_fields(struct device *dev, >> i2s->field_fmt_sr = >> devm_regmap_field_alloc(dev, i2s->regmap, >> i2s->variant->field_fmt_sr); >> - if (IS_ERR(i2s->field_fmt_sr)) >> - return PTR_ERR(i2s->field_fmt_sr); >> - >> - return 0; >> + return PTR_ERR_OR_ZERO(i2s->field_fmt_sr); > > I'm not really convinced that this more readable or more maintainable > though. Is there a reason for this other than we can do it? No special reason, just suggested by scripts/coccinelle/api/ptr_ret.cocci > > Maxie > > -- > Maxime Ripard, Bootlin > Embedded Linux and Kernel engineering > https://bootlin.com > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel