From patchwork Tue Jul 26 21:02:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 2252 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 828B23F0D5 for ; Tue, 26 Jul 2022 23:03:26 +0200 (CEST) Received: by mail-ed1-f71.google.com with SMTP id v9-20020a056402348900b0043bcd680e50sf8019724edc.18 for ; Tue, 26 Jul 2022 14:03:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1658869406; cv=pass; d=google.com; s=arc-20160816; b=dojEO6roLQlTZZ0IU45QMFZ0qaokmp0Ee8GoMeK66aUinMXCBMreaElT+l9fC/1n8e rUsAlP8S+g+XTgysvdo4Db6h/J+ZZ1pXcoCe03j+Ro8oIeWPWZRMqXA5NWRGg2f+yOF+ Vpsaq5EDwkyTq8XB2r3BLbj16lcsD2HzhXOtqMFH5XRqxzs1wNPxnnXhV2s7UcGJeBxc KFcgPDN/zbwtBw9L2ua251BaknHJ6WP9qzwT+4RhqAHxarOI4jTQS819XoMcchNYfmV4 PR6NBGtLkcNs8r3sxGOrSSrAeTyy6gdZfNipFbzcBjozTsi/PCRnwUNR6s8iLthKMaIl uC2Q== 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=HXLVvazcsDzquk3hy6c+bDxVue5h3OkAbn7lCPOPdmSJbade1TPwBLP21jACz6j9DJ 5kToTc/t3FCjMOcxFVmIdXVoSJdomf835VQIex5mdf9KRq5V5il5wIcdFkVIck8ILE8y 1o4SiHcoH7XesgNUT6pXhfzBsfdw0Pz/Wi9UD2bMu11FbgWZG46zR6dAZkt941arInH9 lHf0LntbzKJyi/XHqd+8eUDnpxIKa2WxtkaSW3x8hKq7JoCoM3dYttjLJFl61a3mrCnA 3m4wG8w0t8DPYqPk/ngcj3ZJatIizqKbp8IpVCGkSVK/JZlXq1Z/qftVnTdmvv9JTOBB fkUw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=VlEPTxUO; 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=qEEb1ZT2UVCmjD7QT0dl+t/V3wXZH36i4H8k2ffYNQY10mmp1XcJQmYR8lzbQdCjRi oPA0b/QsGjDptcTs5vGEad7nhyAXvzR3hMbU729aM4LZxu/6AWmuyNUnMrXzJ/euWOmA YqOUGWDguGgY+7rFjF1FQDPZIZD+vjptqcCrY= 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=gzM1E1rdWidjKO8jrOlkXzu4P4Hnd/ZGhnJY5pr+vIVmFASma0rJsVgj4qHJpAu4KM V0WIcKogfB7vPw7osITtDK6j2hipSMB45t51QLTHHb4/vXbWoW3TJvqKUoxPqUQdYBW/ vXxn7/Ob5LPu8OAbN3RMQXQSnQZRPxtN46UDEWZkqqgT+7nqAnzridSP8kraqPthmTPm O7Nu0dxDFdYOjDtYa7W3SsNW3D8f68bpFAJONBlYg4RaMvMUDpFbA9R8nx/SSdR6j0C9 XFLGHWjtVM7qcvV+1MoZea3Im2HfSfdALlli/4VqccZNGL8Sf8ZQSQR/7k+523AGvTj6 o1Ew== X-Gm-Message-State: AJIora/qTm1aQFkkQZYcvi5RWlfvij6MTQMOgAqLoY9v4bADnYbvoN7K jE3xbTPhdgbCEKJadrwgbfxGPro7 X-Google-Smtp-Source: AGRyM1vP0YajOIrjqgYJt4WWC/1WbLwgaIVX19U7lcyfol8UdSc/ZYf9PNIXgX4Og3Jc70e94BlHfQ== X-Received: by 2002:a05:6402:414b:b0:43b:6b1a:c230 with SMTP id x11-20020a056402414b00b0043b6b1ac230mr20274062eda.42.1658869406341; Tue, 26 Jul 2022 14:03:26 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6402:4248:b0:43a:77a6:b0d with SMTP id g8-20020a056402424800b0043a77a60b0dls1338675edb.3.-pod-prod-gmail; Tue, 26 Jul 2022 14:03:25 -0700 (PDT) X-Received: by 2002:aa7:cd99:0:b0:43c:4f9c:4977 with SMTP id x25-20020aa7cd99000000b0043c4f9c4977mr5026101edv.303.1658869405262; Tue, 26 Jul 2022 14:03:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658869405; cv=none; d=google.com; s=arc-20160816; b=JvdnDWCrpTRNeRNUaTdGXLXOrD4IbadwRhJzhc0A8ZsOQyRLqnIlIK0xfw8JnAvmEa G2nl8MuH9pi4puV+FQsHGmHTeIulaByKDXrvi0eA1rb6adHRAWaObPXVHDMSdY/1lfU2 +ibiqM8LVwYRTGmHMvLMdlehXR4sHkcUTfQCSKk7inJbgXLC0mv5dXmrsx9ptDshBr4t HlieRTKdfskKNGZbbTTKfhorNaY81nNb0/B7o4R7g1fxuyNHwOc+Ic/hKp1/r+lrZ/P4 DX2iSwSMEItoELN5/JYEh3oLA7+OgdQ+bWCAwcvKiT62u926pgU3eo3PO4E84d7NJxeK vcoA== 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=ybZVgjQHaJaapJOkJ2r+lBZn6hMpWHAx5ye3ATVuSgKc2qPQ+42NbKwa6Ok1JZBALV RDX3DByu1jAjpxTbWgCT3znwGcdU8YWkFpZ/fVhIjQUEekvu/eXtsIC9EuDlYDC2z1Qd hUetH4HAoe7WT/CygYNBHaAlD/Zc17rJaJbqCUVogj9InRYu/YiKaXQX8JcklqRcVRzL vDb4xO4CGGcWAUHlaL0BZC7/VIPzAQyVeB0Mat3LxfVzzfUmilloDNPK8AX3S01eZ3k/ H4VuxvCwcu0AUoL5kY1QpOYTHAAsQ+f4KC+1kgtObFlAD5elQ/m0S2GsaoWgFejUtfTP Ky+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=VlEPTxUO; 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 wj3-20020a170907050300b0072aa38d1537sor6128358ejb.34.2022.07.26.14.03.25 for (Google Transport Security); Tue, 26 Jul 2022 14:03:25 -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:2722:b0:72b:735a:d3b4 with SMTP id d2-20020a170907272200b0072b735ad3b4mr15381214ejl.363.1658869404930; Tue, 26 Jul 2022 14:03:24 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.homenet.telecomitalia.it (host-87-14-98-67.retail.telecomitalia.it. [87.14.98.67]) by smtp.gmail.com with ESMTPSA id y19-20020aa7d513000000b0043a7293a03dsm9092849edq.7.2022.07.26.14.03.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Jul 2022 14:03:24 -0700 (PDT) From: Dario Binacchi To: linux-kernel@vger.kernel.org Cc: linux-can@vger.kernel.org, Marc Kleine-Budde , Oliver Hartkopp , michael@amarulasolutions.com, Amarula patchwork , Jeroen Hofstee , Vincent Mailhol , Dario Binacchi , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Wolfgang Grandegger , netdev@vger.kernel.org Subject: [RFC PATCH v3 1/9] can: slcan: use KBUILD_MODNAME and define pr_fmt to replace hardcoded names Date: Tue, 26 Jul 2022 23:02:09 +0200 Message-Id: <20220726210217.3368497-2-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220726210217.3368497-1-dario.binacchi@amarulasolutions.com> References: <20220726210217.3368497-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=VlEPTxUO; 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;