1 From b9d5e3e7f370a817c742fb089ac1a86dfe8947dc Mon Sep 17 00:00:00 2001
2 From: Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
3 Date: Fri, 8 May 2020 14:21:30 +0530
4 Subject: scsi: megaraid_sas: Replace undefined MFI_BIG_ENDIAN macro with __BIG_ENDIAN_BITFIELD macro
6 From: Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
8 commit b9d5e3e7f370a817c742fb089ac1a86dfe8947dc upstream.
10 MFI_BIG_ENDIAN macro used in drivers structure bitfield to check the CPU
11 big endianness is undefined which would break the code on big endian
12 machine. __BIG_ENDIAN_BITFIELD kernel macro should be used in places of
15 Link: https://lore.kernel.org/r/20200508085130.23339-1-chandrakanth.patil@broadcom.com
16 Fixes: a7faf81d7858 ("scsi: megaraid_sas: Set no_write_same only for Virtual Disk")
17 Cc: <stable@vger.kernel.org> # v5.6+
18 Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
19 Signed-off-by: Chandrakanth Patil <chandrakanth.patil@broadcom.com>
20 Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
21 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
24 drivers/scsi/megaraid/megaraid_sas.h | 4 ++--
25 drivers/scsi/megaraid/megaraid_sas_fusion.h | 6 +++---
26 2 files changed, 5 insertions(+), 5 deletions(-)
28 --- a/drivers/scsi/megaraid/megaraid_sas.h
29 +++ b/drivers/scsi/megaraid/megaraid_sas.h
30 @@ -511,7 +511,7 @@ union MR_PROGRESS {
32 struct MR_PD_PROGRESS {
34 -#ifndef MFI_BIG_ENDIAN
35 +#ifndef __BIG_ENDIAN_BITFIELD
39 @@ -537,7 +537,7 @@ struct MR_PD_PROGRESS {
43 -#ifndef MFI_BIG_ENDIAN
44 +#ifndef __BIG_ENDIAN_BITFIELD
48 --- a/drivers/scsi/megaraid/megaraid_sas_fusion.h
49 +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.h
50 @@ -774,7 +774,7 @@ struct MR_SPAN_BLOCK_INFO {
51 struct MR_CPU_AFFINITY_MASK {
54 -#ifndef MFI_BIG_ENDIAN
55 +#ifndef __BIG_ENDIAN_BITFIELD
59 @@ -866,7 +866,7 @@ struct MR_LD_RAID {
63 -#ifndef MFI_BIG_ENDIAN
64 +#ifndef __BIG_ENDIAN_BITFIELD
66 u32 regTypeReqOnReadIsValid:1;
68 @@ -889,7 +889,7 @@ struct {
69 /* 0x30 - 0x33, Logical block size for the LD */
70 u32 logical_block_length;
72 -#ifndef MFI_BIG_ENDIAN
73 +#ifndef __BIG_ENDIAN_BITFIELD
74 /* 0x34, P_I_EXPONENT from READ CAPACITY 16 */
76 /* 0x34, LOGICAL BLOCKS PER PHYSICAL