Messages in this thread | | | Subject | Re: [PATCH] staging: i4l: act2000: Add blank line after declaration | From | Joe Perches <> | Date | Thu, 01 Sep 2016 22:29:46 -0700 |
| |
On Fri, 2016-09-02 at 01:09 -0400, Anson Jacob wrote: > Fix checkpatch.pl warning: > Missing a blank line after declarations [] > diff --git a/drivers/staging/i4l/act2000/act2000_isa.c b/drivers/staging/i4l/act2000/act2000_isa.c [] > @@ -259,6 +259,7 @@ act2000_isa_receive(act2000_card *card) > "act2000_isa_receive: Invalid CAPI msg\n"); > { > int i; __u8 *p; __u8 *t; __u8 tmp[30]; > + > for (i = 0, p = (__u8 *)&card->idat.isa.rcvhdr, t = tmp; i < 8; i++) > t += sprintf(t, "%02x ", *(p++)); > printk(KERN_WARNING "act2000_isa_receive: %s\n", tmp);
It'd be better to use the %*ph vsprintf extension (see Documentation/printk-formats.txt) without any of the loop code and variable declarations:
pr_warn("%s: %8ph\n", __func__, card->idat.isa.rcvhdr); or maybe pr_warn("%s: %*ph\n", __func__, (int)ARRAY_SIZE(card->idat.isa.rcvhdr), card->idat.isa.rcvhdr);
| |