Thread (8 messages) 8 messages, 4 authors, 2021-02-09

Re: [PATCH] staging: fix ignoring return value warning

From: Dan Carpenter <hidden>
Date: 2021-02-09 08:07:51
Also in: linux-arm-kernel, lkml

On Tue, Feb 09, 2021 at 09:18:02AM +0800, Youling Tang wrote:
Hi, Dan


On 02/09/2021 03:02 AM, Dan Carpenter wrote:
quoted
On Mon, Feb 08, 2021 at 04:06:18PM +0100, Sascha Hauer wrote:
quoted
Hi Dan,

On Mon, Feb 08, 2021 at 04:45:17PM +0300, Dan Carpenter wrote:
quoted
On Sun, Feb 07, 2021 at 05:23:28PM +0800, Youling Tang wrote:
quoted
Fix the below ignoring return value warning for device_reset.

drivers/staging/mt7621-dma/mtk-hsdma.c:685:2: warning: ignoring return value
of function declared with 'warn_unused_result' attribute [-Wunused-result]
         device_reset(&pdev->dev);
         ^~~~~~~~~~~~ ~~~~~~~~~~
drivers/staging/ralink-gdma/ralink-gdma.c:836:2: warning: ignoring return value
of function declared with 'warn_unused_result' attribute [-Wunused-result]
         device_reset(&pdev->dev);
         ^~~~~~~~~~~~ ~~~~~~~~~~
We can't really do this sort of fix without the hardware to test it.
This could be the correct fix or perhaps switching to device_reset_optional()
is the correct fix.  We can't know unless we have the hardware to test.
When device_reset() is the wrong function then adding a return value
check will turn this into a runtime error for those who have the
hardware which will hopefully trigger them to tell us why reset_device
is wrong for them.
At least for a staging driver I find this procedure opportune.
That seems like sort of a jerk move...  What's the rush?  Someone will
eventually be able to test this if we just wait around for a bit.
Otherwise if no one has the hardware then eventually the driver will be
deleted.

regards,
dan carpenter
We do not have the relevant hardware to test, this is just to solve a
compile-time warning.
Yeah, I know.  Wait for someone who can test it on this.  Normally we
don't require testing for staging patches.  But in this case, it's
impossible to know which is the proper fix without testing so we should
wait.  It's rude to test by breaking people's systems and hope they
report the bug.

regards,
dan carpenter


_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help