From patchwork Thu Jul 28 07:02:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 2273 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 1CF7D3F013 for ; Thu, 28 Jul 2022 09:03:06 +0200 (CEST) Received: by mail-ed1-f69.google.com with SMTP id i5-20020a05640242c500b0043c17424381sf541128edc.13 for ; Thu, 28 Jul 2022 00:03:06 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1658991786; cv=pass; d=google.com; s=arc-20160816; b=nZPK7SogynWh0UNJ96SJXeQd94EFsMFIue6dV1YtOZiLR/NFEgftndb/itHHgbv+GW Or4oBIr+H4etfjxomuMhdNICKYOX+lbrwWuQJtrm6sfpIRqq1CHpo/j3xNVYglnNGt2V IhEAmypd1axB7DpzFLpRSgAiz0PHxKUgAqH0J+4lf059uOxmeOGKsfXytrgyShOq0fFb r7U2BpvFQ5/SmQ6qcMG4s+msKM7O4bgAOza6EdeEDQnqt9dn9KfLGVRVi56SEUCo0Q4p HFGB2mOkNclCMZDV9YJTx3djZsRADJ0nzPG9lUmgnHywJjxNMrgUrqjQ8RxZzwycuLDB yMyQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=BBinzeBC6GzMFHUqWADB3zp2tYnraOQWE0XQu0kzeUs=; b=A022+EMgaULkJnbLuCv2f5OZ8ksrWdJpMM+3khgsoahfSOJeVb18kwMxVkmWcJNw2+ MlT3tradQJ2sBN0QKzLWHFpO3/zy9tJvnZtl8dS5cbbxEDHYgMVHGZFRuLav4mwM8cg9 eMPUfKK7oLHUqZe4kQ0BaXS2oMYu8pEscL9CZlyWuo/l2jXU+rZ/ZjCEKRU1R0eCNF/7 3SfzzkFnF4drjEcYJfHTOFwu6IWKh7FDqEfklkN9HYrcGwGAioxCN7H5Y8Z0EVuHVp7S LJgDKKMGKfvmawsJK4O65slXAmNZ7JLA6TVpQKeNU5oQYGQwUaaNC96PPj/JCngscW48 JxGw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=RMGtU7wa; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com 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:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=BBinzeBC6GzMFHUqWADB3zp2tYnraOQWE0XQu0kzeUs=; b=AiQae9HyBYpjLpBt6MMEctG9nNZ3Jqt0/Y3JLRo2p6n642J0OPZU9e8pyH626bJPdI d2FjfmKjScVO/1x2DKqg2gaMhcSV7ldomCyF1OEFjfCBkoGIv+JL/WSEVRYhhmxr+8wV 8iMA/+HeRCsnId4iSLgbizp2/9rZjpKlHgcps= 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:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=BBinzeBC6GzMFHUqWADB3zp2tYnraOQWE0XQu0kzeUs=; b=5W0sWYRATi3AO6Zv1BIApwCbZ7nFxuWmfAGQbco9n0f3UyaLbPsQ2IZl9jU4S1+5l3 KcHkHRJrJzopi227Df6QQ4rKXiXMmAqsaxQXzXNMPo03urN9O31tpZKEToBfdxumQkdi pRVSAH44ZPDIXXs4viFBWtkfHh7pjfKRboAP84393kK8c/rky0YdH8lnOtc7v/hdCz4p 3GPJIGUMrfnQ590KlMyiEMAvqyZjkPwv8oRhyCV9CbfwS/5r80JfE0jBaP2O5z/e2+hI sn8qTp9JKGGOas1Cpk+7Bapm/2NRERiDu/87ZHjqqwmwUi/bGYpAidICZ0MGA3cb7JDI FV/Q== X-Gm-Message-State: AJIora/DbNVw6fq7WrcRTm+d0Bx72RqluhJkXo5PRVfult5uHZ5/Fd1M ECehnrJvLb0svAXeU8qS/O35AziM X-Google-Smtp-Source: AGRyM1vjzC2s53he7d/wkfOxENfGRtZDFB4UeyARdtv6aFLrbpj5pfLewsA8nRRAUCHVwXA9s731ew== X-Received: by 2002:a05:6402:d05:b0:425:b7ab:776e with SMTP id eb5-20020a0564020d0500b00425b7ab776emr27165730edb.142.1658991785933; Thu, 28 Jul 2022 00:03:05 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:906:3b8a:b0:72f:b55a:8f8c with SMTP id u10-20020a1709063b8a00b0072fb55a8f8cls422618ejf.6.-pod-prod-gmail; Thu, 28 Jul 2022 00:03:05 -0700 (PDT) X-Received: by 2002:a17:907:3f92:b0:72b:5af8:b87d with SMTP id hr18-20020a1709073f9200b0072b5af8b87dmr19560084ejc.416.1658991784907; Thu, 28 Jul 2022 00:03:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658991784; cv=none; d=google.com; s=arc-20160816; b=fM/x8ns96TKaZQrtR5z2Oy8P4Yl1mPUftQISVEanGffcciHC7lVR3ex+1Zh/HUbdCB 7HgBadtF91xcG1idN0mVbDXn5VxTJhWCfAEwVfuTNtDu7TTyH/ODKSkPGJHXbzhIQhwD iUxv+pDxEkNB/HJvKK3lsr1lgdhWDe/n5hhqJ2QcSVvfGX6Yd4GF5VKnmDLGrd2qWKNd Fwg4mCK+iNO6zZtswrQlKKLA0oeAfkYDqIwdan3FH2GrpKOSMM197KqLnj1rULUkVhg+ g2PIa85cflJPfDGCcGVIyrxoFXGg3VmFvUOfFKCrJ91L6jhS5MzbzMamdzW+XQUknZ4J ELjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=W6W3RCGbQm1ftNxYyveQiUbovGJZ//OaxbWEapVu2yM=; b=vxRC7WYlrsAUF3ii4NMZNKgyMcDbkaMEW5g/GNeY05nrQkqw7oNqRiPweXp4p6di9A 6foQ9HVaas8zxm1Q/8PQhMoDi/cqn/5II2CIr6WKvfVFT1bD2U3pjCyA4So9AY8/lfih wgLkzImSx/Uu+bKLVQ8y8LuLu1ZAsZD+SkTzY3XedmOenQ+pLTXCCaQAVE6L3vGup349 Fckz+Kn2/GK9fzJG6jvYqEG+M/8pjYnuG4A75efPq6PMUm/82DN4mypPEG7rQtNANVb0 1pXHFbHTa6jQYnUUJ4+C0yBWlXZticYO2RcCDtVH4EItw4GZ95woNjrvzmT/u/xnJJ+Q Q38g== 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 dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id fp17-20020a1709069e1100b0072ed895ffb7sor56955ejc.95.2022.07.28.00.03.04 for (Google Transport Security); Thu, 28 Jul 2022 00:03:04 -0700 (PDT) Received-SPF: pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; 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 X-Original-Sender: dario.binacchi@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=RMGtU7wa; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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;