* [PATCH] can: slcan/vcan: eliminate banner[] variable, switch to pr_info()
@ 2014-12-03 8:44 Jeremiah Mahler
2014-12-03 10:10 ` Oliver Hartkopp
2014-12-07 20:18 ` Marc Kleine-Budde
0 siblings, 2 replies; 3+ messages in thread
From: Jeremiah Mahler @ 2014-12-03 8:44 UTC (permalink / raw)
To: linux-can; +Cc: Jeremiah Mahler
Several can modules in drivers/net/can use a banner[] variable at the
top which defines a string that is used once during init. This string
is also embedded with KERN_INFO which makes it printk() specific.
Improve the code by eliminating the banner[] variable and moving the
string to where it is printed. Then switch from printk(KERN_INFO to
pr_info() for the lines that were changed.
This patch is similar to [1] which was applied to net/can.
[1]: https://lkml.org/lkml/2014/11/22/10
Signed-off-by: Jeremiah Mahler <jmmahler@gmail.com>
---
drivers/net/can/slcan.c | 7 ++-----
drivers/net/can/vcan.c | 5 +----
2 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/drivers/net/can/slcan.c b/drivers/net/can/slcan.c
index acb5b92..c837eb9 100644
--- a/drivers/net/can/slcan.c
+++ b/drivers/net/can/slcan.c
@@ -56,9 +56,6 @@
#include <linux/can.h>
#include <linux/can/skb.h>
-static __initconst const char banner[] =
- KERN_INFO "slcan: serial line CAN interface driver\n";
-
MODULE_ALIAS_LDISC(N_SLCAN);
MODULE_DESCRIPTION("serial line CAN interface");
MODULE_LICENSE("GPL");
@@ -702,8 +699,8 @@ static int __init slcan_init(void)
if (maxdev < 4)
maxdev = 4; /* Sanity */
- printk(banner);
- printk(KERN_INFO "slcan: %d dynamic interface channels.\n", maxdev);
+ pr_info("slcan: serial line CAN interface driver\n");
+ pr_info("slcan: %d dynamic interface channels.\n", maxdev);
slcan_devs = kzalloc(sizeof(struct net_device *)*maxdev, GFP_KERNEL);
if (!slcan_devs)
diff --git a/drivers/net/can/vcan.c b/drivers/net/can/vcan.c
index 4e94057..674f367 100644
--- a/drivers/net/can/vcan.c
+++ b/drivers/net/can/vcan.c
@@ -50,9 +50,6 @@
#include <linux/slab.h>
#include <net/rtnetlink.h>
-static __initconst const char banner[] =
- KERN_INFO "vcan: Virtual CAN interface driver\n";
-
MODULE_DESCRIPTION("virtual CAN interface");
MODULE_LICENSE("Dual BSD/GPL");
MODULE_AUTHOR("Urs Thuermann <urs.thuermann@volkswagen.de>");
@@ -173,7 +170,7 @@ static struct rtnl_link_ops vcan_link_ops __read_mostly = {
static __init int vcan_init_module(void)
{
- printk(banner);
+ pr_info("vcan: Virtual CAN interface driver\n");
if (echo)
printk(KERN_INFO "vcan: enabled echo on driver level.\n");
--
2.1.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] can: slcan/vcan: eliminate banner[] variable, switch to pr_info()
2014-12-03 8:44 [PATCH] can: slcan/vcan: eliminate banner[] variable, switch to pr_info() Jeremiah Mahler
@ 2014-12-03 10:10 ` Oliver Hartkopp
2014-12-07 20:18 ` Marc Kleine-Budde
1 sibling, 0 replies; 3+ messages in thread
From: Oliver Hartkopp @ 2014-12-03 10:10 UTC (permalink / raw)
To: Jeremiah Mahler, linux-can
On 03.12.2014 09:44, Jeremiah Mahler wrote:
> Several can modules in drivers/net/can use a banner[] variable at the
> top which defines a string that is used once during init. This string
> is also embedded with KERN_INFO which makes it printk() specific.
>
> Improve the code by eliminating the banner[] variable and moving the
> string to where it is printed. Then switch from printk(KERN_INFO to
> pr_info() for the lines that were changed.
>
> This patch is similar to [1] which was applied to net/can.
>
> [1]: https://lkml.org/lkml/2014/11/22/10
>
> Signed-off-by: Jeremiah Mahler <jmmahler@gmail.com>
Acked-by: Oliver Hartkopp <socketcan@hartkopp.net>
Tnx
Oliver
> ---
> drivers/net/can/slcan.c | 7 ++-----
> drivers/net/can/vcan.c | 5 +----
> 2 files changed, 3 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/net/can/slcan.c b/drivers/net/can/slcan.c
> index acb5b92..c837eb9 100644
> --- a/drivers/net/can/slcan.c
> +++ b/drivers/net/can/slcan.c
> @@ -56,9 +56,6 @@
> #include <linux/can.h>
> #include <linux/can/skb.h>
>
> -static __initconst const char banner[] =
> - KERN_INFO "slcan: serial line CAN interface driver\n";
> -
> MODULE_ALIAS_LDISC(N_SLCAN);
> MODULE_DESCRIPTION("serial line CAN interface");
> MODULE_LICENSE("GPL");
> @@ -702,8 +699,8 @@ static int __init slcan_init(void)
> if (maxdev < 4)
> maxdev = 4; /* Sanity */
>
> - printk(banner);
> - printk(KERN_INFO "slcan: %d dynamic interface channels.\n", maxdev);
> + pr_info("slcan: serial line CAN interface driver\n");
> + pr_info("slcan: %d dynamic interface channels.\n", maxdev);
>
> slcan_devs = kzalloc(sizeof(struct net_device *)*maxdev, GFP_KERNEL);
> if (!slcan_devs)
> diff --git a/drivers/net/can/vcan.c b/drivers/net/can/vcan.c
> index 4e94057..674f367 100644
> --- a/drivers/net/can/vcan.c
> +++ b/drivers/net/can/vcan.c
> @@ -50,9 +50,6 @@
> #include <linux/slab.h>
> #include <net/rtnetlink.h>
>
> -static __initconst const char banner[] =
> - KERN_INFO "vcan: Virtual CAN interface driver\n";
> -
> MODULE_DESCRIPTION("virtual CAN interface");
> MODULE_LICENSE("Dual BSD/GPL");
> MODULE_AUTHOR("Urs Thuermann <urs.thuermann@volkswagen.de>");
> @@ -173,7 +170,7 @@ static struct rtnl_link_ops vcan_link_ops __read_mostly = {
>
> static __init int vcan_init_module(void)
> {
> - printk(banner);
> + pr_info("vcan: Virtual CAN interface driver\n");
>
> if (echo)
> printk(KERN_INFO "vcan: enabled echo on driver level.\n");
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] can: slcan/vcan: eliminate banner[] variable, switch to pr_info()
2014-12-03 8:44 [PATCH] can: slcan/vcan: eliminate banner[] variable, switch to pr_info() Jeremiah Mahler
2014-12-03 10:10 ` Oliver Hartkopp
@ 2014-12-07 20:18 ` Marc Kleine-Budde
1 sibling, 0 replies; 3+ messages in thread
From: Marc Kleine-Budde @ 2014-12-07 20:18 UTC (permalink / raw)
To: Jeremiah Mahler, linux-can
[-- Attachment #1: Type: text/plain, Size: 955 bytes --]
On 12/03/2014 09:44 AM, Jeremiah Mahler wrote:
> Several can modules in drivers/net/can use a banner[] variable at the
> top which defines a string that is used once during init. This string
> is also embedded with KERN_INFO which makes it printk() specific.
>
> Improve the code by eliminating the banner[] variable and moving the
> string to where it is printed. Then switch from printk(KERN_INFO to
> pr_info() for the lines that were changed.
>
> This patch is similar to [1] which was applied to net/can.
>
> [1]: https://lkml.org/lkml/2014/11/22/10
>
> Signed-off-by: Jeremiah Mahler <jmmahler@gmail.com>
applied to can-next/master.
Tnx,
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-12-07 20:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-03 8:44 [PATCH] can: slcan/vcan: eliminate banner[] variable, switch to pr_info() Jeremiah Mahler
2014-12-03 10:10 ` Oliver Hartkopp
2014-12-07 20:18 ` Marc Kleine-Budde
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.