diff options
author | Joe Perches <joe@perches.com> | 2020-04-03 15:43:22 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-04-23 17:05:39 +0200 |
commit | a6abfdff4fe5dd19d1f1b37d72ba34cd4492fd4d (patch) | |
tree | e33847923df0d984f949e5c464a7014b78ea4920 /drivers/parport/procfs.c | |
parent | parport_pc: Convert DPRINTK to pr_debug (diff) | |
download | linux-a6abfdff4fe5dd19d1f1b37d72ba34cd4492fd4d.tar.xz linux-a6abfdff4fe5dd19d1f1b37d72ba34cd4492fd4d.zip |
parport: Standardize use of printmode
Standardize the define and the uses of printmode.
Miscellanea:
o Add missing statement termination ; where necessary
Signed-off-by: Joe Perches <joe@perches.com>
Reviewed-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Link: https://lore.kernel.org/r/20200403134325.11523-8-sudipm.mukherjee@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/parport/procfs.c')
-rw-r--r-- | drivers/parport/procfs.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/parport/procfs.c b/drivers/parport/procfs.c index 48804049d697..e957beb94f14 100644 --- a/drivers/parport/procfs.c +++ b/drivers/parport/procfs.c @@ -213,7 +213,11 @@ static int do_hardware_modes(struct ctl_table *table, int write, return -EACCES; { -#define printmode(x) {if(port->modes&PARPORT_MODE_##x){len+=sprintf(buffer+len,"%s%s",f?",":"",#x);f++;}} +#define printmode(x) \ +do { \ + if (port->modes & PARPORT_MODE_##x) \ + len += sprintf(buffer + len, "%s%s", f++ ? "," : "", #x); \ +} while (0) int f = 0; printmode(PCSPP); printmode(TRISTATE); |