Skip to content

Commit 4283232

Browse files
Jiri Slaby (SUSE)gregkh
authored andcommitted
6pack: remove global strings
They are __init, so they are freed after init is done. But this obfuscates the code. Provided these days, we usually don't print anything if everything has gone fine, drop the info print completely (along with now unused and always artificial SIXPACK_VERSION). And move the other string into the printk proper (while converting from KERN_ERR to pr_err()). Signed-off-by: Jiri Slaby (SUSE) <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Andreas Koensgen <[email protected]> Cc: David S. Miller <[email protected]> Cc: Eric Dumazet <[email protected]> Cc: Jakub Kicinski <[email protected]> Cc: Paolo Abeni <[email protected]> Cc: [email protected] Cc: [email protected] Reviewed-by: Jeremy Kerr <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 392a9d4 commit 4283232

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

drivers/net/hamradio/6pack.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@
3737
#include <linux/semaphore.h>
3838
#include <linux/refcount.h>
3939

40-
#define SIXPACK_VERSION "Revision: 0.3.0"
41-
4240
/* sixpack priority commands */
4341
#define SIXP_SEOF 0x40 /* start and end of a 6pack frame */
4442
#define SIXP_TX_URUN 0x48 /* transmit overrun */
@@ -745,21 +743,14 @@ static struct tty_ldisc_ops sp_ldisc = {
745743

746744
/* Initialize 6pack control device -- register 6pack line discipline */
747745

748-
static const char msg_banner[] __initconst = KERN_INFO \
749-
"AX.25: 6pack driver, " SIXPACK_VERSION "\n";
750-
static const char msg_regfail[] __initconst = KERN_ERR \
751-
"6pack: can't register line discipline (err = %d)\n";
752-
753746
static int __init sixpack_init_driver(void)
754747
{
755748
int status;
756749

757-
printk(msg_banner);
758-
759750
/* Register the provided line protocol discipline */
760751
status = tty_register_ldisc(&sp_ldisc);
761752
if (status)
762-
printk(msg_regfail, status);
753+
pr_err("6pack: can't register line discipline (err = %d)\n", status);
763754

764755
return status;
765756
}

0 commit comments

Comments
 (0)