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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 37212C7618E for ; Fri, 17 Mar 2023 13:37:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229826AbjCQNh2 (ORCPT ); Fri, 17 Mar 2023 09:37:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229904AbjCQNhZ (ORCPT ); Fri, 17 Mar 2023 09:37:25 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 877C1C2D8B for ; Fri, 17 Mar 2023 06:37:21 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 3D651B82586 for ; Fri, 17 Mar 2023 13:37:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 600D6C4339C; Fri, 17 Mar 2023 13:37:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1679060239; bh=YWIDLuEFnRBwfpxQtDoAidrvlww69eJAsTQKccqkZNQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=c7OwB4PmkZxRr85XcBZkS7xesvAoFtE+21ae1YpfA6yECiRs5ooSxph+4VEvCFFbf fTQN0tH4hMuDzK+7yV67K1JvIcKYfEQs8ndoocY4hb+uWl3yqi5Y9oRlTaCTj8n/Ky hjqkrmHfxZJi7R+lDxSIHhQRfRQ2qJ64qrfcbdpTXI4z86g5GG3jWyL1P/Dn6rigg2 ScoLvCGLyRkZJj2whKtOtxzRQT0TsBCGusONDoWO3+6dRgq0PTbwQC/RcBhwk8KapP Bfx933INbNwHJUs3Iw0sOHY2a93fuaYl35lRv7sNnwvRzZhFb3dca4Bgc2QsUoJOA1 Cp0VnFXdAt/pw== Date: Fri, 17 Mar 2023 19:07:15 +0530 From: Vinod Koul To: Pierre-Louis Bossart Cc: Bard Liao , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, bard.liao@intel.com Subject: Re: [PATCH] soundwire: stream: uniquify dev_err() logs Message-ID: References: <20230309054905.21507-1-yung-chuan.liao@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 15-03-23, 09:38, Pierre-Louis Bossart wrote: > > > 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. Thanks, that would be better way -- ~Vinod