devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Cc: Martin Blumenstingl
	<martin.blumenstingl-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>,
	Stephen Boyd <sboyd-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
	mark.rutland-5wv7dgnIgG8@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	catalin.marinas-5wv7dgnIgG8@public.gmane.org,
	alexandre.torgue-qxv4g6HH51o@public.gmane.org,
	manabian-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	khilman-rdvid1DuHRBWk0Htik3J/w@public.gmane.org,
	mturquette-rdvid1DuHRBWk0Htik3J/w@public.gmane.org,
	will.deacon-5wv7dgnIgG8@public.gmane.org,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	peppe.cavallaro-qxv4g6HH51o@public.gmane.org,
	carlo-KA+7E9HrN00dnm+yROfE0A@public.gmane.org,
	linux-amlogic-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH v3 4/5] net: stmmac: add a glue driver for the Amlogic Meson 8b / GXBB DWMAC
Date: Mon, 05 Sep 2016 11:27:28 +0200	[thread overview]
Message-ID: <8189845.3pyN0uTLGL@wuerfel> (raw)
In-Reply-To: <CAFBinCCVUhUVyceGc2capcCPOK8MTsn+RcC9gnrtMVvZUENXtQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On Sunday, September 4, 2016 8:20:15 PM CEST Martin Blumenstingl wrote:
> 
> >> +     dwmac->m25_div_clk = devm_clk_register(dev, &dwmac->m25_div.hw);
> >> +     if (WARN_ON(PTR_ERR_OR_ZERO(dwmac->m25_div_clk)))
> >> +             return PTR_ERR(dwmac->m25_div_clk);
> >> +
> >> +     return 0;
> >
> > This could be return WARN_ON(PTR_ERR_OR_ZERO(...))
> This would work as well but I prefer the way it is right now (as one
> could easily extend the code without having to touch any existing code
> apart from the last return).
> However, as it's always the case with personal preference: if
> coding-style requires me to change it then I'll do so, just let me
> know.
> 
> I have addressed all other issues you found (thanks for that!) in v4
> (which I am about to send in the next few minutes).


Both of these are fairly unusual. The most common way to write it is

	if (WARN_ON(IS_ERR(dwmac->m25_div_clk)))
		return PTR_ERR(dwmac->m25_div_clk);
   return 0;

However, I now tend to prefer

	ret = PTR_ERR_OR_ZERO(dwmac->m25_div_clk);
	WARN_ON(ret);
	return ret;

which is less likely to cause false-positive warnings when building
with -Wmaybe-uninitialized than any of the other ones.

Please don't use PTR_ERR_OR_ZERO() as a condition, that is what
IS_ERR() is meant for.

	Arnd
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2016-09-05  9:27 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20160625165013.15917-1-martin.blumenstingl@googlemail.com>
2016-08-15 16:40 ` [PATCH 0/3] ARM64: meson: Meson8b and GXBB DWMAC glue driver Martin Blumenstingl
2016-08-15 16:40   ` [PATCH 1/3] net: dt-bindings: Document the new Meson8b and GXBB DWMAC bindings Martin Blumenstingl
2016-08-16 14:25     ` Rob Herring
2016-08-15 16:40   ` [PATCH 2/3] net: stmmac: add a glue driver for the Amlogic Meson 8b / GXBB DWMAC Martin Blumenstingl
2016-08-19 21:40     ` Kevin Hilman
2016-08-15 16:41   ` [PATCH 3/3] ARM64: dts: meson-gxbb: use the new GXBB DWMAC glue driver Martin Blumenstingl
2016-08-20  9:35   ` [PATCH v2 0/4] meson: Meson8b and " Martin Blumenstingl
2016-08-20  9:35     ` [PATCH v2 1/4] net: dt-bindings: Document the new Meson8b and GXBB DWMAC bindings Martin Blumenstingl
     [not found]       ` <20160820093538.9707-2-martin.blumenstingl-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
2016-08-22 11:55         ` Arnd Bergmann
2016-08-22 12:04           ` Martin Blumenstingl
2016-08-22 15:25             ` Arnd Bergmann
2016-08-28 16:15               ` Martin Blumenstingl
2016-08-29 13:31                 ` Arnd Bergmann
2016-08-20  9:35     ` [PATCH v2 2/4] clk: gxbb: expose MPLL2 clock for use by DT Martin Blumenstingl
2016-08-20  9:35     ` [PATCH v2 3/4] net: stmmac: add a glue driver for the Amlogic Meson 8b / GXBB DWMAC Martin Blumenstingl
2016-08-20 21:29       ` Joachim Eastwood
     [not found]         ` <CAGhQ9VyWs=sYg7PVrt5r-fM-2t--qAnHyvNXAZXwjkYn5P196g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-08-21 12:00           ` Martin Blumenstingl
     [not found]     ` <20160820093538.9707-1-martin.blumenstingl-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
2016-08-20  9:35       ` [PATCH v2 4/4] ARM64: dts: meson-gxbb: use the new GXBB DWMAC glue driver Martin Blumenstingl
2016-08-28 16:16     ` [PATCH v3 0/5] meson: Meson8b and " Martin Blumenstingl
     [not found]       ` <20160828161637.9941-1-martin.blumenstingl-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
2016-08-28 16:16         ` [PATCH v3 1/5] net: dt-bindings: Document the new Meson8b and GXBB DWMAC bindings Martin Blumenstingl
2016-08-28 16:16         ` [PATCH v3 3/5] stmmac: introduce get_stmmac_bsp_priv() helper Martin Blumenstingl
2016-08-28 16:16       ` [PATCH v3 2/5] clk: gxbb: expose MPLL2 clock for use by DT Martin Blumenstingl
2016-08-28 16:16       ` [PATCH v3 4/5] net: stmmac: add a glue driver for the Amlogic Meson 8b / GXBB DWMAC Martin Blumenstingl
2016-08-30 19:19         ` Stephen Boyd
     [not found]           ` <20160830191906.GD12510-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2016-09-04 18:20             ` Martin Blumenstingl
     [not found]               ` <CAFBinCCVUhUVyceGc2capcCPOK8MTsn+RcC9gnrtMVvZUENXtQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-09-05  9:27                 ` Arnd Bergmann [this message]
2016-08-28 16:16       ` [PATCH v3 5/5] ARM64: dts: meson-gxbb: use the new GXBB DWMAC glue driver Martin Blumenstingl
2016-08-29  3:40       ` [PATCH v3 0/5] meson: Meson8b and " David Miller
2016-08-30 18:49         ` Martin Blumenstingl
     [not found]           ` <CAFBinCCmg-+8mjd0Xc5c7bEWL9_S_4kizs_UMiiW9ATBH_G8iw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-08-31  4:57             ` David Miller
2016-09-02  4:23               ` Kevin Hilman
2016-09-02  5:37                 ` David Miller
2016-09-02  8:50                   ` Arnd Bergmann
2016-09-04 18:23       ` [PATCH v4 " Martin Blumenstingl
2016-09-04 18:23         ` [PATCH v4 1/5] net: dt-bindings: Document the new Meson8b and GXBB DWMAC bindings Martin Blumenstingl
2016-09-04 18:23         ` [PATCH v4 2/5] clk: gxbb: expose MPLL2 clock for use by DT Martin Blumenstingl
2016-09-04 18:23         ` [PATCH v4 3/5] stmmac: introduce get_stmmac_bsp_priv() helper Martin Blumenstingl
     [not found]         ` <20160904182320.671-1-martin.blumenstingl-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
2016-09-04 18:23           ` [PATCH v4 4/5] net: stmmac: add a glue driver for the Amlogic Meson 8b / GXBB DWMAC Martin Blumenstingl
     [not found]             ` <20160904182320.671-5-martin.blumenstingl-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
2016-09-05  1:37               ` kbuild test robot
2016-09-05 10:53                 ` Arnd Bergmann
2016-09-05 19:07                   ` Martin Blumenstingl
2016-09-06  9:37                     ` Arnd Bergmann
2016-09-05  1:43             ` kbuild test robot
2016-09-06 21:38           ` [PATCH v5 0/6] meson: Meson8b and GXBB DWMAC glue driver Martin Blumenstingl
2016-09-06 21:38             ` [PATCH v5 1/6] net: dt-bindings: Document the new Meson8b and GXBB DWMAC bindings Martin Blumenstingl
     [not found]             ` <20160906213848.17785-1-martin.blumenstingl-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
2016-09-06 21:38               ` [PATCH v5 2/6] clk: gxbb: expose MPLL2 clock for use by DT Martin Blumenstingl
2016-09-07 21:27                 ` Stephen Boyd
2016-09-06 21:38               ` [PATCH v5 3/6] stmmac: introduce get_stmmac_bsp_priv() helper Martin Blumenstingl
2016-09-06 21:38               ` [PATCH v5 4/6] net: stmmac: add a glue driver for the Amlogic Meson 8b / GXBB DWMAC Martin Blumenstingl
2016-09-06 21:38             ` [PATCH v5 5/6] ARM64: dts: meson-gxbb: use the new GXBB DWMAC glue driver Martin Blumenstingl
2016-09-06 21:38             ` [PATCH v5 6/6] net: stmmac: update the module description of the dwmac-meson driver Martin Blumenstingl
2016-09-04 18:23         ` [PATCH v4 5/5] ARM64: dts: meson-gxbb: use the new GXBB DWMAC glue driver Martin Blumenstingl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8189845.3pyN0uTLGL@wuerfel \
    --to=arnd-r2ngtmty4d4@public.gmane.org \
    --cc=alexandre.torgue-qxv4g6HH51o@public.gmane.org \
    --cc=carlo-KA+7E9HrN00dnm+yROfE0A@public.gmane.org \
    --cc=catalin.marinas-5wv7dgnIgG8@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=khilman-rdvid1DuHRBWk0Htik3J/w@public.gmane.org \
    --cc=linux-amlogic-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=manabian-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
    --cc=martin.blumenstingl-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org \
    --cc=mturquette-rdvid1DuHRBWk0Htik3J/w@public.gmane.org \
    --cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=peppe.cavallaro-qxv4g6HH51o@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=sboyd-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
    --cc=will.deacon-5wv7dgnIgG8@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).