提交 b111b78c 编写于 作者: J Jeremiah Mahler 提交者: Marc Kleine-Budde

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: NJeremiah Mahler <jmmahler@gmail.com>
Acked-by: NOliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: NMarc Kleine-Budde <mkl@pengutronix.de>
上级 8d0c4697
...@@ -64,9 +64,6 @@ ...@@ -64,9 +64,6 @@
#include "af_can.h" #include "af_can.h"
static __initconst const char banner[] = KERN_INFO
"can: controller area network core (" CAN_VERSION_STRING ")\n";
MODULE_DESCRIPTION("Controller Area Network PF_CAN core"); MODULE_DESCRIPTION("Controller Area Network PF_CAN core");
MODULE_LICENSE("Dual BSD/GPL"); MODULE_LICENSE("Dual BSD/GPL");
MODULE_AUTHOR("Urs Thuermann <urs.thuermann@volkswagen.de>, " MODULE_AUTHOR("Urs Thuermann <urs.thuermann@volkswagen.de>, "
...@@ -896,7 +893,7 @@ static __init int can_init(void) ...@@ -896,7 +893,7 @@ static __init int can_init(void)
offsetof(struct can_frame, data) != offsetof(struct can_frame, data) !=
offsetof(struct canfd_frame, data)); offsetof(struct canfd_frame, data));
printk(banner); pr_info("can: controller area network core (" CAN_VERSION_STRING ")\n");
memset(&can_rx_alldev_list, 0, sizeof(can_rx_alldev_list)); memset(&can_rx_alldev_list, 0, sizeof(can_rx_alldev_list));
......
...@@ -78,8 +78,6 @@ ...@@ -78,8 +78,6 @@
(CAN_SFF_MASK | CAN_EFF_FLAG | CAN_RTR_FLAG)) (CAN_SFF_MASK | CAN_EFF_FLAG | CAN_RTR_FLAG))
#define CAN_BCM_VERSION CAN_VERSION #define CAN_BCM_VERSION CAN_VERSION
static __initconst const char banner[] = KERN_INFO
"can: broadcast manager protocol (rev " CAN_BCM_VERSION " t)\n";
MODULE_DESCRIPTION("PF_CAN broadcast manager protocol"); MODULE_DESCRIPTION("PF_CAN broadcast manager protocol");
MODULE_LICENSE("Dual BSD/GPL"); MODULE_LICENSE("Dual BSD/GPL");
...@@ -1612,7 +1610,7 @@ static int __init bcm_module_init(void) ...@@ -1612,7 +1610,7 @@ static int __init bcm_module_init(void)
{ {
int err; int err;
printk(banner); pr_info("can: broadcast manager protocol (rev " CAN_BCM_VERSION " t)\n");
err = can_proto_register(&bcm_can_proto); err = can_proto_register(&bcm_can_proto);
if (err < 0) { if (err < 0) {
......
...@@ -56,8 +56,6 @@ ...@@ -56,8 +56,6 @@
#include <net/net_namespace.h> #include <net/net_namespace.h>
#define CAN_RAW_VERSION CAN_VERSION #define CAN_RAW_VERSION CAN_VERSION
static __initconst const char banner[] =
KERN_INFO "can: raw protocol (rev " CAN_RAW_VERSION ")\n";
MODULE_DESCRIPTION("PF_CAN raw protocol"); MODULE_DESCRIPTION("PF_CAN raw protocol");
MODULE_LICENSE("Dual BSD/GPL"); MODULE_LICENSE("Dual BSD/GPL");
...@@ -810,7 +808,7 @@ static __init int raw_module_init(void) ...@@ -810,7 +808,7 @@ static __init int raw_module_init(void)
{ {
int err; int err;
printk(banner); pr_info("can: raw protocol (rev " CAN_RAW_VERSION ")\n");
err = can_proto_register(&raw_can_proto); err = can_proto_register(&raw_can_proto);
if (err < 0) if (err < 0)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册