From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B2B46C07E9C for ; Thu, 8 Jul 2021 17:59:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 926AE6187E for ; Thu, 8 Jul 2021 17:59:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229846AbhGHSCF (ORCPT ); Thu, 8 Jul 2021 14:02:05 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:46608 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229469AbhGHSCE (ORCPT ); Thu, 8 Jul 2021 14:02:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=XeccN3vO+kZBO9cGBrJoTHdPFyuWAmPfbzHVpOaC8fY=; b=tppSSr1NFt4b3TicbMLi3prqV7 Tn8oeifOWd4GI2qI54qN9Ho9tkVDidYizFDE8nee7HL63OcsHFl4F3kCb7GnxUWDp13QbVRQni+uG gBfsyDrdZ87ctOD/qIqPVI2Q8aE27YciBlSdJdyOfnw3jdfq1mp7FRwGDbaUs0CqCQpo=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1m1YIq-00CfWD-E0; Thu, 08 Jul 2021 19:59:12 +0200 Date: Thu, 8 Jul 2021 19:59:12 +0200 From: Andrew Lunn To: Carlos Bilbao Cc: davem@davemloft.net, Joe Perches , kuba@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org Subject: Re: [PATCH net-next v2] drivers: ethernet: tulip: Fix indentation of printk Message-ID: References: <1884900.usQuhbGJ8B@iron-maiden> <5183009.Sb9uPGUboI@iron-maiden> <4352381.cEBGB3zze1@iron-maiden> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4352381.cEBGB3zze1@iron-maiden> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 08, 2021 at 01:48:24PM -0400, Carlos Bilbao wrote: > Fix indentation of printk that starts at the beginning of the line and does > not have a KERN_. > > Signed-off-by: Carlos Bilbao > --- > drivers/net/ethernet/dec/tulip/de4x5.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/ethernet/dec/tulip/de4x5.c b/drivers/net/ethernet/dec/tulip/de4x5.c > index b125d7faefdf..0d8ddfdd5c09 100644 > --- a/drivers/net/ethernet/dec/tulip/de4x5.c > +++ b/drivers/net/ethernet/dec/tulip/de4x5.c > @@ -3169,7 +3169,7 @@ dc2114x_autoconf(struct net_device *dev) > > default: > lp->tcount++; > -printk("Huh?: media:%02x\n", lp->media); > + printk(KERN_NOTICE "Huh?: media:%02x\n", lp->media); > lp->media = INIT; > break; > } Since this is a network driver, and you have a net_device structure, the best practice is to use netdev_notice(dev, "Huh?: media:%02x\n", lp->media); You could go through this driver and change all printk() to netdev_dbg(), netdev_err(), netdev_info etc. The advantage of these calls is that they make it clear which network interface is outputting the message. Other subsystems have similar calls. If there are not subsystem specific print functions, but you have a struct device, it is best to use dev_err(), dev_dbg(), dev_info() etc. These functions will make it clear which device is printing the message. Andrew