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 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4CD11C61DA4 for ; Wed, 15 Mar 2023 14:40:04 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 86B771267; Wed, 15 Mar 2023 15:39:12 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 86B771267 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1678891202; bh=rNfYVw1Y+3DpMigD974Ti51cxEjaa+Bxwr0aNjinN1I=; h=Date:Subject:To:References:From:In-Reply-To:CC:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=azTTcsINSqJJYLZDheqU2HdOi3mDcYRhWrHHM0lbvKgW1JUBtvqsUFpAjmfpeePsA TJzPMCD+0j0h39vjjDeD12yAtuSY2S0ONV/sGOcxK4SEJOMQf11Nh2umhAkCQTUlld ATgqsUZfMz7sa9Q1/2iCp4O2O6e/0Wxcm6EpTEU4= Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 119BFF80423; Wed, 15 Mar 2023 15:38:51 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 7228DF80423; Wed, 15 Mar 2023 15:38:47 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 433E2F800C9 for ; Wed, 15 Mar 2023 15:38:43 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 433E2F800C9 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=n4wn1Lmv DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1678891125; x=1710427125; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=rNfYVw1Y+3DpMigD974Ti51cxEjaa+Bxwr0aNjinN1I=; b=n4wn1LmvYFMLu3m5e+d0hIDwH3apQiNq1bXlozIlvwndoZLOgAddH+t4 +VcRqvxFInXRMY555EUkWBF9llSUleW0ku3KT0AX7/yBQNOUEewywT4WM 171ApcUn91d1YJokVWb9Fstb/RtnXUbWhOwnfpJGXLKCDojcX0JNRLgN0 S/oiq08utp11YtGGLoshvzejZ2AUpKgvOmUeNc6e2DIEYguqcObdLrAN8 +R8/b2RXJBMg2MRmrrMWv1BMf+h/ZPcuHhRXiE8uE5mpPpRWJpFtiaViW QHeBNZYUO1flh0D7orwkNp6e3HCQZT0pwPGHbGzbGrf/mIjFY27Fj6gU9 A==; X-IronPort-AV: E=McAfee;i="6500,9779,10649"; a="423990090" X-IronPort-AV: E=Sophos;i="5.98,262,1673942400"; d="scan'208";a="423990090" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Mar 2023 07:38:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10649"; a="681872352" X-IronPort-AV: E=Sophos;i="5.98,262,1673942400"; d="scan'208";a="681872352" Received: from rperez12-mobl.amr.corp.intel.com (HELO [10.255.35.81]) ([10.255.35.81]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Mar 2023 07:38:41 -0700 Message-ID: Date: Wed, 15 Mar 2023 09:38:40 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Firefox/102.0 Thunderbird/102.8.0 Subject: Re: [PATCH] soundwire: stream: uniquify dev_err() logs Content-Language: en-US To: Vinod Koul , Bard Liao References: <20230309054905.21507-1-yung-chuan.liao@linux.intel.com> From: Pierre-Louis Bossart In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Message-ID-Hash: TKG46JE43FPX72FJ4IDLKPTHL4BZG5ZR X-Message-ID-Hash: TKG46JE43FPX72FJ4IDLKPTHL4BZG5ZR X-MailFrom: pierre-louis.bossart@linux.intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, bard.liao@intel.com X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On 3/15/23 05:09, Vinod Koul wrote: > On 09-03-23, 13:49, Bard Liao wrote: >> From: Pierre-Louis Bossart >> >> There are a couple of duplicate logs which makes harder than needed to >> follow the error flows. Add __func__ or make the log unique. >> >> Signed-off-by: Pierre-Louis Bossart >> Reviewed-by: Ranjani Sridharan >> Signed-off-by: Bard Liao >> --- >> drivers/soundwire/stream.c | 18 ++++++++++-------- >> 1 file changed, 10 insertions(+), 8 deletions(-) >> >> diff --git a/drivers/soundwire/stream.c b/drivers/soundwire/stream.c >> index 2e39587ed1de..dd09855caac9 100644 >> --- a/drivers/soundwire/stream.c >> +++ b/drivers/soundwire/stream.c >> @@ -1389,7 +1389,7 @@ static int _sdw_prepare_stream(struct sdw_stream_runtime *stream, >> >> ret = do_bank_switch(stream); >> if (ret < 0) { >> - dev_err(bus->dev, "Bank switch failed: %d\n", ret); >> + pr_err("%s: do_bank_switch failed: %d\n", __func__, ret); > > why make it pr_ and loose the dev name? There is a trick to emit > function for dev_err too using dynamic debug a stream can be cased on multiple managers/buses. It's incorrect to use bus->dev in this case, see all other error cases in stream.c, they all use pr_err already for the same reason. bus->dev is only valid when dealing with a single bus, typically in loops in that file. That said we could have split the two changes where dev_err() is changed as pr_err() for clarity.