aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremiah Mahler <jmmahler@gmail.com>2014-11-22 02:42:35 -0500
committerMarc Kleine-Budde <mkl@pengutronix.de>2014-12-07 15:22:01 -0500
commitb111b78c6ea52690a47f16922cb41c78f08dd298 (patch)
treebfaa0f16127661c929069cad687052eb4503b288
parent8d0c4697534a739725e429ff062dea393d8860d1 (diff)
can: eliminate banner[] variable and switch to pr_info()
Several CAN modules use a design pattern with a banner[] variable at the top which defines a string that is used once during init to print the banner. The 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. Signed-off-by: Jeremiah Mahler <jmmahler@gmail.com> Acked-by: Oliver Hartkopp <socketcan@hartkopp.net> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
-rw-r--r--net/can/af_can.c5
-rw-r--r--net/can/bcm.c4
-rw-r--r--net/can/raw.c4
3 files changed, 3 insertions, 10 deletions
diff --git a/net/can/af_can.c b/net/can/af_can.c
index ce82337521f6..ac05be131df7 100644
--- a/net/can/af_can.c
+++ b/net/can/af_can.c
@@ -64,9 +64,6 @@
64 64
65#include "af_can.h" 65#include "af_can.h"
66 66
67static __initconst const char banner[] = KERN_INFO
68 "can: controller area network core (" CAN_VERSION_STRING ")\n";
69
70MODULE_DESCRIPTION("Controller Area Network PF_CAN core"); 67MODULE_DESCRIPTION("Controller Area Network PF_CAN core");
71MODULE_LICENSE("Dual BSD/GPL"); 68MODULE_LICENSE("Dual BSD/GPL");
72MODULE_AUTHOR("Urs Thuermann <urs.thuermann@volkswagen.de>, " 69MODULE_AUTHOR("Urs Thuermann <urs.thuermann@volkswagen.de>, "
@@ -896,7 +893,7 @@ static __init int can_init(void)
896 offsetof(struct can_frame, data) != 893 offsetof(struct can_frame, data) !=
897 offsetof(struct canfd_frame, data)); 894 offsetof(struct canfd_frame, data));
898 895
899 printk(banner); 896 pr_info("can: controller area network core (" CAN_VERSION_STRING ")\n");
900 897
901 memset(&can_rx_alldev_list, 0, sizeof(can_rx_alldev_list)); 898 memset(&can_rx_alldev_list, 0, sizeof(can_rx_alldev_list));
902 899
diff --git a/net/can/bcm.c b/net/can/bcm.c
index 01671187e3fe..6169aa2e42bc 100644
--- a/net/can/bcm.c
+++ b/net/can/bcm.c
@@ -78,8 +78,6 @@
78 (CAN_SFF_MASK | CAN_EFF_FLAG | CAN_RTR_FLAG)) 78 (CAN_SFF_MASK | CAN_EFF_FLAG | CAN_RTR_FLAG))
79 79
80#define CAN_BCM_VERSION CAN_VERSION 80#define CAN_BCM_VERSION CAN_VERSION
81static __initconst const char banner[] = KERN_INFO
82 "can: broadcast manager protocol (rev " CAN_BCM_VERSION " t)\n";
83 81
84MODULE_DESCRIPTION("PF_CAN broadcast manager protocol"); 82MODULE_DESCRIPTION("PF_CAN broadcast manager protocol");
85MODULE_LICENSE("Dual BSD/GPL"); 83MODULE_LICENSE("Dual BSD/GPL");
@@ -1612,7 +1610,7 @@ static int __init bcm_module_init(void)
1612{ 1610{
1613 int err; 1611 int err;
1614 1612
1615 printk(banner); 1613 pr_info("can: broadcast manager protocol (rev " CAN_BCM_VERSION " t)\n");
1616 1614
1617 err = can_proto_register(&bcm_can_proto); 1615 err = can_proto_register(&bcm_can_proto);
1618 if (err < 0) { 1616 if (err < 0) {
diff --git a/net/can/raw.c b/net/can/raw.c
index dfdcffbb1070..00c13ef23661 100644
--- a/net/can/raw.c
+++ b/net/can/raw.c
@@ -56,8 +56,6 @@
56#include <net/net_namespace.h> 56#include <net/net_namespace.h>
57 57
58#define CAN_RAW_VERSION CAN_VERSION 58#define CAN_RAW_VERSION CAN_VERSION
59static __initconst const char banner[] =
60 KERN_INFO "can: raw protocol (rev " CAN_RAW_VERSION ")\n";
61 59
62MODULE_DESCRIPTION("PF_CAN raw protocol"); 60MODULE_DESCRIPTION("PF_CAN raw protocol");
63MODULE_LICENSE("Dual BSD/GPL"); 61MODULE_LICENSE("Dual BSD/GPL");
@@ -810,7 +808,7 @@ static __init int raw_module_init(void)
810{ 808{
811 int err; 809 int err;
812 810
813 printk(banner); 811 pr_info("can: raw protocol (rev " CAN_RAW_VERSION ")\n");
814 812
815 err = can_proto_register(&raw_can_proto); 813 err = can_proto_register(&raw_can_proto);
816 if (err < 0) 814 if (err < 0)