* [PATCH -next] ASoC: sun4i-i2s: Use PTR_ERR_OR_ZERO() to simplify code
@ 2020-05-06 8:15 Samuel Zou
2020-05-13 14:19 ` Maxime Ripard
0 siblings, 1 reply; 2+ messages in thread
From: Samuel Zou @ 2020-05-06 8:15 UTC (permalink / raw)
To: lgirdwood, broonie, perex, tiwai, mripard, wens
Cc: alsa-devel, linux-arm-kernel, linux-kernel, Samuel Zou
Fixes coccicheck warning:
sound/soc/sunxi/sun4i-i2s.c:1177:1-3: WARNING: PTR_ERR_OR_ZERO can be used
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Samuel Zou <zou_wei@huawei.com>
---
sound/soc/sunxi/sun4i-i2s.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c
index d0a8d58..72012a6 100644
--- a/sound/soc/sunxi/sun4i-i2s.c
+++ b/sound/soc/sunxi/sun4i-i2s.c
@@ -1174,10 +1174,8 @@ 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);
}
static int sun4i_i2s_probe(struct platform_device *pdev)
--
2.6.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH -next] ASoC: sun4i-i2s: Use PTR_ERR_OR_ZERO() to simplify code
2020-05-06 8:15 [PATCH -next] ASoC: sun4i-i2s: Use PTR_ERR_OR_ZERO() to simplify code Samuel Zou
@ 2020-05-13 14:19 ` Maxime Ripard
0 siblings, 0 replies; 2+ messages in thread
From: Maxime Ripard @ 2020-05-13 14:19 UTC (permalink / raw)
To: Samuel Zou
Cc: lgirdwood, broonie, perex, tiwai, wens, alsa-devel,
linux-arm-kernel, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 329 bytes --]
On Wed, May 06, 2020 at 04:15:12PM +0800, Samuel Zou wrote:
> Fixes coccicheck warning:
>
> sound/soc/sunxi/sun4i-i2s.c:1177:1-3: WARNING: PTR_ERR_OR_ZERO can be used
>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Samuel Zou <zou_wei@huawei.com>
Didn't we remove that coccicheck test?
Maxime
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-05-13 14:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-06 8:15 [PATCH -next] ASoC: sun4i-i2s: Use PTR_ERR_OR_ZERO() to simplify code Samuel Zou
2020-05-13 14:19 ` Maxime Ripard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).