diff mbox

[2/2] soundwire: Testing the wrong variable

Message ID 20180109093744.egp4vynjgghidp6i@mwanda (mailing list archive)
State New, archived
Headers show

Commit Message

Dan Carpenter Jan. 9, 2018, 9:37 a.m. UTC
We should be using "status2" here instead of "status".

Fixes: b0a9c37b0178 ("soundwire: Add slave status handling")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Comments

Vinod Koul Jan. 10, 2018, 10:55 a.m. UTC | #1
On Tue, Jan 09, 2018 at 12:37:44PM +0300, Dan Carpenter wrote:
> We should be using "status2" here instead of "status".

This is already fixed by commit:

Author: Wei Yongjun <weiyongjun1@huawei.com>
Date:   Mon Jan 8 22:22:44 2018 +0530

    soundwire: Fix typo in return value check of sdw_read()

    Fix the typo, 'status' should be instead of 'status2'.


> 
> Fixes: b0a9c37b0178 ("soundwire: Add slave status handling")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/drivers/soundwire/bus.c b/drivers/soundwire/bus.c
> index ac88031f7664..a5d41a4a1609 100644
> --- a/drivers/soundwire/bus.c
> +++ b/drivers/soundwire/bus.c
> @@ -741,10 +741,10 @@ static int sdw_handle_port_interrupt(struct sdw_slave *slave,
>  
>  		/* Read DPN interrupt again */
>  		status2 = sdw_read(slave, addr);
> -		if (status < 0) {
> +		if (status2 < 0) {
>  			dev_err(slave->bus->dev,
> -					"SDW_DPN_INT read failed:%d", status);
> -			return status;
> +					"SDW_DPN_INT read failed:%d", status2);
> +			return status2;
>  		}
>  		status &= status2;
>
Dan Carpenter Jan. 10, 2018, 12:25 p.m. UTC | #2
On Wed, Jan 10, 2018 at 04:25:44PM +0530, Vinod Koul wrote:
> On Tue, Jan 09, 2018 at 12:37:44PM +0300, Dan Carpenter wrote:
> > We should be using "status2" here instead of "status".
> 
> This is already fixed by commit:
> 
> Author: Wei Yongjun <weiyongjun1@huawei.com>
> Date:   Mon Jan 8 22:22:44 2018 +0530
> 
>     soundwire: Fix typo in return value check of sdw_read()
> 
>     Fix the typo, 'status' should be instead of 'status2'.
> 


Hi Wei,

It looks like you're fixing static checker warnings?  Could you CC
kernel-janitors@vger.kernel.org for those fixes?  Otherwise we end up
sending duplicates a lot.

Colin King, Julia Lawall, Christophe JAILLET, and I all CC our static
checker fixes to kernel-janitors.  I still end up sending duplicates
sometimes...  Which is fine.

regards,
dan carpenter
Wei Yongjun Jan. 10, 2018, 12:45 p.m. UTC | #3
Hi Dan Carpenter

> 
> 
> Hi Wei,
> 
> It looks like you're fixing static checker warnings?  Could you CC
> kernel-janitors@vger.kernel.org for those fixes?  Otherwise we end up
> sending duplicates a lot.
> 
> Colin King, Julia Lawall, Christophe JAILLET, and I all CC our static
> checker fixes to kernel-janitors.  I still end up sending duplicates
> sometimes...  Which is fine.

Yes, I am running a static checker. I will CC kernel-janitors@vger.kernel.org for
those later patches.

Regards,
Yongjun Wei
diff mbox

Patch

diff --git a/drivers/soundwire/bus.c b/drivers/soundwire/bus.c
index ac88031f7664..a5d41a4a1609 100644
--- a/drivers/soundwire/bus.c
+++ b/drivers/soundwire/bus.c
@@ -741,10 +741,10 @@  static int sdw_handle_port_interrupt(struct sdw_slave *slave,
 
 		/* Read DPN interrupt again */
 		status2 = sdw_read(slave, addr);
-		if (status < 0) {
+		if (status2 < 0) {
 			dev_err(slave->bus->dev,
-					"SDW_DPN_INT read failed:%d", status);
-			return status;
+					"SDW_DPN_INT read failed:%d", status2);
+			return status2;
 		}
 		status &= status2;