Merge tag 'char-misc-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh...
[platform/kernel/linux-starfive.git] / drivers / parport / procfs.c
index ee7b5da..d740eba 100644 (file)
@@ -210,7 +210,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);