Re: [PATCH] [Telephony/MUX]: solve checkpatch issues

From: Frans Klaver
Date: Mon Aug 10 2015 - 09:37:44 EST


On Mon, Aug 10, 2015 at 2:50 PM, Gwenn Bourree <gwenn.bourree@xxxxxxxxx> wrote:
> In order to prepare the submission of other functional
> patches, the checkpatch script has been applied and the
> reported issues have been solved.

Which warnings? Explain why these changes are an improvement. Just the
fact that checkpatch complains is sometimes not enough to warrant the
change.

I would expect this to be done in a series, rather than in one patch.


> Signed-off-by: Gwenn Bourree <gwenn.bourree@xxxxxxxxx>
> ---
> drivers/tty/n_gsm.c | 56 +++++++++++++++++++++++++++++++++++++++++------------
> 1 file changed, 44 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c
> index 382d3fc..2983ae2 100644
> --- a/drivers/tty/n_gsm.c
> +++ b/drivers/tty/n_gsm.c
> @@ -486,10 +486,11 @@ static void gsm_print_packet(const char *hdr, int addr, int cr,
> pr_cont("UIH");
> break;
> default:
> - if (!(control & 0x01)) {
> + if (!(control & 0x01))
> pr_cont("I N(S)%d N(R)%d",
> (control & 0x0E) >> 1, (control & 0xE0) >> 5);
> - } else switch (control & 0x0F) {
> + else
> + switch (control & 0x0F) {
> case RR:
> pr_cont("RR(%d)", (control & 0xE0) >> 5);
> break;
> @@ -501,7 +502,7 @@ static void gsm_print_packet(const char *hdr, int addr, int cr,
> break;
> default:
> pr_cont("[%02X]", control);
> - }
> + }
> }

Does this improve readability?


> @@ -783,6 +786,7 @@ static void __gsm_data_queue(struct gsm_dlci *dlci, struct gsm_msg *msg)
> static void gsm_data_queue(struct gsm_dlci *dlci, struct gsm_msg *msg)
> {
> unsigned long flags;
> +
> spin_lock_irqsave(&dlci->gsm->tx_lock, flags);
> __gsm_data_queue(dlci, msg);
> spin_unlock_irqrestore(&dlci->gsm->tx_lock, flags);
> @@ -833,7 +837,8 @@ static int gsm_dlci_data_output(struct gsm_mux *gsm, struct gsm_dlci *dlci)
> *dp++ = gsm_encode_modem(dlci);
> break;
> }
> - WARN_ON(kfifo_out_locked(dlci->fifo, dp , len, &dlci->lock) != len);
> + WARN_ON(kfifo_out_locked(dlci->fifo, dp, len,
> + &dlci->lock) != len);

The second line should be
<tab><tab><tab><tab><tab><space>&dlci->lock

Again I wonder if readability is actually improving by this change.
Maybe things improve if the line break is done somewhere else?

Thanks,
Frans
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/