mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-16 01:04:08 +08:00
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>
This commit is contained in:
parent
7b3992572f
commit
a6abfdff4f
@ -299,12 +299,16 @@ struct parport *parport_gsc_probe_port(unsigned long base,
|
|||||||
p->dma = PARPORT_DMA_NONE;
|
p->dma = PARPORT_DMA_NONE;
|
||||||
|
|
||||||
pr_cont(" [");
|
pr_cont(" [");
|
||||||
#define printmode(x) {if(p->modes&PARPORT_MODE_##x){pr_cont("%s%s",f?",":"",#x);f++;}}
|
#define printmode(x) \
|
||||||
|
do { \
|
||||||
|
if (p->modes & PARPORT_MODE_##x) \
|
||||||
|
pr_cont("%s%s", f++ ? "," : "", #x); \
|
||||||
|
} while (0)
|
||||||
{
|
{
|
||||||
int f = 0;
|
int f = 0;
|
||||||
printmode(PCSPP);
|
printmode(PCSPP);
|
||||||
printmode(TRISTATE);
|
printmode(TRISTATE);
|
||||||
printmode(COMPAT)
|
printmode(COMPAT);
|
||||||
printmode(EPP);
|
printmode(EPP);
|
||||||
// printmode(ECP);
|
// printmode(ECP);
|
||||||
// printmode(DMA);
|
// printmode(DMA);
|
||||||
|
@ -2134,19 +2134,17 @@ struct parport *parport_pc_probe_port(unsigned long int base,
|
|||||||
|
|
||||||
pr_cont(" [");
|
pr_cont(" [");
|
||||||
|
|
||||||
#define printmode(x) \
|
#define printmode(x) \
|
||||||
{\
|
do { \
|
||||||
if (p->modes & PARPORT_MODE_##x) {\
|
if (p->modes & PARPORT_MODE_##x) \
|
||||||
pr_cont("%s%s", f ? "," : "", #x); \
|
pr_cont("%s%s", f++ ? "," : "", #x); \
|
||||||
f++;\
|
} while (0)
|
||||||
} \
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
{
|
||||||
int f = 0;
|
int f = 0;
|
||||||
printmode(PCSPP);
|
printmode(PCSPP);
|
||||||
printmode(TRISTATE);
|
printmode(TRISTATE);
|
||||||
printmode(COMPAT)
|
printmode(COMPAT);
|
||||||
printmode(EPP);
|
printmode(EPP);
|
||||||
printmode(ECP);
|
printmode(ECP);
|
||||||
printmode(DMA);
|
printmode(DMA);
|
||||||
|
@ -213,7 +213,11 @@ static int do_hardware_modes(struct ctl_table *table, int write,
|
|||||||
return -EACCES;
|
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;
|
int f = 0;
|
||||||
printmode(PCSPP);
|
printmode(PCSPP);
|
||||||
printmode(TRISTATE);
|
printmode(TRISTATE);
|
||||||
|
Loading…
Reference in New Issue
Block a user