[dpdk-dev,2/5] bnx2x: Fix x86_64-native-linuxapp-clang build error

Message ID 1442018576-19981-3-git-send-email-rasesh.mody@qlogic.com (mailing list archive)
State Changes Requested, archived
Headers

Commit Message

Rasesh Mody Sept. 12, 2015, 12:42 a.m. UTC
  From: Harish Patil <harish.patil@qlogic.com>

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
---
 drivers/net/bnx2x/ecore_hsi.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Thomas Monjalon Oct. 20, 2015, 4:11 p.m. UTC | #1
2015-09-11 17:42, Rasesh Mody:
>  	#define SHMEM_EEE_ADV_STATUS_MASK	   0x00f00000
>  		#define SHMEM_EEE_100M_ADV	   (1<<0)
> -		#define SHMEM_EEE_1G_ADV	   (1<<1)
> +		#define SHMEM_EEE_1G_ADV	   (1U<<1)
>  		#define SHMEM_EEE_10G_ADV	   (1<<2)

Why other constants are not changed?

Please put at least the build error in the message.
  
Harish Patil Oct. 23, 2015, 4:36 p.m. UTC | #2
>

>2015-09-11 17:42, Rasesh Mody:

>>      #define SHMEM_EEE_ADV_STATUS_MASK          0x00f00000

>>              #define SHMEM_EEE_100M_ADV         (1<<0)

>> -            #define SHMEM_EEE_1G_ADV           (1<<1)

>> +            #define SHMEM_EEE_1G_ADV           (1U<<1)

>>              #define SHMEM_EEE_10G_ADV          (1<<2)

>

>Why other constants are not changed?

I only addressed the build error which is against SHMEM_EEE_1G_ADV.
Is that okay?
>

>Please put at least the build error in the message.

>

Sure, will include the build error and submit new patch.

drivers/net/bnx2x/elink.c:10384:41: error: shifting a
      negative signed value is undefined [-Werror,-Wshift-negative-value]
                vars->eee_status &= ~SHMEM_EEE_1G_ADV <<
                                    ~~~~~~~~~~~~~~~~~ ^
1 error generated.
make[6]: *** [elink.o] Error 1
make[5]: *** [bnx2x] Error 2
make[4]: *** [net] Error 2
make[3]: *** [drivers] Error 2
make[2]: *** [all] Error 2
make[1]: *** [x86_64-native-linuxapp-clang_install] Error 2
make: *** [install] Error 2



________________________________

This message and any attached documents contain information from the sending company or its parent company(s), subsidiaries, divisions or branch offices that may be confidential. If you are not the intended recipient, you may not read, copy, distribute, or use this information. If you have received this transmission in error, please notify the sender immediately by reply e-mail and then delete this message.
  
Thomas Monjalon Oct. 23, 2015, 4:42 p.m. UTC | #3
2015-10-23 16:36, Harish Patil:
> >
> >2015-09-11 17:42, Rasesh Mody:
> >>      #define SHMEM_EEE_ADV_STATUS_MASK          0x00f00000
> >>              #define SHMEM_EEE_100M_ADV         (1<<0)
> >> -            #define SHMEM_EEE_1G_ADV           (1<<1)
> >> +            #define SHMEM_EEE_1G_ADV           (1U<<1)
> >>              #define SHMEM_EEE_10G_ADV          (1<<2)
> >
> >Why other constants are not changed?
> I only addressed the build error which is against SHMEM_EEE_1G_ADV.
> Is that okay?

I would say no but you have the ownership on this code.
Please think which code quality you are expecting.

> This message and any attached documents contain information from the sending company or its parent company(s), subsidiaries, divisions or branch offices that may be confidential. If you are not the intended recipient, you may not read, copy, distribute, or use this information. If you have received this transmission in error, please notify the sender immediately by reply e-mail and then delete this message.

Please remove this footer, irrelevant on a mailing list.
  
Harish Patil Nov. 3, 2015, 6:27 a.m. UTC | #4
>2015-10-23 16:36, Harish Patil:

>> >

>> >2015-09-11 17:42, Rasesh Mody:

>> >>      #define SHMEM_EEE_ADV_STATUS_MASK          0x00f00000

>> >>              #define SHMEM_EEE_100M_ADV         (1<<0)

>> >> -            #define SHMEM_EEE_1G_ADV           (1<<1)

>> >> +            #define SHMEM_EEE_1G_ADV           (1U<<1)

>> >>              #define SHMEM_EEE_10G_ADV          (1<<2)

>> >

>> >Why other constants are not changed?

>> I only addressed the build error which is against SHMEM_EEE_1G_ADV.

>> Is that okay?

>

>I would say no but you have the ownership on this code.

>Please think which code quality you are expecting.


[Harish] I checked out internally. This is a header file based on regspecs
which would be difficult to change/test everywhere.
So I would just have to do this point fix.
>

>> This message and any attached documents contain information from the

>>sending company or its parent company(s), subsidiaries, divisions or

>>branch offices that may be confidential. If you are not the intended

>>recipient, you may not read, copy, distribute, or use this information.

>>If you have received this transmission in error, please notify the

>>sender immediately by reply e-mail and then delete this message.

>

>Please remove this footer, irrelevant on a mailing list.

>




________________________________

This message and any attached documents contain information from the sending company or its parent company(s), subsidiaries, divisions or branch offices that may be confidential. If you are not the intended recipient, you may not read, copy, distribute, or use this information. If you have received this transmission in error, please notify the sender immediately by reply e-mail and then delete this message.
  

Patch

diff --git a/drivers/net/bnx2x/ecore_hsi.h b/drivers/net/bnx2x/ecore_hsi.h
index a4ed9b5..fe72938 100644
--- a/drivers/net/bnx2x/ecore_hsi.h
+++ b/drivers/net/bnx2x/ecore_hsi.h
@@ -2529,7 +2529,7 @@  struct shmem2_region {
 	#define SHMEM_EEE_SUPPORTED_SHIFT	   16
 	#define SHMEM_EEE_ADV_STATUS_MASK	   0x00f00000
 		#define SHMEM_EEE_100M_ADV	   (1<<0)
-		#define SHMEM_EEE_1G_ADV	   (1<<1)
+		#define SHMEM_EEE_1G_ADV	   (1U<<1)
 		#define SHMEM_EEE_10G_ADV	   (1<<2)
 	#define SHMEM_EEE_ADV_STATUS_SHIFT	   20
 	#define	SHMEM_EEE_LP_ADV_STATUS_MASK	   0x0f000000