All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mailbox: arm_mhuv3: Remove dev_err_probe() if error is -ENOMEM
@ 2025-08-21  9:32 Xichao Zhao
  2025-08-21  9:53 ` Sudeep Holla
  0 siblings, 1 reply; 3+ messages in thread
From: Xichao Zhao @ 2025-08-21  9:32 UTC (permalink / raw)
  To: sudeep.holla, cristian.marussi, jassisinghbrar; +Cc: linux-kernel, Xichao Zhao

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.

Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>
---
 drivers/mailbox/arm_mhuv3.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/mailbox/arm_mhuv3.c b/drivers/mailbox/arm_mhuv3.c
index b97e79a5870f..cae1f9bea050 100644
--- a/drivers/mailbox/arm_mhuv3.c
+++ b/drivers/mailbox/arm_mhuv3.c
@@ -775,8 +775,7 @@ static int mhuv3_initialize_channels(struct device *dev, struct mhuv3 *mhu)
 	mbox->chans = devm_kcalloc(dev, mhu->num_chans,
 				   sizeof(*mbox->chans), GFP_KERNEL);
 	if (!mbox->chans)
-		return dev_err_probe(dev, -ENOMEM,
-				     "Failed to initialize channels\n");
+		return -ENOMEM;
 
 	for (i = 0; i < NUM_EXT && !ret; i++)
 		if (mhu->ext[i])
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] mailbox: arm_mhuv3: Remove dev_err_probe() if error is -ENOMEM
  2025-08-21  9:32 [PATCH] mailbox: arm_mhuv3: Remove dev_err_probe() if error is -ENOMEM Xichao Zhao
@ 2025-08-21  9:53 ` Sudeep Holla
  2025-08-21 10:00   ` Cristian Marussi
  0 siblings, 1 reply; 3+ messages in thread
From: Sudeep Holla @ 2025-08-21  9:53 UTC (permalink / raw)
  To: Xichao Zhao; +Cc: cristian.marussi, jassisinghbrar, Sudeep Holla, linux-kernel

On Thu, Aug 21, 2025 at 05:32:53PM +0800, Xichao Zhao wrote:
> 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.
> 

While I understand that it doesn't print the message for ENOMEM,

	grep dev_err_probe.*ENOMEM | wc -l

gave be 80 results, so not keen in just getting rid of one instance only.
No strong objection either if the subsystem maintainer prefers it this way.

-- 
Regards,
Sudeep

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mailbox: arm_mhuv3: Remove dev_err_probe() if error is -ENOMEM
  2025-08-21  9:53 ` Sudeep Holla
@ 2025-08-21 10:00   ` Cristian Marussi
  0 siblings, 0 replies; 3+ messages in thread
From: Cristian Marussi @ 2025-08-21 10:00 UTC (permalink / raw)
  To: Sudeep Holla; +Cc: Xichao Zhao, cristian.marussi, jassisinghbrar, linux-kernel

On Thu, Aug 21, 2025 at 10:53:18AM +0100, Sudeep Holla wrote:
> On Thu, Aug 21, 2025 at 05:32:53PM +0800, Xichao Zhao wrote:

Hi,

> > 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.
> > 
> 

Looking at dev_err_probe() comments...

/**
 * dev_err_probe - probe error check and log helper
 * @dev: the pointer to the struct device
 * @err: error value to test
 * @fmt: printf-style format string
 * @...: arguments as specified in the format string

[snip]

 * Using this helper in your probe function is totally fine even if @err        <<<<
 * is known to never be -EPROBE_DEFER.
 * The benefit compared to a normal dev_err() is the standardized format
 * of the error code, which is emitted symbolically (i.e. you get "EAGAIN"
 * instead of "-35"), and having the error code returned allows more
 * compact error paths.
 *
 * Returns @err.

I have not a strong opinion but it seems to me un-needed and potentially
impacting future backporting...IOW for me, as the mailbox maintaner prefers.

Thanks,
Cristian

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-08-21 10:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-21  9:32 [PATCH] mailbox: arm_mhuv3: Remove dev_err_probe() if error is -ENOMEM Xichao Zhao
2025-08-21  9:53 ` Sudeep Holla
2025-08-21 10:00   ` Cristian Marussi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.