[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <400cf2fc8cbc3887a90f50709f40adc0662ec0f4.camel@perches.com>
Date: Wed, 09 Mar 2022 12:01:39 -0800
From: Joe Perches <joe@...ches.com>
To: Chen-Yu Tsai <wenst@...omium.org>,
Sean Wang <sean.wang@...nel.org>,
Linus Walleij <linus.walleij@...aro.org>,
Matthias Brugger <matthias.bgg@...il.com>
Cc: linux-mediatek@...ts.infradead.org, linux-gpio@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@...labora.com>
Subject: Re: [PATCH v2 05/11] pinctrl: mediatek: paris: Drop extra newline
in mtk_pctrl_show_one_pin()
On Tue, 2022-03-08 at 18:09 +0800, Chen-Yu Tsai wrote:
> The caller of mtk_pctrl_show_one_pin() is responsible for printing the
> full line. mtk_pctrl_show_one_pin(), called through mtk_pctrl_dbg_show(),
> should only produce a string containing the extra information the driver
> wants included.
Does this function have another caller?
It looks as if this function doesn't need to be EXPORT_SYMBOL_GPL
and could just be declared static in the file instead.
btw: using %1d is mostly senseless as a control, but has some
documentary use as a value < 0 or >= 10 will be always be
fully emitted anyway.
> diff --git a/drivers/pinctrl/mediatek/pinctrl-paris.c b/drivers/pinctrl/mediatek/pinctrl-paris.c
[]
> @@ -634,14 +634,10 @@ ssize_t mtk_pctrl_show_one_pin(struct mtk_pinctrl *hw,
> pullen,
> pullup);
>
> - if (r1 != -1) {
> - len += scnprintf(buf + len, buf_len - len, " (%1d %1d)\n",
> - r1, r0);
> - } else if (rsel != -1) {
> - len += scnprintf(buf + len, buf_len - len, " (%1d)\n", rsel);
> - } else {
> - len += scnprintf(buf + len, buf_len - len, "\n");
> - }
> + if (r1 != -1)
> + len += scnprintf(buf + len, buf_len - len, " (%1d %1d)", r1, r0);
> + else if (rsel != -1)
> + len += scnprintf(buf + len, buf_len - len, " (%1d)", rsel);
>
> return len;
> }
Powered by blists - more mailing lists