Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp160557pxy; Thu, 6 May 2021 23:43:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyi1XwdyB50SYKK/BnXfKsfZBGBgPp4dkSeeMRoIemsJ3WNDN+bYLcbPxayDS56sv5gCGhp X-Received: by 2002:a17:906:1185:: with SMTP id n5mr8588238eja.468.1620369791219; Thu, 06 May 2021 23:43:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620369791; cv=none; d=google.com; s=arc-20160816; b=vkTYXtuEqUCP4DmprTXaE9AWe0xHSfl1iteCnGe8GeEvZwL8NjUGRVV4B4KKBrG9dc E2kyPJhDmDFFuDJSHKZyPlIrgGFlpSKCF880trY7saT5qN53X9S9Rof2lrw5uWSyfLv8 yajZ8PC/XzuG+3dgkrKdYNoH6hB/BkM7fvVxfLfRrWbYOd7nroz6SpGK+h4Qm0kIEKKj wuS4w9naG49+kZtDBCnZO8+YONqCMg+6zJktyeSF73GOd6DTf53/ZIU8OUsjFUiI6aJ+ fxhxp6sR0F3lxzThoSL5X4lRW7f3/RgzIaaH5ex8vvYG8fd65CHqMJMQcaY9/tT0e2oK 40Yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=k0LVFzV0sxy54hDbmK45koQCGCOz3GJsLLf92nNUmfI=; b=ZAWl6Q3l0FJ5gDl2gYgp8aGWNkkQe0qrx4BR6l7zS1m2wKw8A5xjrxya7gGnXXUGDU SX/UsfWkODGCuaHMiiJ/oO81PfJENdAS76AqWXxEp61TIFdT+ZLycB8e2B2D/QnFeJlB 79/+b38AaISfFUlcA84fSnLq20PqMOeF7ulaSzhU/D0zdAvXknBRABosxPh50Ye7vBcO u3R2qIblaSAZel6xl2sClxRwHrd5RuDwE/6KYSx2WXz5qzUMhvqIsijYPSTK8PNJv6fH /m/eaFvig56+jitqef3F3n/XOLxzj8C8/QT1MEW6wPmRW0wkAnIXtLHhIo8w8V2WA2cK v/RQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b9si4227124edx.429.2021.05.06.23.42.47; Thu, 06 May 2021 23:43:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234413AbhEGF7l (ORCPT + 99 others); Fri, 7 May 2021 01:59:41 -0400 Received: from smtp07.smtpout.orange.fr ([80.12.242.129]:59039 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233932AbhEGF7l (ORCPT ); Fri, 7 May 2021 01:59:41 -0400 Received: from [192.168.1.18] ([86.243.172.93]) by mwinf5d87 with ME id 1hyf2500C21Fzsu03hyfC9; Fri, 07 May 2021 07:58:40 +0200 X-ME-Helo: [192.168.1.18] X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Fri, 07 May 2021 07:58:40 +0200 X-ME-IP: 86.243.172.93 Subject: Re: [PATCH] remoteproc: k3-r5: Fix an error message To: Dan Carpenter Cc: ohad@wizery.com, bjorn.andersson@linaro.org, mathieu.poirier@linaro.org, s-anna@ti.com, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org References: <20210507052647.GF1955@kadam> From: Christophe JAILLET Message-ID: <5cdff9cf-945a-fe47-b117-3c9d9f11e987@wanadoo.fr> Date: Fri, 7 May 2021 07:58:39 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <20210507052647.GF1955@kadam> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 07/05/2021 à 07:26, Dan Carpenter a écrit : > On Thu, May 06, 2021 at 10:46:01PM +0200, Christophe JAILLET wrote: >> 'ret' is known to be 0 here. >> Reorder the code so that the expected error code is printed. >> >> Fixes: 6dedbd1d5443 ("remoteproc: k3-r5: Add a remoteproc driver for R5F subsystem") >> Signed-off-by: Christophe JAILLET >> --- >> drivers/remoteproc/ti_k3_r5_remoteproc.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/remoteproc/ti_k3_r5_remoteproc.c b/drivers/remoteproc/ti_k3_r5_remoteproc.c >> index 5cf8d030a1f0..4104e4846dbf 100644 >> --- a/drivers/remoteproc/ti_k3_r5_remoteproc.c >> +++ b/drivers/remoteproc/ti_k3_r5_remoteproc.c >> @@ -1272,9 +1272,9 @@ static int k3_r5_core_of_init(struct platform_device *pdev) >> >> core->tsp = k3_r5_core_of_get_tsp(dev, core->ti_sci); >> if (IS_ERR(core->tsp)) { >> + ret = PTR_ERR(core->tsp); >> dev_err(dev, "failed to construct ti-sci proc control, ret = %d\n", >> ret); > > I recently learned about the %pe format specifier, which prints "-ENOMEM" > instead of -12. Hi Dan, I see that we are reading the same ML :) Well, I'm a bit puzzled by it. On one hand, it is more user-friendly. On the other hand it is not widely used up to now. So is it better to keep the legacy way of reporting error code? Do you know if there is preferred way? Using it after a IS_ERR is straightforward, but should we also do things like (kmalloc usually don't need error message, just given as an example): x = kmalloc(...); if (!x) dev_err(dev, "Memory allocation failure (%pe)\n", ERR_PTR(-ENOMEM)); When changing a message and make use of %pe, should all the messages in the neighborhood be changed as well to keep some kind of consistancy? CJ > > dev_err(dev, "failed to construct ti-sci proc control, ret = %pe\n", > core->tsp); > regards, > dan carpenter > > >