Skip to contentSkip to conversation

megaraid_sas: Replace undefined MFI_BIG_ENDIAN macro with __BIG_ENDIAN_BITFIELD macro

PATCH In review Chandrakanth Patil 2 participants 2 messages May 8, 2020 – May 13, 2020

Subsystems (3)
lore
Share & tools
lore

Chandrakanth Patil

author maintainer
#0 lore raw

PATCH 3/5 megaraid_sas: Replace undefined MFI_BIG_ENDIAN macro with __BIG_ENDIAN_BITFIELD macro

MFI_BIG_ENDIAN macro used in drivers structure bitfield to check the CPU big endianness is undefined which would break the code on big endian machine. __BIG_ENDIAN_BITFIELD kernel macro should be used in places of MFI_BIG_ENDIAN macro.

Fixes a7faf81d7858 ("scsi: megaraid_sas: Set no_write_same only for Virtual Disk")
Cc <[email protected]> # v5.6+
---
 drivers/scsi/megaraid/megaraid_sas.h        | 4 ++--
 drivers/scsi/megaraid/megaraid_sas_fusion.h | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)
drivers/scsi/megaraid/megaraid_sas.h +2 -2
index 83d8c4c..9882736 100644
@@ -511,7 +511,7 @@ union MR_PROGRESS {
  */
 struct MR_PD_PROGRESS {
 	struct {
-#ifndef MFI_BIG_ENDIAN
+#ifndef __BIG_ENDIAN_BITFIELD
 		u32     rbld:1;
 		u32     patrol:1;
 		u32     clear:1;
@@ -537,7 +537,7 @@ struct MR_PD_PROGRESS {
 	};
 
 	struct {
-#ifndef MFI_BIG_ENDIAN
+#ifndef __BIG_ENDIAN_BITFIELD
 		u32     rbld:1;
 		u32     patrol:1;
 		u32     clear:1;
drivers/scsi/megaraid/megaraid_sas_fusion.h +3 -3
index d57ecc7..30de4b0 100644
@@ -774,7 +774,7 @@ struct MR_SPAN_BLOCK_INFO {
 struct MR_CPU_AFFINITY_MASK {
 	union {
 		struct {
-#ifndef MFI_BIG_ENDIAN
+#ifndef __BIG_ENDIAN_BITFIELD
 		u8 hw_path:1;
 		u8 cpu0:1;
 		u8 cpu1:1;
@@ -866,7 +866,7 @@ struct MR_LD_RAID {
 	__le16     seqNum;
 
 struct {
-#ifndef MFI_BIG_ENDIAN
+#ifndef __BIG_ENDIAN_BITFIELD
 	u32 ldSyncRequired:1;
 	u32 regTypeReqOnReadIsValid:1;
 	u32 isEPD:1;
@@ -889,7 +889,7 @@ struct {
 	/* 0x30 - 0x33, Logical block size for the LD */
 	u32 logical_block_length;
 	struct {
-#ifndef MFI_BIG_ENDIAN
+#ifndef __BIG_ENDIAN_BITFIELD
 	/* 0x34, P_I_EXPONENT from READ CAPACITY 16 */
 	u32 ld_pi_exp:4;
 	/* 0x34, LOGICAL BLOCKS PER PHYSICAL
Signature · 1 line
2.9.5
Reviewed-by on v1 3/5
#1 lore raw
Quoted 5 lines · Chandrakanth Patil

MFI_BIG_ENDIAN macro used in drivers structure bitfield to check the CPU big endianness is undefined which would break the code on big endian machine. __BIG_ENDIAN_BITFIELD kernel macro should be used in places of MFI_BIG_ENDIAN macro.

Quoted 9 lines
Fixes a7faf81d7858 ("scsi: megaraid_sas: Set no_write_same only for Virtual Disk")
Cc <[email protected]> # v5.6+
---
  drivers/scsi/megaraid/megaraid_sas.h        | 4 ++--
  drivers/scsi/megaraid/megaraid_sas_fusion.h | 6 +++---
  2 files changed, 5 insertions(+), 5 deletions(-)

Cheers,

Hannes

Signature · 4 lines
Dr. Hannes Reinecke            Teamlead Storage & Networking
[email protected]                               +49 911 74053 688
SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), Geschäftsführer: Felix Imendörffer