Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751787AbaKVQrt (ORCPT ); Sat, 22 Nov 2014 11:47:49 -0500 Received: from mo4-p00-ob.smtp.rzone.de ([81.169.146.160]:8967 "EHLO mo4-p00-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750793AbaKVQrs (ORCPT ); Sat, 22 Nov 2014 11:47:48 -0500 X-Greylist: delayed 365 seconds by postgrey-1.27 at vger.kernel.org; Sat, 22 Nov 2014 11:47:47 EST X-RZG-AUTH: :P2MHfkW8eP4Mre39l357AZT/I7AY/7nT2yrT1q0ngWNsKR9Dbc7nsXB+5k7JuK6RSG8= X-RZG-CLASS-ID: mo00 Message-ID: <5470BCB8.2090904@hartkopp.net> Date: Sat, 22 Nov 2014 17:41:28 +0100 From: Oliver Hartkopp User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.2.0 MIME-Version: 1.0 To: Jeremiah Mahler CC: "David S. Miller" , linux-can@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] can: eliminate banner[] variable and switch to pr_info() References: <1416642155-31816-1-git-send-email-jmmahler@gmail.com> In-Reply-To: <1416642155-31816-1-git-send-email-jmmahler@gmail.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 22.11.2014 08:42, Jeremiah Mahler wrote: > 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 Acked-by: Oliver Hartkopp Next time please only post on linux-can ML which is the first address for CAN related stuff - as long as you don't feel it's a networking relevant issue. But for almost editorial changes - which is not urgent - linux-can should be enough. Thanks, Oliver > --- > net/can/af_can.c | 5 +---- > net/can/bcm.c | 4 +--- > net/can/raw.c | 4 +--- > 3 files changed, 3 insertions(+), 10 deletions(-) > > diff --git a/net/can/af_can.c b/net/can/af_can.c > index ce82337..ac05be1 100644 > --- a/net/can/af_can.c > +++ b/net/can/af_can.c > @@ -64,9 +64,6 @@ > > #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_LICENSE("Dual BSD/GPL"); > MODULE_AUTHOR("Urs Thuermann , " > @@ -896,7 +893,7 @@ static __init int can_init(void) > offsetof(struct can_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)); > > diff --git a/net/can/bcm.c b/net/can/bcm.c > index dcb75c0..9aa3f76 100644 > --- a/net/can/bcm.c > +++ b/net/can/bcm.c > @@ -78,8 +78,6 @@ > (CAN_SFF_MASK | CAN_EFF_FLAG | CAN_RTR_FLAG)) > > #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_LICENSE("Dual BSD/GPL"); > @@ -1615,7 +1613,7 @@ static int __init bcm_module_init(void) > { > int err; > > - printk(banner); > + pr_info("can: broadcast manager protocol (rev " CAN_BCM_VERSION " t)\n"); > > err = can_proto_register(&bcm_can_proto); > if (err < 0) { > diff --git a/net/can/raw.c b/net/can/raw.c > index 081e81f..e3250e2 100644 > --- a/net/can/raw.c > +++ b/net/can/raw.c > @@ -56,8 +56,6 @@ > #include > > #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_LICENSE("Dual BSD/GPL"); > @@ -810,7 +808,7 @@ static __init int raw_module_init(void) > { > int err; > > - printk(banner); > + pr_info("can: raw protocol (rev " CAN_RAW_VERSION ")\n"); > > err = can_proto_register(&raw_can_proto); > if (err < 0) > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/