Received: by 2002:a05:6500:1b41:b0:1fb:d597:ff75 with SMTP id cz1csp143056lqb; Tue, 4 Jun 2024 07:26:53 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVcVktlceBsMvDWjP0ALqEeDYzrKB9MmDrOeAfhoNYHADKUv4R82TFdW0rHtcXcEtOA8de24MEahPG6zCE1JuaLZmLTzh33Wm7Tca5ZWw== X-Google-Smtp-Source: AGHT+IFCIHWAsJQY1NW5YZu8YQZM4yxN2yVNNWgWVIRu8tEwBgcbNkTTARjgOCYWzWP2SGk97JiM X-Received: by 2002:a05:6a21:3997:b0:1b2:b1a7:483c with SMTP id adf61e73a8af0-1b2b1a748abmr1140596637.49.1717511213108; Tue, 04 Jun 2024 07:26:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717511213; cv=pass; d=google.com; s=arc-20160816; b=qGGxwlmYeTqUuQcwO3jEiYzLyZj3Me8vurMkMgebC5GHF4KKWKx/jzUJVrhMi8eq9Z cPcipfHbqa9BK/RuXs9DluD71op0pCXtkPwq3A5iY36RdG5futk3tMrjk41T7Opw4Gcn Zqg+d+eBF6lekimqtIdC3fFgOEPBa+Tg/izQNu7RsTnBH2T76Zq84Xfj5pyvQesFtnpD BhSKhi9XoPi8GDCWqIOt2rfSCkh1SdGmp+De8CwmxcGzRHXIEqwSqkINSYLe3rDUbmVM tUrxkyahoieLsqnC1lOVHumZxJ5MY0AsP/lIAPG8ZP9bGi3zpQAiwSXF632pvgFkjrNe JwBw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Vc+KRLbzMZaHaok77Oh3e4BX2dXMPhEUeq+nMoVPFlM=; fh=9Tq3js8l5otY/o2UYgOadyh2DmfaCCn0F7cDDkynZJA=; b=YKONqTDnLrnRgZtWE8Jhv8/theDavfRFE5I6abD7+HLDl/mEwOX/ZqGHqrRZG+LO0r ECaQDlnUN3gOlccSQgefqcQSjVVSJmz2Na4PrTwlUb/yDZ2NyZYL00CTKqXF1XgsM4ZT 31mD6aSEcCScVradz++ZIs6K3yU7ZvlkL5uztp7+bs/nx26zbYHFKMFG/AYpFP0cHvNz aNJL/yYV4qjbA4/v2foocW6iaRipzqglv/GA3BgOAQXy9uCOAALn3kd9kevTlL6rYJFO T6dI/KWXphC/tcBSa4O89U7grqVzHvEZfLEFgerWqLIN2O88MSn4p2MjPAK0Cyu+G+rH Q1SQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=X9lQ2NZv; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-200798-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-200798-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2c1fb4508b6si6580957a91.136.2024.06.04.07.26.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 07:26:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-200798-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=X9lQ2NZv; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-200798-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-200798-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id F1B40286476 for ; Tue, 4 Jun 2024 14:19:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4F69E5A0F5; Tue, 4 Jun 2024 14:19:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="X9lQ2NZv" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 776B81EB26 for ; Tue, 4 Jun 2024 14:19:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717510740; cv=none; b=Ssft5asEKpc92DZ1zLXzCuJvf7mC2MeqDkUP27AfCB1dfPExBM4HJE8Oqql8GordRhg7iy01MVQc84CeuRs2w5xBm0367tQqqQwQRz9QIANsOETXE44Mq8f2jaZ1zemqU3Gz+m8UKiMFddfKjhm2iXcHPzCjVJd3rSpd7hEKTtU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717510740; c=relaxed/simple; bh=Ldo8Rxw3b/CMs8cXyF5xLOYbN3yefyXw5+4N7TYJbfc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=T8cuQ8GcS+j6maaqq+/pT2rOyX3M6vepOsizhBKgPuXrhPaQW6IgsvH2XnBKncNy9pAIqzSizY2TF0Uzd+5rSRdUreycAUHMosmzu3Tmo93OlCsQQauxjLL3wunT4TzRZv3iiUnfPuixc7r4dZejwHwavzcnqq8sqWBaSwncXaY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=X9lQ2NZv; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 166C7C2BBFC; Tue, 4 Jun 2024 14:19:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717510740; bh=Ldo8Rxw3b/CMs8cXyF5xLOYbN3yefyXw5+4N7TYJbfc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=X9lQ2NZvSiAyqnvz6+FAHzAA9+SGGSX849IKWndqIhJ/k6JMZHLMK7A/6Sb5oRNFO IzBJRP8s1BjhX0LYLmmFhgU34jw6Zb31Oh37nJt6iV/2A1xz0kWtqMYz7DbYU/qgnK 8NUBytOtBMqm2SYHcB+qqsjqndBvkUpDKv9WulLNm9hMWK/5N5WAcc0AZQ1ZliEzyu 9A8A0G22fwr0iJUaLitX2ib+Wqr9OmyL+vAaiipOv9bWoyxaWDzE6DVNJPMgVChkRz 7osTqt3Dev6fRmI8Pc3PDbJgIpGa2CzKzAO0GaYTEtDEW7wXjYNc45vDod41RlfUto hlTY16X33DSBA== Received: from johan by xi.lan with local (Exim 4.97.1) (envelope-from ) id 1sEV06-000000002X3-1SkF; Tue, 04 Jun 2024 16:18:59 +0200 Date: Tue, 4 Jun 2024 16:18:58 +0200 From: Johan Hovold To: Pierre-Louis Bossart Cc: Johan Hovold , Vinod Koul , Bard Liao , Sanyog Kale , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 3/4] soundwire: bus: clean up probe warnings Message-ID: References: <20240604075213.20815-1-johan+linaro@kernel.org> <20240604075213.20815-4-johan+linaro@kernel.org> <8dd7cadc-138c-4ef5-b06f-7177550b1215@linux.intel.com> <970501b1-09ae-4f2c-a078-2b4f23fe460e@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <970501b1-09ae-4f2c-a078-2b4f23fe460e@linux.intel.com> On Tue, Jun 04, 2024 at 03:43:46PM +0200, Pierre-Louis Bossart wrote: > On 6/4/24 11:17, Johan Hovold wrote: > > On Tue, Jun 04, 2024 at 10:33:02AM +0200, Pierre-Louis Bossart wrote: > >> On 6/4/24 02:52, Johan Hovold wrote: > >>> Clean up the probe warning messages by using a common succinct format > >>> (e.g. without __func__ and with a space after ':'). > > > >>> @@ -123,7 +123,7 @@ static int sdw_drv_probe(struct device *dev) > >>> /* init the dynamic sysfs attributes we need */ > >>> ret = sdw_slave_sysfs_dpn_init(slave); > >>> if (ret < 0) > >>> - dev_warn(dev, "Slave sysfs init failed:%d\n", ret); > >>> + dev_warn(dev, "failed to initialise sysfs: %d\n", ret); > >>> > >>> /* > >>> * Check for valid clk_stop_timeout, use DisCo worst case value of > >>> @@ -147,7 +147,7 @@ static int sdw_drv_probe(struct device *dev) > >>> if (drv->ops && drv->ops->update_status) { > >>> ret = drv->ops->update_status(slave, slave->status); > >>> if (ret < 0) > >>> - dev_warn(dev, "%s: update_status failed with status %d\n", __func__, ret); > >>> + dev_warn(dev, "failed to update status: %d\n", ret); > >> > >> the __func__ does help IMHO, 'failed to update status' is way too general... > > > > Error messages printed with dev_warn will include the device and driver > > names so this message will be quite specific still. > > The goal isn't to be 'quite specific' but rather 'completely > straightforward'. Everyone can lookup a function name in a xref tool and > quickly find out what happened. Doing 'git grep' on message logs isn't > great really, and over time logs tend to be copy-pasted. Just look at > the number of patches where we had to revisit the dev_err logs to make > then really unique/useful. Error message should be self-contained and give user's some idea of what went wrong and not leak implementation details like function names (and be greppable, which "%s:" is not). > >> Replacing 'with status' by ":" is fine, but do we really care about 10 > >> chars in a log? > > > > It's not primarily about the numbers of characters but about consistency. > > I am advocating for inclusion of __func__ everywhere...It's simpler for > remote support and bug chasing. A quick grep seems to suggest you're in a small minority here with some 5k of 65k dev_err() including __func__. [ And there's only 55 out of 750 dev_err() like that in drivers/soundwire, which is inconsistent at best. ] Johan