Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp289314imn; Thu, 28 Jul 2022 00:07:20 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t9u4LnNeihJwaey9FifeFAmwYH4DYfY8vFRtyg06GjlJwy4PqJsX3oSBECDgwGFWv/XGIe X-Received: by 2002:a17:90b:4b0a:b0:1f2:a904:8af7 with SMTP id lx10-20020a17090b4b0a00b001f2a9048af7mr8893517pjb.76.1658992039984; Thu, 28 Jul 2022 00:07:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658992039; cv=none; d=google.com; s=arc-20160816; b=ZL4Ve8LuGpdXxmGdh13FgFnboDj8sy9k1IAdlL1Eh4nSSjpN46TnEOyVk+VEWaXGNP qnLS01Zm5R2bf9wzvkAJuLfjEHRqbCNN9MGWzPT4X/ERX9oGwB/43I2dKZTgpUMtdtKF 09kltg1idHQLa6aYtHVTKTg4VS4EeL0pirWO0pUjaxV6SDwSpNpXTHkA+kum6WrRpf6p 8EBWvWCOKy/SmtXoSaihQxJY2q54IFFuy/RcTKobknQo6/pjMdE/Y0n40cUwqi7C5/Cw KNnTAFo9zS2EKSjyhbpSxRdotzVNLswxsBFqtgMfqW4Dp5zfJEV7Ic3WugVgOweFAUoV Aqgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=W6W3RCGbQm1ftNxYyveQiUbovGJZ//OaxbWEapVu2yM=; b=dFlCP/nZYZurNKxjm5Z9kbRv3h5o2eUcJaVObP+nslxbYp1vdbU2uLhbvNSfCIgYuk 4P9JJOshpj7CaUrURAFLhywb/V4l9s/vpwuOiHo4G0ygN3/jRHzTyy+YhJrDNd83AfW2 N+SWWHAjbbI3jBRzv5fOqCe7w3F+WlyDlbmlm436NEjUQavK9cKa6P6gYbQmo1u+kT/6 lVehhYINIPgBogvOyEzj6YSwhtxbObMvUkv099bzbGImpvwUMvWYkESofdEwdq2HNTar I/VAN8rWII+0K3tgupVUpRcDs6M+yMSjJ2HiUH3Pv+B0tij9l3KnZNqVSpZW5Kdp0Li0 u+CA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=RMGtU7wa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s15-20020a170902ea0f00b0016c46ef4762si271158plg.315.2022.07.28.00.07.05; Thu, 28 Jul 2022 00:07:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=RMGtU7wa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234530AbiG1HDN (ORCPT + 99 others); Thu, 28 Jul 2022 03:03:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234453AbiG1HDH (ORCPT ); Thu, 28 Jul 2022 03:03:07 -0400 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 538BA51438 for ; Thu, 28 Jul 2022 00:03:06 -0700 (PDT) Received: by mail-ej1-x62d.google.com with SMTP id z23so1561980eju.8 for ; Thu, 28 Jul 2022 00:03:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=W6W3RCGbQm1ftNxYyveQiUbovGJZ//OaxbWEapVu2yM=; b=RMGtU7wa3UslEpI8xFxyuBq85BrBQa1EIe6ZZK8JQfbmJImOag3Lo/f6/9n3yIeGAf rQGt8YLaIfAPDF3SEr3Ky6v2rPZ5bteL0UEN5FYZNbRGSrjJgoKR9tAvIb/4yzEu5042 d3O57JASdLqdVorgzx3y0hGmbBl3BGVytE0nk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=W6W3RCGbQm1ftNxYyveQiUbovGJZ//OaxbWEapVu2yM=; b=fo/N9AAPrzPUvdBRr8U4ESDR6y52clzJgbLxgP1eLrNo467J6gEB/Aq+cDOOL41MWi V+Nxh+0i/GuhkvwLBBdhqSOd6MdFwULqDIZ4etro5f8oDXKxNvOosTDHcUr3H7+sVMIr 10nDPFXmSEmIAOa4flt3Q5oR3rUu0UymlNHtLABtYNn7VsS5XjB4x6SVAvOreP78T4y1 +ibps7o2PTAuxJtoyRBvLOi4uJ5xzGlUHZxrRHp8Winzz2EZcQQpu/RKOB1XGL/bwZWk MDuXDDzZtZMFbDJiguaLi9U3DAMZTEZKMnkK/iGWJ6kesnuK/uMcDMq99Zx7Ua814IkH q1pA== X-Gm-Message-State: AJIora93stboqyQ1q9a5JQvqPPtCqLqvu6tAGy+75q6D33I0r45g1CyA iJo0X820fBPb6LOTAlcjg32bbTcTHiQUvw== X-Received: by 2002:a17:907:28d6:b0:72b:7497:76b with SMTP id en22-20020a17090728d600b0072b7497076bmr19828979ejc.365.1658991784453; Thu, 28 Jul 2022 00:03:04 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.homenet.telecomitalia.it (host-79-31-31-9.retail.telecomitalia.it. [79.31.31.9]) by smtp.gmail.com with ESMTPSA id r18-20020aa7d152000000b0042de3d661d2sm154742edo.1.2022.07.28.00.03.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Jul 2022 00:03:03 -0700 (PDT) From: Dario Binacchi To: linux-kernel@vger.kernel.org Cc: linux-can@vger.kernel.org, Marc Kleine-Budde , Jeroen Hofstee , michael@amarulasolutions.com, Amarula patchwork , Oliver Hartkopp , Vincent Mailhol , Dario Binacchi , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Wolfgang Grandegger , netdev@vger.kernel.org Subject: [PATCH v4 1/7] can: slcan: use KBUILD_MODNAME and define pr_fmt to replace hardcoded names Date: Thu, 28 Jul 2022 09:02:48 +0200 Message-Id: <20220728070254.267974-2-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220728070254.267974-1-dario.binacchi@amarulasolutions.com> References: <20220728070254.267974-1-dario.binacchi@amarulasolutions.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vincent Mailhol The driver uses the string "slcan" to populate tty_ldisc_ops::name. KBUILD_MODNAME also evaluates to "slcan". Use KBUILD_MODNAME to get rid on the hardcoded string names. Similarly, the pr_info() and pr_err() hardcoded the "slcan" prefix. Define pr_fmt so that the "slcan" prefix gets automatically added. CC: Dario Binacchi Signed-off-by: Vincent Mailhol Signed-off-by: Dario Binacchi --- (no changes since v1) drivers/net/can/slcan/slcan-core.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/net/can/slcan/slcan-core.c b/drivers/net/can/slcan/slcan-core.c index dfd1baba4130..2c9d9fc19ea9 100644 --- a/drivers/net/can/slcan/slcan-core.c +++ b/drivers/net/can/slcan/slcan-core.c @@ -35,6 +35,8 @@ * */ +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + #include #include @@ -863,7 +865,7 @@ static struct slcan *slc_alloc(void) if (!dev) return NULL; - snprintf(dev->name, sizeof(dev->name), "slcan%d", i); + snprintf(dev->name, sizeof(dev->name), KBUILD_MODNAME "%d", i); dev->netdev_ops = &slc_netdev_ops; dev->base_addr = i; slcan_set_ethtool_ops(dev); @@ -936,7 +938,7 @@ static int slcan_open(struct tty_struct *tty) rtnl_unlock(); err = register_candev(sl->dev); if (err) { - pr_err("slcan: can't register candev\n"); + pr_err("can't register candev\n"); goto err_free_chan; } } else { @@ -1027,7 +1029,7 @@ static int slcan_ioctl(struct tty_struct *tty, unsigned int cmd, static struct tty_ldisc_ops slc_ldisc = { .owner = THIS_MODULE, .num = N_SLCAN, - .name = "slcan", + .name = KBUILD_MODNAME, .open = slcan_open, .close = slcan_close, .hangup = slcan_hangup, @@ -1043,8 +1045,8 @@ static int __init slcan_init(void) if (maxdev < 4) maxdev = 4; /* Sanity */ - pr_info("slcan: serial line CAN interface driver\n"); - pr_info("slcan: %d dynamic interface channels.\n", maxdev); + pr_info("serial line CAN interface driver\n"); + pr_info("%d dynamic interface channels.\n", maxdev); slcan_devs = kcalloc(maxdev, sizeof(struct net_device *), GFP_KERNEL); if (!slcan_devs) @@ -1053,7 +1055,7 @@ static int __init slcan_init(void) /* Fill in our line protocol discipline, and register it */ status = tty_register_ldisc(&slc_ldisc); if (status) { - pr_err("slcan: can't register line discipline\n"); + pr_err("can't register line discipline\n"); kfree(slcan_devs); } return status; -- 2.32.0