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=-7.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no 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 31C4EC433E1 for ; Thu, 13 Aug 2020 15:07:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1B3C320791 for ; Thu, 13 Aug 2020 15:07:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726768AbgHMPHf (ORCPT ); Thu, 13 Aug 2020 11:07:35 -0400 Received: from smtprelay0077.hostedemail.com ([216.40.44.77]:33688 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726727AbgHMPHW (ORCPT ); Thu, 13 Aug 2020 11:07:22 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay04.hostedemail.com (Postfix) with ESMTP id 34F25180A9F42; Thu, 13 Aug 2020 15:07:21 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-HE-Tag: chin73_140509f26ff5 X-Filterd-Recvd-Size: 3240 Received: from XPS-9350.home (unknown [47.151.133.149]) (Authenticated sender: joe@perches.com) by omf08.hostedemail.com (Postfix) with ESMTPA; Thu, 13 Aug 2020 15:07:19 +0000 (UTC) Message-ID: <6c0b063837a3a549389275c44e9512a1ffc36717.camel@perches.com> Subject: Re: [PATCH 35/44] staging: regulator: hi6421v600-regulator: add a driver-specific debug macro From: Joe Perches To: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Greg Kroah-Hartman , linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org Date: Thu, 13 Aug 2020 08:07:17 -0700 In-Reply-To: <20200813121036.126c4797@coco.lan> References: <7cb10b3910e9fa3e52d36e4e416030175cc761ab.1597247164.git.mchehab+huawei@kernel.org> <6a424468eb61e2eb9b014817819dd4da61f2ada1.camel@perches.com> <20200813121036.126c4797@coco.lan> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.36.4-0ubuntu1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2020-08-13 at 12:10 +0200, Mauro Carvalho Chehab wrote: > Em Wed, 12 Aug 2020 09:10:29 -0700 > Joe Perches escreveu: > > > On Wed, 2020-08-12 at 17:56 +0200, Mauro Carvalho Chehab wrote: > > > Using dev_dbg() is not too nice, as, instead of printing the > > > name of the regulator, it prints "regulator.", making > > > harder to associate what is happening with each ldo line. > > > > > > So, add a debug-specific macro, which will print the rdev's > > > name, just like the regulator core. > > > > Seems sensible, but trivially: > > > > > diff --git a/drivers/staging/hikey9xx/hi6421v600-regulator.c b/drivers/staging/hikey9xx/hi6421v600-regulator.c > > [] > > > @@ -209,10 +212,10 @@ static unsigned int hi6421_spmi_regulator_get_optimum_mode(struct regulator_dev > > > struct hi6421v600_regulator *sreg = rdev_get_drvdata(rdev); > > > > > > if (load_uA || ((unsigned int)load_uA > sreg->eco_uA)) { > > > - dev_dbg(&rdev->dev, "%s: normal mode", __func__); > > > + rdev_dbg(rdev, "normal mode"); > > > return REGULATOR_MODE_NORMAL; > > > } else { > > > - dev_dbg(&rdev->dev, "%s: idle mode", __func__); > > > + rdev_dbg(rdev, "idle mode"); > > > > missing terminating newlines > > As per request from Jonathan, I ended dropping those rdev_dbg() > on a followup patch. > > Btw, after this changeset: > > commit 563873318d328d9bbab4b00dfd835ac7c7e28697 > Merge: 24532f768121 bfd8d3f23b51 > Author: Linus Torvalds > Date: Mon Oct 10 09:29:50 2016 -0700 > > Merge branch 'printk-cleanups' > > Merge my system logging cleanups, triggered by the broken '\n' patches. > > the printk lib will add a line feed if a "\n" is missing. I had > to get rid of pr_cont() & friends on that time on media, due to that. I know. Message formats should still end in a newline. Any other subsystem could use a pr_cont and that could be added to any line without a terminating newline. Also any line without a newline will not be emitted until another message is emitted. 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=-7.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no 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 3D647C433E1 for ; Thu, 13 Aug 2020 15:07:25 +0000 (UTC) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 12BE420791 for ; Thu, 13 Aug 2020 15:07:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 12BE420791 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=perches.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=driverdev-devel-bounces@linuxdriverproject.org Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id E422A86DEF; Thu, 13 Aug 2020 15:07:24 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id o_Hs4BWqikTa; Thu, 13 Aug 2020 15:07:24 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 3B86186E24; Thu, 13 Aug 2020 15:07:24 +0000 (UTC) Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id B11201BF333 for ; Thu, 13 Aug 2020 15:07:23 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id AD3FB23115 for ; Thu, 13 Aug 2020 15:07:23 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KL3pnCuz+VId for ; Thu, 13 Aug 2020 15:07:22 +0000 (UTC) X-Greylist: delayed 22:45:23 by SQLgrey-1.7.6 Received: from smtprelay.hostedemail.com (smtprelay0212.hostedemail.com [216.40.44.212]) by silver.osuosl.org (Postfix) with ESMTPS id 6B7B722794 for ; Thu, 13 Aug 2020 15:07:22 +0000 (UTC) Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay04.hostedemail.com (Postfix) with ESMTP id 34F25180A9F42; Thu, 13 Aug 2020 15:07:21 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-HE-Tag: chin73_140509f26ff5 X-Filterd-Recvd-Size: 3240 Received: from XPS-9350.home (unknown [47.151.133.149]) (Authenticated sender: joe@perches.com) by omf08.hostedemail.com (Postfix) with ESMTPA; Thu, 13 Aug 2020 15:07:19 +0000 (UTC) Message-ID: <6c0b063837a3a549389275c44e9512a1ffc36717.camel@perches.com> Subject: Re: [PATCH 35/44] staging: regulator: hi6421v600-regulator: add a driver-specific debug macro From: Joe Perches To: Mauro Carvalho Chehab Date: Thu, 13 Aug 2020 08:07:17 -0700 In-Reply-To: <20200813121036.126c4797@coco.lan> References: <7cb10b3910e9fa3e52d36e4e416030175cc761ab.1597247164.git.mchehab+huawei@kernel.org> <6a424468eb61e2eb9b014817819dd4da61f2ada1.camel@perches.com> <20200813121036.126c4797@coco.lan> User-Agent: Evolution 3.36.4-0ubuntu1 MIME-Version: 1.0 X-BeenThere: driverdev-devel@linuxdriverproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Driver Project Developer List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mauro.chehab@huawei.com, Greg Kroah-Hartman , devel@driverdev.osuosl.org, linuxarm@huawei.com, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: driverdev-devel-bounces@linuxdriverproject.org Sender: "devel" On Thu, 2020-08-13 at 12:10 +0200, Mauro Carvalho Chehab wrote: > Em Wed, 12 Aug 2020 09:10:29 -0700 > Joe Perches escreveu: > > > On Wed, 2020-08-12 at 17:56 +0200, Mauro Carvalho Chehab wrote: > > > Using dev_dbg() is not too nice, as, instead of printing the > > > name of the regulator, it prints "regulator.", making > > > harder to associate what is happening with each ldo line. > > > > > > So, add a debug-specific macro, which will print the rdev's > > > name, just like the regulator core. > > > > Seems sensible, but trivially: > > > > > diff --git a/drivers/staging/hikey9xx/hi6421v600-regulator.c b/drivers/staging/hikey9xx/hi6421v600-regulator.c > > [] > > > @@ -209,10 +212,10 @@ static unsigned int hi6421_spmi_regulator_get_optimum_mode(struct regulator_dev > > > struct hi6421v600_regulator *sreg = rdev_get_drvdata(rdev); > > > > > > if (load_uA || ((unsigned int)load_uA > sreg->eco_uA)) { > > > - dev_dbg(&rdev->dev, "%s: normal mode", __func__); > > > + rdev_dbg(rdev, "normal mode"); > > > return REGULATOR_MODE_NORMAL; > > > } else { > > > - dev_dbg(&rdev->dev, "%s: idle mode", __func__); > > > + rdev_dbg(rdev, "idle mode"); > > > > missing terminating newlines > > As per request from Jonathan, I ended dropping those rdev_dbg() > on a followup patch. > > Btw, after this changeset: > > commit 563873318d328d9bbab4b00dfd835ac7c7e28697 > Merge: 24532f768121 bfd8d3f23b51 > Author: Linus Torvalds > Date: Mon Oct 10 09:29:50 2016 -0700 > > Merge branch 'printk-cleanups' > > Merge my system logging cleanups, triggered by the broken '\n' patches. > > the printk lib will add a line feed if a "\n" is missing. I had > to get rid of pr_cont() & friends on that time on media, due to that. I know. Message formats should still end in a newline. Any other subsystem could use a pr_cont and that could be added to any line without a terminating newline. Also any line without a newline will not be emitted until another message is emitted. _______________________________________________ devel mailing list devel@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel