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 5170CC3DA78 for ; Fri, 13 Jan 2023 17:49:22 +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 56C13AC1E; Fri, 13 Jan 2023 18:48:30 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 56C13AC1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1673632160; bh=vXZYegqr0r8VoEKtaFQ41Pd2O25X43DEDShZ7ZuY//c=; h=Date:Subject:To:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=IbW1rnaYUFN2Q0pvI3C/cH6x698LheJ3rfnoeMo8yX04a5ec/yIniex8VshIF7dyQ tLqBoPeaurulGiaTFclAa0meMksul0wjMb7fkUXqux3oQ76Eui/9RWo34/XGV3e9bB 9+V+t2pX1au8qVv02LYb2rwbTnzOYq/Z7+6si6yk= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 10120F802E8; Fri, 13 Jan 2023 18:48:30 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 255D1F8030F; Fri, 13 Jan 2023 18:48:28 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (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 B8E91F8016D for ; Fri, 13 Jan 2023 18:48:22 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz B8E91F8016D 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=BFbHakLz DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1673632103; x=1705168103; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=vXZYegqr0r8VoEKtaFQ41Pd2O25X43DEDShZ7ZuY//c=; b=BFbHakLzWoZ5FohimrRkuIYvu6v19tCEM8v/zn5GPocFNjicJYR3x2FP nnFCXpE6GPuluFwPVqQkbdSTZbRBFdUFw3nbPwWoM10lCQwhlIzRQkr8j B5tgkJCKwf8LbQEWYnDLeBFftAtAtGU1a0j/Riclc72mbY3qq/iSRKQap bHY2NY/qIe5awbIjdUSQ0yhuKwV9zBJWo/3F4CWfiYxJxvCuCBjGoW4yK iZ8TC3lOYwNKEUnq0RUqbaqe4QBiCkzeT7FGTr6N4TNjVUfuS3ZHOJAMu Nv6oxE82+oKDy+zDCHnONbmLSyV3SUwdmfQRxd5md1cT08s5sp5xz44+6 Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10589"; a="326111270" X-IronPort-AV: E=Sophos;i="5.97,214,1669104000"; d="scan'208";a="326111270" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jan 2023 09:48:13 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10589"; a="635854356" X-IronPort-AV: E=Sophos;i="5.97,214,1669104000"; d="scan'208";a="635854356" Received: from rerayess-mobl.amr.corp.intel.com (HELO [10.212.13.223]) ([10.212.13.223]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jan 2023 09:48:12 -0800 Message-ID: <202c4f36-77b0-44a2-a77d-b989040dafc6@linux.intel.com> Date: Fri, 13 Jan 2023 11:48:12 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Firefox/102.0 Thunderbird/102.4.2 Subject: Re: [PATCH 1/5] soundwire: stream: uniquify dev_err() logs Content-Language: en-US To: =?UTF-8?Q?Amadeusz_S=c5=82awi=c5=84ski?= , Bard Liao , alsa-devel@alsa-project.org, vkoul@kernel.org References: <20230113093532.3872113-1-yung-chuan.liao@linux.intel.com> <20230113093532.3872113-2-yung-chuan.liao@linux.intel.com> From: Pierre-Louis Bossart In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: vinod.koul@linaro.org, bard.liao@intel.com, linux-kernel@vger.kernel.org Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On 1/13/23 04:22, Amadeusz Sławiński wrote: > On 1/13/2023 10:35 AM, 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 | 14 ++++++++------ >>   1 file changed, 8 insertions(+), 6 deletions(-) >> >> diff --git a/drivers/soundwire/stream.c b/drivers/soundwire/stream.c >> index df3b36670df4..e0eae0b98267 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); >> +        dev_err(bus->dev, "do_bank_switch failed: %d\n", ret); >>           goto restore_params; >>       } > > This one seems bit unrelated to the change and makes error message > inconsistent with: > https://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire.git/tree/drivers/soundwire/stream.c?h=next&id=545c365185a47672b1d5cc13c84057a1e874993c#n1498 > and > https://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire.git/tree/drivers/soundwire/stream.c?h=next&id=545c365185a47672b1d5cc13c84057a1e874993c#n1575 > which actually brings me to another suggestion, can this error message > perhaps be just moved into do_bank_switch() function itself, instead of > being duplicated multiple times or alternatively just also prefix all of > them with function name? well, as you correctly pointed out, there are multiple users of 'do_bank_switch' so we don't want to put the message in the function itself. We could indeed use __func__ instead, that'd be fine. Looking at the code, there are also inconsistencies with the use of pr_err and dev_err. dev_err(bus->dev is wrong actually, this would use the bus variable assigned in the previous loop, this makes no sense for multi-segment topologies. Let's drop this patch and revisit all this, hope Vinod can deal with patch 1..4 otherwise we'll resend the set. Thanks Amadeusz for the feedback.