* [PATCH] lp: fix switch-case indentation
@ 2026-04-26 17:01 dragonship20
2026-04-27 11:43 ` Greg KH
0 siblings, 1 reply; 2+ messages in thread
From: dragonship20 @ 2026-04-26 17:01 UTC (permalink / raw)
To: arnd; +Cc: gregkh, linux-kernel, Antoni Wardziński
From: Antoni Wardziński <dragonship20@gmail.com>
Align case labels with switch statement
according to Linux kernel coding style.
No functional change.
Signed-off-by: Antoni Wardziński <dragonship20@gmail.com>
---
drivers/char/lp.c | 128 +++++++++++++++++++++++-----------------------
1 file changed, 64 insertions(+), 64 deletions(-)
diff --git a/drivers/char/lp.c b/drivers/char/lp.c
index 24417a00dfe9..97db9d945b4f 100644
--- a/drivers/char/lp.c
+++ b/drivers/char/lp.c
@@ -593,74 +593,74 @@ static int lp_do_ioctl(unsigned int minor, unsigned int cmd,
if ((LP_F(minor) & LP_EXIST) == 0)
return -ENODEV;
switch (cmd) {
- case LPTIME:
- if (arg > UINT_MAX / HZ)
- return -EINVAL;
- LP_TIME(minor) = arg * HZ/100;
- break;
- case LPCHAR:
- LP_CHAR(minor) = arg;
- break;
- case LPABORT:
- if (arg)
- LP_F(minor) |= LP_ABORT;
- else
- LP_F(minor) &= ~LP_ABORT;
- break;
- case LPABORTOPEN:
- if (arg)
- LP_F(minor) |= LP_ABORTOPEN;
- else
- LP_F(minor) &= ~LP_ABORTOPEN;
- break;
- case LPCAREFUL:
- if (arg)
- LP_F(minor) |= LP_CAREFUL;
- else
- LP_F(minor) &= ~LP_CAREFUL;
- break;
- case LPWAIT:
- LP_WAIT(minor) = arg;
- break;
- case LPSETIRQ:
+ case LPTIME:
+ if (arg > UINT_MAX / HZ)
return -EINVAL;
- case LPGETIRQ:
- if (copy_to_user(argp, &LP_IRQ(minor),
- sizeof(int)))
- return -EFAULT;
- break;
- case LPGETSTATUS:
- if (mutex_lock_interruptible(&lp_table[minor].port_mutex))
- return -EINTR;
- lp_claim_parport_or_block(&lp_table[minor]);
- status = r_str(minor);
- lp_release_parport(&lp_table[minor]);
- mutex_unlock(&lp_table[minor].port_mutex);
-
- if (copy_to_user(argp, &status, sizeof(int)))
- return -EFAULT;
- break;
- case LPRESET:
- lp_reset(minor);
- break;
+ LP_TIME(minor) = arg * HZ/100;
+ break;
+ case LPCHAR:
+ LP_CHAR(minor) = arg;
+ break;
+ case LPABORT:
+ if (arg)
+ LP_F(minor) |= LP_ABORT;
+ else
+ LP_F(minor) &= ~LP_ABORT;
+ break;
+ case LPABORTOPEN:
+ if (arg)
+ LP_F(minor) |= LP_ABORTOPEN;
+ else
+ LP_F(minor) &= ~LP_ABORTOPEN;
+ break;
+ case LPCAREFUL:
+ if (arg)
+ LP_F(minor) |= LP_CAREFUL;
+ else
+ LP_F(minor) &= ~LP_CAREFUL;
+ break;
+ case LPWAIT:
+ LP_WAIT(minor) = arg;
+ break;
+ case LPSETIRQ:
+ return -EINVAL;
+ case LPGETIRQ:
+ if (copy_to_user(argp, &LP_IRQ(minor),
+ sizeof(int)))
+ return -EFAULT;
+ break;
+ case LPGETSTATUS:
+ if (mutex_lock_interruptible(&lp_table[minor].port_mutex))
+ return -EINTR;
+ lp_claim_parport_or_block(&lp_table[minor]);
+ status = r_str(minor);
+ lp_release_parport(&lp_table[minor]);
+ mutex_unlock(&lp_table[minor].port_mutex);
+
+ if (copy_to_user(argp, &status, sizeof(int)))
+ return -EFAULT;
+ break;
+ case LPRESET:
+ lp_reset(minor);
+ break;
#ifdef LP_STATS
- case LPGETSTATS:
- if (copy_to_user(argp, &LP_STAT(minor),
- sizeof(struct lp_stats)))
- return -EFAULT;
- if (capable(CAP_SYS_ADMIN))
- memset(&LP_STAT(minor), 0,
- sizeof(struct lp_stats));
- break;
+ case LPGETSTATS:
+ if (copy_to_user(argp, &LP_STAT(minor),
+ sizeof(struct lp_stats)))
+ return -EFAULT;
+ if (capable(CAP_SYS_ADMIN))
+ memset(&LP_STAT(minor), 0,
+ sizeof(struct lp_stats));
+ break;
#endif
- case LPGETFLAGS:
- status = LP_F(minor);
- if (copy_to_user(argp, &status, sizeof(int)))
- return -EFAULT;
- break;
+ case LPGETFLAGS:
+ status = LP_F(minor);
+ if (copy_to_user(argp, &status, sizeof(int)))
+ return -EFAULT;
+ break;
- default:
- retval = -EINVAL;
+ default:
+ retval = -EINVAL;
}
return retval;
}
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] lp: fix switch-case indentation
2026-04-26 17:01 [PATCH] lp: fix switch-case indentation dragonship20
@ 2026-04-27 11:43 ` Greg KH
0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2026-04-27 11:43 UTC (permalink / raw)
To: dragonship20; +Cc: arnd, linux-kernel
On Sun, Apr 26, 2026 at 07:01:47PM +0200, dragonship20@gmail.com wrote:
> From: Antoni Wardziński <dragonship20@gmail.com>
>
> Align case labels with switch statement
> according to Linux kernel coding style.
>
> No functional change.
That's nice, but for old code like this, there is no need to run
checkpatch on it. If you wish to do checkpatch cleanups, please stick
to drivers/staging/ or other subsystems that allow this. Otherwise it's
a constant churn on the codebase for not a good reason (i.e. only do it
when you are actually making a fix/feature).
thanks,
greg k-h
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-04-27 11:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-26 17:01 [PATCH] lp: fix switch-case indentation dragonship20
2026-04-27 11:43 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox