The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Brett Creeley <bcreeley@amd.com>
To: Dave Jiang <dave.jiang@intel.com>,
	Liao Yuanhong <liaoyuanhong@vivo.com>,
	Brett Creeley <brett.creeley@amd.com>,
	Jason Gunthorpe <jgg@ziepe.ca>,
	Saeed Mahameed <saeedm@nvidia.com>,
	Jonathan Cameron <Jonathan.Cameron@huawei.com>,
	"open list:FWCTL PDS DRIVER" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] pds_fwctl: Remove the use of dev_err_probe()
Date: Wed, 20 Aug 2025 09:27:37 -0700	[thread overview]
Message-ID: <3c22983c-6aa7-44ef-a368-17ff9d96fb9a@amd.com> (raw)
In-Reply-To: <7350db53-d5e6-4b3e-8686-3749353725a0@intel.com>



On 8/20/2025 8:03 AM, Dave Jiang wrote:
> Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
> 
> 
> On 8/20/25 5:40 AM, Liao Yuanhong wrote:
>> Logging messages that show some type of "out of memory" error are generally
>> unnecessary as there is a generic message and a stack dump done by the
>> memory subsystem. These messages generally increase kernel size without
>> much added value[1].
>>
>> The dev_err_probe() doesn't do anything when error is '-ENOMEM'. Therefore,
>> remove the useless call to dev_err_probe(), and just return the value
>> instead.
>>
>> [1]: https://lore.kernel.org/lkml/1402419340.30479.18.camel@joe-AO725/
>>
>> Signed-off-by: Liao Yuanhong <liaoyuanhong@vivo.com>
> 
> Reviewed-by: Dave Jiang <dave.jiang@intel.com>
>> ---
>>   drivers/fwctl/pds/main.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/fwctl/pds/main.c b/drivers/fwctl/pds/main.c
>> index 9b9d1f6b5556..8dd659aee256 100644
>> --- a/drivers/fwctl/pds/main.c
>> +++ b/drivers/fwctl/pds/main.c
>> @@ -481,7 +481,7 @@ static int pdsfc_probe(struct auxiliary_device *adev,
>>        pdsfc = fwctl_alloc_device(&padev->vf_pdev->dev, &pdsfc_ops,
>>                                   struct pdsfc_dev, fwctl);
>>        if (!pdsfc)
>> -             return dev_err_probe(dev, -ENOMEM, "Failed to allocate fwctl device struct\n");
>> +             return -ENOMEM;

With dev_err_probe() ignoring -ENOMEM, this is a no-op, so this change 
makes sense.

In general we like to have messages like this so the failure path is 
immediately obvious.

However, in this case it is unnecessary because there are specific 
errors in all of the other possible probe failures.

Thanks for the patch.

Reviewed-by: Brett Creeley <brett.creeley@amd.com>

>>        pdsfc->padev = padev;
>>
>>        err = pdsfc_identify(pdsfc);
> 

  reply	other threads:[~2025-08-20 16:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-20 12:40 [PATCH] pds_fwctl: Remove the use of dev_err_probe() Liao Yuanhong
2025-08-20 13:48 ` Jonathan Cameron
2025-08-20 15:03 ` Dave Jiang
2025-08-20 16:27   ` Brett Creeley [this message]
2025-08-22 13:15 ` Jason Gunthorpe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3c22983c-6aa7-44ef-a368-17ff9d96fb9a@amd.com \
    --to=bcreeley@amd.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=brett.creeley@amd.com \
    --cc=dave.jiang@intel.com \
    --cc=jgg@ziepe.ca \
    --cc=liaoyuanhong@vivo.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=saeedm@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox