Netdev Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] staging: qlge: Fix multiple assignments warning by splitting the assignement into two each
@ 2019-10-09 20:43 Jules Irenge
  2019-10-09 20:48 ` [Outreachy kernel] " Julia Lawall
  0 siblings, 1 reply; 8+ messages in thread
From: Jules Irenge @ 2019-10-09 20:43 UTC (permalink / raw)
  To: outreachy-kernel
  Cc: gregkh, GR-Linux-NIC-Dev, netdev, devel, linux-kernel, Jules Irenge

Fix multiple assignments warning " check
 issued by checkpatch.pl tool:
"CHECK: multiple assignments should be avoided".

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
---
 drivers/staging/qlge/qlge_dbg.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/qlge/qlge_dbg.c b/drivers/staging/qlge/qlge_dbg.c
index 086f067fd899..69bd4710c5ec 100644
--- a/drivers/staging/qlge/qlge_dbg.c
+++ b/drivers/staging/qlge/qlge_dbg.c
@@ -141,8 +141,10 @@ static int ql_get_serdes_regs(struct ql_adapter *qdev,
 	u32 *direct_ptr, temp;
 	u32 *indirect_ptr;
 
-	xfi_direct_valid = xfi_indirect_valid = 0;
-	xaui_direct_valid = xaui_indirect_valid = 1;
+	xfi_indirect_valid = 0;
+	xfi_direct_valid = xfi_indirect_valid;
+	xaui_indirect_valid = 1;
+	xaui_direct_valid = xaui_indirect_valid
 
 	/* The XAUI needs to be read out per port */
 	status = ql_read_other_func_serdes_reg(qdev,
-- 
2.21.0


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

* Re: [Outreachy kernel] [PATCH] staging: qlge: Fix multiple assignments warning by splitting the assignement into two each
  2019-10-09 20:43 [PATCH] staging: qlge: Fix multiple assignments warning by splitting the assignement into two each Jules Irenge
@ 2019-10-09 20:48 ` " Julia Lawall
  2019-10-09 23:54   ` Joe Perches
  0 siblings, 1 reply; 8+ messages in thread
From: Julia Lawall @ 2019-10-09 20:48 UTC (permalink / raw)
  To: Jules Irenge
  Cc: outreachy-kernel, gregkh, GR-Linux-NIC-Dev, netdev, devel, linux-kernel



On Wed, 9 Oct 2019, Jules Irenge wrote:

> Fix multiple assignments warning " check
>  issued by checkpatch.pl tool:
> "CHECK: multiple assignments should be avoided".
>
> Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
> ---
>  drivers/staging/qlge/qlge_dbg.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/qlge/qlge_dbg.c b/drivers/staging/qlge/qlge_dbg.c
> index 086f067fd899..69bd4710c5ec 100644
> --- a/drivers/staging/qlge/qlge_dbg.c
> +++ b/drivers/staging/qlge/qlge_dbg.c
> @@ -141,8 +141,10 @@ static int ql_get_serdes_regs(struct ql_adapter *qdev,
>  	u32 *direct_ptr, temp;
>  	u32 *indirect_ptr;
>
> -	xfi_direct_valid = xfi_indirect_valid = 0;
> -	xaui_direct_valid = xaui_indirect_valid = 1;
> +	xfi_indirect_valid = 0;
> +	xfi_direct_valid = xfi_indirect_valid;
> +	xaui_indirect_valid = 1;
> +	xaui_direct_valid = xaui_indirect_valid

Despite checkpatch, I think that the original code was easier to
understand.

julia

>
>  	/* The XAUI needs to be read out per port */
>  	status = ql_read_other_func_serdes_reg(qdev,
> --
> 2.21.0
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20191009204311.7988-1-jbi.octave%40gmail.com.
>

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

* Re: [Outreachy kernel] [PATCH] staging: qlge: Fix multiple assignments warning by splitting the assignement into two each
  2019-10-09 20:48 ` [Outreachy kernel] " Julia Lawall
@ 2019-10-09 23:54   ` Joe Perches
  2019-10-10  5:37     ` Julia Lawall
  2019-10-10  9:09     ` Dan Carpenter
  0 siblings, 2 replies; 8+ messages in thread
From: Joe Perches @ 2019-10-09 23:54 UTC (permalink / raw)
  To: Julia Lawall, Jules Irenge
  Cc: outreachy-kernel, gregkh, GR-Linux-NIC-Dev, netdev, devel, linux-kernel

On Wed, 2019-10-09 at 22:48 +0200, Julia Lawall wrote:
> On Wed, 9 Oct 2019, Jules Irenge wrote:
> > Fix multiple assignments warning " check
> >  issued by checkpatch.pl tool:
> > "CHECK: multiple assignments should be avoided".
[]
> > diff --git a/drivers/staging/qlge/qlge_dbg.c b/drivers/staging/qlge/qlge_dbg.c
[]
> > @@ -141,8 +141,10 @@ static int ql_get_serdes_regs(struct ql_adapter *qdev,
> >  	u32 *direct_ptr, temp;
> >  	u32 *indirect_ptr;
> > 
> > -	xfi_direct_valid = xfi_indirect_valid = 0;
> > -	xaui_direct_valid = xaui_indirect_valid = 1;
> > +	xfi_indirect_valid = 0;
> > +	xfi_direct_valid = xfi_indirect_valid;
> > +	xaui_indirect_valid = 1;
> > +	xaui_direct_valid = xaui_indirect_valid
> 
> Despite checkpatch, I think that the original code was easier to
> understand.

It'd likely be easier to understand if all the
<foo>_valid uses were bool and the ql_get_both_serdes
<foo>_valid arguments were change to bool from
unsigned int as well.

btw: qlge likely is going to be deleted and not updated.

---
 drivers/staging/qlge/qlge_dbg.c | 22 ++++++++++------------
 1 file changed, 10 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/qlge/qlge_dbg.c b/drivers/staging/qlge/qlge_dbg.c
index 7e16066a3527..90ab37d4c49d 100644
--- a/drivers/staging/qlge/qlge_dbg.c
+++ b/drivers/staging/qlge/qlge_dbg.c
@@ -112,7 +112,7 @@ static int ql_read_serdes_reg(struct ql_adapter *qdev, u32 reg, u32 *data)
 
 static void ql_get_both_serdes(struct ql_adapter *qdev, u32 addr,
 			u32 *direct_ptr, u32 *indirect_ptr,
-			unsigned int direct_valid, unsigned int indirect_valid)
+			bool direct_valid, bool indirect_valid)
 {
 	unsigned int status;
 
@@ -136,14 +136,12 @@ static int ql_get_serdes_regs(struct ql_adapter *qdev,
 				struct ql_mpi_coredump *mpi_coredump)
 {
 	int status;
-	unsigned int xfi_direct_valid, xfi_indirect_valid, xaui_direct_valid;
-	unsigned int xaui_indirect_valid, i;
+	bool xfi_direct_valid = false, xfi_indirect_valid = false;
+	bool xaui_direct_valid = true, xaui_indirect_valid = true;
+	unsigned int i;
 	u32 *direct_ptr, temp;
 	u32 *indirect_ptr;
 
-	xfi_direct_valid = xfi_indirect_valid = 0;
-	xaui_direct_valid = xaui_indirect_valid = 1;
-
 	/* The XAUI needs to be read out per port */
 	status = ql_read_other_func_serdes_reg(qdev,
 			XG_SERDES_XAUI_HSS_PCS_START, &temp);
@@ -152,7 +150,7 @@ static int ql_get_serdes_regs(struct ql_adapter *qdev,
 
 	if ((temp & XG_SERDES_ADDR_XAUI_PWR_DOWN) ==
 				XG_SERDES_ADDR_XAUI_PWR_DOWN)
-		xaui_indirect_valid = 0;
+		xaui_indirect_valid = false;
 
 	status = ql_read_serdes_reg(qdev, XG_SERDES_XAUI_HSS_PCS_START, &temp);
 
@@ -161,7 +159,7 @@ static int ql_get_serdes_regs(struct ql_adapter *qdev,
 
 	if ((temp & XG_SERDES_ADDR_XAUI_PWR_DOWN) ==
 				XG_SERDES_ADDR_XAUI_PWR_DOWN)
-		xaui_direct_valid = 0;
+		xaui_direct_valid = false;
 
 	/*
 	 * XFI register is shared so only need to read one
@@ -176,18 +174,18 @@ static int ql_get_serdes_regs(struct ql_adapter *qdev,
 		/* now see if i'm NIC 1 or NIC 2 */
 		if (qdev->func & 1)
 			/* I'm NIC 2, so the indirect (NIC1) xfi is up. */
-			xfi_indirect_valid = 1;
+			xfi_indirect_valid = true;
 		else
-			xfi_direct_valid = 1;
+			xfi_direct_valid = true;
 	}
 	if ((temp & XG_SERDES_ADDR_XFI2_PWR_UP) ==
 					XG_SERDES_ADDR_XFI2_PWR_UP) {
 		/* now see if i'm NIC 1 or NIC 2 */
 		if (qdev->func & 1)
 			/* I'm NIC 2, so the indirect (NIC1) xfi is up. */
-			xfi_direct_valid = 1;
+			xfi_direct_valid = true;
 		else
-			xfi_indirect_valid = 1;
+			xfi_indirect_valid = true;
 	}
 
 	/* Get XAUI_AN register block. */


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

* Re: [Outreachy kernel] [PATCH] staging: qlge: Fix multiple assignments warning by splitting the assignement into two each
  2019-10-09 23:54   ` Joe Perches
@ 2019-10-10  5:37     ` Julia Lawall
  2019-10-10  9:09     ` Dan Carpenter
  1 sibling, 0 replies; 8+ messages in thread
From: Julia Lawall @ 2019-10-10  5:37 UTC (permalink / raw)
  To: Joe Perches
  Cc: Jules Irenge, outreachy-kernel, gregkh, GR-Linux-NIC-Dev, netdev,
	devel, linux-kernel



On Wed, 9 Oct 2019, Joe Perches wrote:

> On Wed, 2019-10-09 at 22:48 +0200, Julia Lawall wrote:
> > On Wed, 9 Oct 2019, Jules Irenge wrote:
> > > Fix multiple assignments warning " check
> > >  issued by checkpatch.pl tool:
> > > "CHECK: multiple assignments should be avoided".
> []
> > > diff --git a/drivers/staging/qlge/qlge_dbg.c b/drivers/staging/qlge/qlge_dbg.c
> []
> > > @@ -141,8 +141,10 @@ static int ql_get_serdes_regs(struct ql_adapter *qdev,
> > >  	u32 *direct_ptr, temp;
> > >  	u32 *indirect_ptr;
> > >
> > > -	xfi_direct_valid = xfi_indirect_valid = 0;
> > > -	xaui_direct_valid = xaui_indirect_valid = 1;
> > > +	xfi_indirect_valid = 0;
> > > +	xfi_direct_valid = xfi_indirect_valid;
> > > +	xaui_indirect_valid = 1;
> > > +	xaui_direct_valid = xaui_indirect_valid
> >
> > Despite checkpatch, I think that the original code was easier to
> > understand.
>
> It'd likely be easier to understand if all the
> <foo>_valid uses were bool and the ql_get_both_serdes
> <foo>_valid arguments were change to bool from
> unsigned int as well.

Indeed, given the names and the values, bool would be much better.

> btw: qlge likely is going to be deleted and not updated.

OK.  Jules, if you want to make this change, you can, but it could be
better to move on to some other driver.

thanks,
julia

>
> ---
>  drivers/staging/qlge/qlge_dbg.c | 22 ++++++++++------------
>  1 file changed, 10 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/staging/qlge/qlge_dbg.c b/drivers/staging/qlge/qlge_dbg.c
> index 7e16066a3527..90ab37d4c49d 100644
> --- a/drivers/staging/qlge/qlge_dbg.c
> +++ b/drivers/staging/qlge/qlge_dbg.c
> @@ -112,7 +112,7 @@ static int ql_read_serdes_reg(struct ql_adapter *qdev, u32 reg, u32 *data)
>
>  static void ql_get_both_serdes(struct ql_adapter *qdev, u32 addr,
>  			u32 *direct_ptr, u32 *indirect_ptr,
> -			unsigned int direct_valid, unsigned int indirect_valid)
> +			bool direct_valid, bool indirect_valid)
>  {
>  	unsigned int status;
>
> @@ -136,14 +136,12 @@ static int ql_get_serdes_regs(struct ql_adapter *qdev,
>  				struct ql_mpi_coredump *mpi_coredump)
>  {
>  	int status;
> -	unsigned int xfi_direct_valid, xfi_indirect_valid, xaui_direct_valid;
> -	unsigned int xaui_indirect_valid, i;
> +	bool xfi_direct_valid = false, xfi_indirect_valid = false;
> +	bool xaui_direct_valid = true, xaui_indirect_valid = true;
> +	unsigned int i;
>  	u32 *direct_ptr, temp;
>  	u32 *indirect_ptr;
>
> -	xfi_direct_valid = xfi_indirect_valid = 0;
> -	xaui_direct_valid = xaui_indirect_valid = 1;
> -
>  	/* The XAUI needs to be read out per port */
>  	status = ql_read_other_func_serdes_reg(qdev,
>  			XG_SERDES_XAUI_HSS_PCS_START, &temp);
> @@ -152,7 +150,7 @@ static int ql_get_serdes_regs(struct ql_adapter *qdev,
>
>  	if ((temp & XG_SERDES_ADDR_XAUI_PWR_DOWN) ==
>  				XG_SERDES_ADDR_XAUI_PWR_DOWN)
> -		xaui_indirect_valid = 0;
> +		xaui_indirect_valid = false;
>
>  	status = ql_read_serdes_reg(qdev, XG_SERDES_XAUI_HSS_PCS_START, &temp);
>
> @@ -161,7 +159,7 @@ static int ql_get_serdes_regs(struct ql_adapter *qdev,
>
>  	if ((temp & XG_SERDES_ADDR_XAUI_PWR_DOWN) ==
>  				XG_SERDES_ADDR_XAUI_PWR_DOWN)
> -		xaui_direct_valid = 0;
> +		xaui_direct_valid = false;
>
>  	/*
>  	 * XFI register is shared so only need to read one
> @@ -176,18 +174,18 @@ static int ql_get_serdes_regs(struct ql_adapter *qdev,
>  		/* now see if i'm NIC 1 or NIC 2 */
>  		if (qdev->func & 1)
>  			/* I'm NIC 2, so the indirect (NIC1) xfi is up. */
> -			xfi_indirect_valid = 1;
> +			xfi_indirect_valid = true;
>  		else
> -			xfi_direct_valid = 1;
> +			xfi_direct_valid = true;
>  	}
>  	if ((temp & XG_SERDES_ADDR_XFI2_PWR_UP) ==
>  					XG_SERDES_ADDR_XFI2_PWR_UP) {
>  		/* now see if i'm NIC 1 or NIC 2 */
>  		if (qdev->func & 1)
>  			/* I'm NIC 2, so the indirect (NIC1) xfi is up. */
> -			xfi_direct_valid = 1;
> +			xfi_direct_valid = true;
>  		else
> -			xfi_indirect_valid = 1;
> +			xfi_indirect_valid = true;
>  	}
>
>  	/* Get XAUI_AN register block. */
>
>

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

* Re: [Outreachy kernel] [PATCH] staging: qlge: Fix multiple assignments warning by splitting the assignement into two each
  2019-10-09 23:54   ` Joe Perches
  2019-10-10  5:37     ` Julia Lawall
@ 2019-10-10  9:09     ` Dan Carpenter
  1 sibling, 0 replies; 8+ messages in thread
From: Dan Carpenter @ 2019-10-10  9:09 UTC (permalink / raw)
  To: Joe Perches
  Cc: Julia Lawall, Jules Irenge, devel, GR-Linux-NIC-Dev, netdev,
	linux-kernel, outreachy-kernel, gregkh

I was just about to give a newbie a Reviewed-by cookie until I saw it
was a Joe Perches patch without a commit message or a sign off.  And
then I was annoyed that I had invested any time in it at all.  I even
dropped out of my email client for this!

:P

If you want to resend as a proper commit then you can still have my
Reviewed-by I guess.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>

regards,
dan carpenter


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

* Re: [PATCH] staging: qlge: Fix multiple assignments warning by splitting the assignement into two each
  2019-10-09 20:10 Jules Irenge
  2019-10-10  8:51 ` Dan Carpenter
@ 2019-10-10  9:13 ` kbuild test robot
  1 sibling, 0 replies; 8+ messages in thread
From: kbuild test robot @ 2019-10-10  9:13 UTC (permalink / raw)
  To: Jules Irenge
  Cc: kbuild-all, outreachy-kernel, devel, grekh, Jules Irenge,
	GR-Linux-NIC-Dev, netdev, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 24631 bytes --]

Hi Jules,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on staging/staging-testing]

url:    https://github.com/0day-ci/linux/commits/Jules-Irenge/staging-qlge-Fix-multiple-assignments-warning-by-splitting-the-assignement-into-two-each/20191010-141520
config: x86_64-randconfig-g004-201940 (attached as .config)
compiler: gcc-7 (Debian 7.4.0-13) 7.4.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   drivers/staging/qlge/qlge_dbg.c: In function 'ql_get_serdes_regs':
>> drivers/staging/qlge/qlge_dbg.c:150:2: error: expected ';' before 'status'
     status = ql_read_other_func_serdes_reg(qdev,
     ^~~~~~

vim +150 drivers/staging/qlge/qlge_dbg.c

a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  134  
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  135  static int ql_get_serdes_regs(struct ql_adapter *qdev,
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  136  				struct ql_mpi_coredump *mpi_coredump)
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  137  {
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  138  	int status;
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  139  	unsigned int xfi_direct_valid, xfi_indirect_valid, xaui_direct_valid;
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  140  	unsigned int xaui_indirect_valid, i;
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  141  	u32 *direct_ptr, temp;
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  142  	u32 *indirect_ptr;
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  143  
53cbe4642113f8 drivers/staging/qlge/qlge_dbg.c             Jules Irenge        2019-10-09  144  	xfi_indirect_valid = 0;
53cbe4642113f8 drivers/staging/qlge/qlge_dbg.c             Jules Irenge        2019-10-09  145  	xfi_direct_valid = xfi_indirect_valid;
53cbe4642113f8 drivers/staging/qlge/qlge_dbg.c             Jules Irenge        2019-10-09  146  	xaui_indirect_valid = 1;
53cbe4642113f8 drivers/staging/qlge/qlge_dbg.c             Jules Irenge        2019-10-09  147  	xaui_direct_valid = xaui_indirect_valid
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  148  
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  149  	/* The XAUI needs to be read out per port */
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15 @150  	status = ql_read_other_func_serdes_reg(qdev,
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  151  			XG_SERDES_XAUI_HSS_PCS_START, &temp);
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  152  	if (status)
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  153  		temp = XG_SERDES_ADDR_XAUI_PWR_DOWN;
4db93fb8aca3e9 drivers/net/ethernet/qlogic/qlge/qlge_dbg.c Gustavo A. R. Silva 2017-08-12  154  
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  155  	if ((temp & XG_SERDES_ADDR_XAUI_PWR_DOWN) ==
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  156  				XG_SERDES_ADDR_XAUI_PWR_DOWN)
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  157  		xaui_indirect_valid = 0;
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  158  
4db93fb8aca3e9 drivers/net/ethernet/qlogic/qlge/qlge_dbg.c Gustavo A. R. Silva 2017-08-12  159  	status = ql_read_serdes_reg(qdev, XG_SERDES_XAUI_HSS_PCS_START, &temp);
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  160  
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  161  	if (status)
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  162  		temp = XG_SERDES_ADDR_XAUI_PWR_DOWN;
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  163  
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  164  	if ((temp & XG_SERDES_ADDR_XAUI_PWR_DOWN) ==
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  165  				XG_SERDES_ADDR_XAUI_PWR_DOWN)
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  166  		xaui_direct_valid = 0;
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  167  
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  168  	/*
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  169  	 * XFI register is shared so only need to read one
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  170  	 * functions and then check the bits.
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  171  	 */
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  172  	status = ql_read_serdes_reg(qdev, XG_SERDES_ADDR_STS, &temp);
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  173  	if (status)
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  174  		temp = 0;
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  175  
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  176  	if ((temp & XG_SERDES_ADDR_XFI1_PWR_UP) ==
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  177  					XG_SERDES_ADDR_XFI1_PWR_UP) {
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  178  		/* now see if i'm NIC 1 or NIC 2 */
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  179  		if (qdev->func & 1)
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  180  			/* I'm NIC 2, so the indirect (NIC1) xfi is up. */
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  181  			xfi_indirect_valid = 1;
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  182  		else
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  183  			xfi_direct_valid = 1;
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  184  	}
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  185  	if ((temp & XG_SERDES_ADDR_XFI2_PWR_UP) ==
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  186  					XG_SERDES_ADDR_XFI2_PWR_UP) {
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  187  		/* now see if i'm NIC 1 or NIC 2 */
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  188  		if (qdev->func & 1)
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  189  			/* I'm NIC 2, so the indirect (NIC1) xfi is up. */
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  190  			xfi_direct_valid = 1;
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  191  		else
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  192  			xfi_indirect_valid = 1;
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  193  	}
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  194  
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  195  	/* Get XAUI_AN register block. */
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  196  	if (qdev->func & 1) {
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  197  		/* Function 2 is direct	*/
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  198  		direct_ptr = mpi_coredump->serdes2_xaui_an;
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  199  		indirect_ptr = mpi_coredump->serdes_xaui_an;
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  200  	} else {
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  201  		/* Function 1 is direct	*/
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  202  		direct_ptr = mpi_coredump->serdes_xaui_an;
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  203  		indirect_ptr = mpi_coredump->serdes2_xaui_an;
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  204  	}
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  205  
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  206  	for (i = 0; i <= 0x000000034; i += 4, direct_ptr++, indirect_ptr++)
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  207  		ql_get_both_serdes(qdev, i, direct_ptr, indirect_ptr,
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  208  					xaui_direct_valid, xaui_indirect_valid);
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  209  
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  210  	/* Get XAUI_HSS_PCS register block. */
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  211  	if (qdev->func & 1) {
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  212  		direct_ptr =
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  213  			mpi_coredump->serdes2_xaui_hss_pcs;
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  214  		indirect_ptr =
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  215  			mpi_coredump->serdes_xaui_hss_pcs;
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  216  	} else {
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  217  		direct_ptr =
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  218  			mpi_coredump->serdes_xaui_hss_pcs;
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  219  		indirect_ptr =
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  220  			mpi_coredump->serdes2_xaui_hss_pcs;
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  221  	}
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  222  
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  223  	for (i = 0x800; i <= 0x880; i += 4, direct_ptr++, indirect_ptr++)
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  224  		ql_get_both_serdes(qdev, i, direct_ptr, indirect_ptr,
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  225  					xaui_direct_valid, xaui_indirect_valid);
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  226  
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  227  	/* Get XAUI_XFI_AN register block. */
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  228  	if (qdev->func & 1) {
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  229  		direct_ptr = mpi_coredump->serdes2_xfi_an;
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  230  		indirect_ptr = mpi_coredump->serdes_xfi_an;
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  231  	} else {
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  232  		direct_ptr = mpi_coredump->serdes_xfi_an;
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  233  		indirect_ptr = mpi_coredump->serdes2_xfi_an;
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  234  	}
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  235  
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  236  	for (i = 0x1000; i <= 0x1034; i += 4, direct_ptr++, indirect_ptr++)
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  237  		ql_get_both_serdes(qdev, i, direct_ptr, indirect_ptr,
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  238  					xfi_direct_valid, xfi_indirect_valid);
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  239  
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  240  	/* Get XAUI_XFI_TRAIN register block. */
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  241  	if (qdev->func & 1) {
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  242  		direct_ptr = mpi_coredump->serdes2_xfi_train;
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  243  		indirect_ptr =
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  244  			mpi_coredump->serdes_xfi_train;
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  245  	} else {
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  246  		direct_ptr = mpi_coredump->serdes_xfi_train;
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  247  		indirect_ptr =
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  248  			mpi_coredump->serdes2_xfi_train;
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  249  	}
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  250  
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  251  	for (i = 0x1050; i <= 0x107c; i += 4, direct_ptr++, indirect_ptr++)
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  252  		ql_get_both_serdes(qdev, i, direct_ptr, indirect_ptr,
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  253  					xfi_direct_valid, xfi_indirect_valid);
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  254  
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  255  	/* Get XAUI_XFI_HSS_PCS register block. */
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  256  	if (qdev->func & 1) {
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  257  		direct_ptr =
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  258  			mpi_coredump->serdes2_xfi_hss_pcs;
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  259  		indirect_ptr =
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  260  			mpi_coredump->serdes_xfi_hss_pcs;
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  261  	} else {
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  262  		direct_ptr =
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  263  			mpi_coredump->serdes_xfi_hss_pcs;
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  264  		indirect_ptr =
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  265  			mpi_coredump->serdes2_xfi_hss_pcs;
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  266  	}
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  267  
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  268  	for (i = 0x1800; i <= 0x1838; i += 4, direct_ptr++, indirect_ptr++)
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  269  		ql_get_both_serdes(qdev, i, direct_ptr, indirect_ptr,
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  270  					xfi_direct_valid, xfi_indirect_valid);
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  271  
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  272  	/* Get XAUI_XFI_HSS_TX register block. */
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  273  	if (qdev->func & 1) {
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  274  		direct_ptr =
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  275  			mpi_coredump->serdes2_xfi_hss_tx;
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  276  		indirect_ptr =
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  277  			mpi_coredump->serdes_xfi_hss_tx;
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  278  	} else {
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  279  		direct_ptr = mpi_coredump->serdes_xfi_hss_tx;
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  280  		indirect_ptr =
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  281  			mpi_coredump->serdes2_xfi_hss_tx;
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  282  	}
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  283  	for (i = 0x1c00; i <= 0x1c1f; i++, direct_ptr++, indirect_ptr++)
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  284  		ql_get_both_serdes(qdev, i, direct_ptr, indirect_ptr,
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  285  					xfi_direct_valid, xfi_indirect_valid);
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  286  
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  287  	/* Get XAUI_XFI_HSS_RX register block. */
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  288  	if (qdev->func & 1) {
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  289  		direct_ptr =
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  290  			mpi_coredump->serdes2_xfi_hss_rx;
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  291  		indirect_ptr =
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  292  			mpi_coredump->serdes_xfi_hss_rx;
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  293  	} else {
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  294  		direct_ptr = mpi_coredump->serdes_xfi_hss_rx;
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  295  		indirect_ptr =
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  296  			mpi_coredump->serdes2_xfi_hss_rx;
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  297  	}
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  298  
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  299  	for (i = 0x1c40; i <= 0x1c5f; i++, direct_ptr++, indirect_ptr++)
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  300  		ql_get_both_serdes(qdev, i, direct_ptr, indirect_ptr,
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  301  					xfi_direct_valid, xfi_indirect_valid);
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  302  
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  303  
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  304  	/* Get XAUI_XFI_HSS_PLL register block. */
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  305  	if (qdev->func & 1) {
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  306  		direct_ptr =
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  307  			mpi_coredump->serdes2_xfi_hss_pll;
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  308  		indirect_ptr =
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  309  			mpi_coredump->serdes_xfi_hss_pll;
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  310  	} else {
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  311  		direct_ptr =
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  312  			mpi_coredump->serdes_xfi_hss_pll;
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  313  		indirect_ptr =
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  314  			mpi_coredump->serdes2_xfi_hss_pll;
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  315  	}
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  316  	for (i = 0x1e00; i <= 0x1e1f; i++, direct_ptr++, indirect_ptr++)
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  317  		ql_get_both_serdes(qdev, i, direct_ptr, indirect_ptr,
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  318  					xfi_direct_valid, xfi_indirect_valid);
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  319  	return 0;
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  320  }
a48c86fdb1253f drivers/net/qlge/qlge_dbg.c                 Ron Mercer          2010-01-15  321  

:::::: The code at line 150 was first introduced by commit
:::::: a48c86fdb1253f36167bab1fc30a51211d49a901 qlge: Add serdes reg blocks dump to firmware dump.

:::::: TO: Ron Mercer <ron.mercer@qlogic.com>
:::::: CC: David S. Miller <davem@davemloft.net>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 26985 bytes --]

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

* Re: [PATCH] staging: qlge: Fix multiple assignments warning by splitting the assignement into two each
  2019-10-09 20:10 Jules Irenge
@ 2019-10-10  8:51 ` Dan Carpenter
  2019-10-10  9:13 ` kbuild test robot
  1 sibling, 0 replies; 8+ messages in thread
From: Dan Carpenter @ 2019-10-10  8:51 UTC (permalink / raw)
  To: Jules Irenge
  Cc: outreachy-kernel, devel, grekh, GR-Linux-NIC-Dev, netdev, linux-kernel

On Wed, Oct 09, 2019 at 09:10:29PM +0100, Jules Irenge wrote:
> Fix multiple assignments warning " check
>  issued by checkpatch.pl tool:
> "CHECK: multiple assignments should be avoided".
> 
> Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
> ---
>  drivers/staging/qlge/qlge_dbg.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/qlge/qlge_dbg.c b/drivers/staging/qlge/qlge_dbg.c
> index 086f067fd899..69bd4710c5ec 100644
> --- a/drivers/staging/qlge/qlge_dbg.c
> +++ b/drivers/staging/qlge/qlge_dbg.c
> @@ -141,8 +141,10 @@ static int ql_get_serdes_regs(struct ql_adapter *qdev,
>  	u32 *direct_ptr, temp;
>  	u32 *indirect_ptr;
>  
> -	xfi_direct_valid = xfi_indirect_valid = 0;
> -	xaui_direct_valid = xaui_indirect_valid = 1;
> +	xfi_indirect_valid = 0;
> +	xfi_direct_valid = xfi_indirect_valid;
> +	xaui_indirect_valid = 1;
> +	xaui_direct_valid = xaui_indirect_valid

The original code is fine here.  Just ignore checkpatch on this.

regards,
dan carpenter


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

* [PATCH] staging: qlge: Fix multiple assignments warning by splitting the assignement into two each
@ 2019-10-09 20:10 Jules Irenge
  2019-10-10  8:51 ` Dan Carpenter
  2019-10-10  9:13 ` kbuild test robot
  0 siblings, 2 replies; 8+ messages in thread
From: Jules Irenge @ 2019-10-09 20:10 UTC (permalink / raw)
  To: outreachy-kernel
  Cc: grekh, GR-Linux-NIC-Dev, netdev, devel, linux-kernel, Jules Irenge

Fix multiple assignments warning " check
 issued by checkpatch.pl tool:
"CHECK: multiple assignments should be avoided".

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
---
 drivers/staging/qlge/qlge_dbg.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/qlge/qlge_dbg.c b/drivers/staging/qlge/qlge_dbg.c
index 086f067fd899..69bd4710c5ec 100644
--- a/drivers/staging/qlge/qlge_dbg.c
+++ b/drivers/staging/qlge/qlge_dbg.c
@@ -141,8 +141,10 @@ static int ql_get_serdes_regs(struct ql_adapter *qdev,
 	u32 *direct_ptr, temp;
 	u32 *indirect_ptr;
 
-	xfi_direct_valid = xfi_indirect_valid = 0;
-	xaui_direct_valid = xaui_indirect_valid = 1;
+	xfi_indirect_valid = 0;
+	xfi_direct_valid = xfi_indirect_valid;
+	xaui_indirect_valid = 1;
+	xaui_direct_valid = xaui_indirect_valid
 
 	/* The XAUI needs to be read out per port */
 	status = ql_read_other_func_serdes_reg(qdev,
-- 
2.21.0


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

end of thread, back to index

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-09 20:43 [PATCH] staging: qlge: Fix multiple assignments warning by splitting the assignement into two each Jules Irenge
2019-10-09 20:48 ` [Outreachy kernel] " Julia Lawall
2019-10-09 23:54   ` Joe Perches
2019-10-10  5:37     ` Julia Lawall
2019-10-10  9:09     ` Dan Carpenter
  -- strict thread matches above, loose matches on Subject: below --
2019-10-09 20:10 Jules Irenge
2019-10-10  8:51 ` Dan Carpenter
2019-10-10  9:13 ` kbuild test robot

Netdev Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/netdev/0 netdev/git/0.git
	git clone --mirror https://lore.kernel.org/netdev/1 netdev/git/1.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 netdev netdev/ https://lore.kernel.org/netdev \
		netdev@vger.kernel.org netdev@archiver.kernel.org
	public-inbox-index netdev

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.netdev


AGPL code for this site: git clone https://public-inbox.org/ public-inbox