Skip to contentSkip to conversation

staging: Fix endian sparse warnings

PATCH In review Amitoj Kaur Chawla 2 participants 8 messages Oct 21, 2015 – Oct 25, 2015 Staging

lore
Share & tools
lore
#0 lore raw

cover staging: Fix endian sparse warnings

This patchset fixes multiple sparse warnings for endianness.

Amitoj Kaur Chawla(3):
staging: rts5208: Fix endian sparse warnings
staging: lustre: lmv: Fix endian sparse warnings
staging: lustre: lnet: Fix endian sparse warnings

 drivers/staging/lustre/lnet/lnet/lib-msg.c  | 24 ++++++++++++------------
 drivers/staging/lustre/lustre/lmv/lmv_obd.c | 12 ++++++------
 drivers/staging/rts5208/rtsx_transport.c    |  4 ++--
 3 files changed, 20 insertions(+), 20 deletions(-)
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/3 staging: rts5208: Fix endian sparse warnings

Fix bug found using sparse which gives the following warning:

drivers/staging/rts5208/rtsx_transport.c:217:34: warning: incorrect type in assignment (different base types) drivers/staging/rts5208/rtsx_transport.c:217:34: expected unsigned int [unsigned] [usertype] <noident> drivers/staging/rts5208/rtsx_transport.c:217:34: got restricted __le32 [usertype] <noident> drivers/staging/rts5208/rtsx_transport.c:316:44: warning: incorrect type in assignment (different base types) drivers/staging/rts5208/rtsx_transport.c:316:44: expected unsigned long long [unsigned] [long] [long long] [usertype] <noident> drivers/staging/rts5208/rtsx_transport.c:316:44: got restricted __le64 [usertype] <noident> drivers/staging/rts5208/rtsx_transport.c:316:44: warning: incorrect type in assignment (different base types) drivers/staging/rts5208/rtsx_transport.c:316:44: expected unsigned long long [unsigned] [long] [long long] [usertype] <noident> drivers/staging/rts5208/rtsx_transport.c:316:44: got restricted __le64 [usertype] <noident>

---
 drivers/staging/rts5208/rtsx_transport.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rts5208/rtsx_transport.c +2 -2
index f27491e..a650498 100644
@@ -204,7 +204,7 @@ Handle_Errors:
 void rtsx_add_cmd(struct rtsx_chip *chip,
 		u8 cmd_type, u16 reg_addr, u8 mask, u8 data)
 {
-	u32 *cb = (u32 *)(chip->host_cmds_ptr);
+	__le32 *cb = (__le32 *)(chip->host_cmds_ptr);
 	u32 val = 0;
 
 	val |= (u32)(cmd_type & 0x03) << 30;
@@ -297,7 +297,7 @@ finish_send_cmd:
 static inline void rtsx_add_sg_tbl(
 	struct rtsx_chip *chip, u32 addr, u32 len, u8 option)
 {
-	u64 *sgb = (u64 *)(chip->host_sg_tbl_ptr);
+	__le64 *sgb = (__le64 *)(chip->host_sg_tbl_ptr);
 	u64 val = 0;
 	u32 temp_len = 0;
 	u8  temp_opt = 0;
Signature · 1 line
1.9.1
#3 lore raw

PATCH 2/3 staging: lustre: lmv: Fix endian sparse warnings

In reply to Amitoj Kaur Chawla

Fix bug found using sparse which generates the following warning:

drivers/staging/lustre/lustre/lmv/lmv_obd.c:2422:25: warning:
incorrect type in assignment (different base types) drivers/staging/lustre/lustre/lmv/lmv_obd.c:2422:25: expected unsigned int [unsigned] [usertype] mea_magic drivers/staging/lustre/lustre/lmv/lmv_obd.c:2422:25: got restricted __le32 [usertype] <noident> drivers/staging/lustre/lustre/lmv/lmv_obd.c:2423:25: warning:
incorrect type in assignment (different base types) drivers/staging/lustre/lustre/lmv/lmv_obd.c:2423:25: expected unsigned int [unsigned] [usertype] mea_count drivers/staging/lustre/lustre/lmv/lmv_obd.c:2423:25: got restricted __le32 [usertype] <noident> drivers/staging/lustre/lustre/lmv/lmv_obd.c:2424:26: warning:
incorrect type in assignment (different base types) drivers/staging/lustre/lustre/lmv/lmv_obd.c:2424:26: expected unsigned int [unsigned] [usertype] mea_master drivers/staging/lustre/lustre/lmv/lmv_obd.c:2424:26: got restricted __le32 [usertype] <noident> drivers/staging/lustre/lustre/lmv/lmv_obd.c:2467:25: warning: cast to restricted __le32 drivers/staging/lustre/lustre/lmv/lmv_obd.c:2477:30: warning: cast to restricted __le32 drivers/staging/lustre/lustre/lmv/lmv_obd.c:2478:31: warning: cast to restricted __le32

---
 drivers/staging/lustre/lustre/lmv/lmv_obd.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/staging/lustre/lustre/lmv/lmv_obd.c +6 -6
index 7e6a060..8d90f19 100644
@@ -2419,9 +2419,9 @@ static int lmv_packmd(struct obd_export *exp, struct lov_mds_md **lmmp,
 	    lsmp->mea_magic != MEA_MAGIC_ALL_CHARS)
 		return -EINVAL;
 
-	meap->mea_magic = cpu_to_le32(lsmp->mea_magic);
-	meap->mea_count = cpu_to_le32(lsmp->mea_count);
-	meap->mea_master = cpu_to_le32(lsmp->mea_master);
+	meap->mea_magic = lsmp->mea_magic;
+	meap->mea_count = lsmp->mea_count;
+	meap->mea_master = lsmp->mea_master;
 
 	for (i = 0; i < lmv->desc.ld_tgt_count; i++) {
 		meap->mea_ids[i] = lsmp->mea_ids[i];
@@ -2464,7 +2464,7 @@ static int lmv_unpackmd(struct obd_export *exp, struct lov_stripe_md **lsmp,
 	if (mea->mea_magic == MEA_MAGIC_LAST_CHAR ||
 	    mea->mea_magic == MEA_MAGIC_ALL_CHARS ||
 	    mea->mea_magic == MEA_MAGIC_HASH_SEGMENT) {
-		magic = le32_to_cpu(mea->mea_magic);
+		magic = mea->mea_magic;
 	} else {
 		/*
 		 * Old mea is not handled here.
@@ -2474,8 +2474,8 @@ static int lmv_unpackmd(struct obd_export *exp, struct lov_stripe_md **lsmp,
 	}
 
 	(*tmea)->mea_magic = magic;
-	(*tmea)->mea_count = le32_to_cpu(mea->mea_count);
-	(*tmea)->mea_master = le32_to_cpu(mea->mea_master);
+	(*tmea)->mea_count = mea->mea_count;
+	(*tmea)->mea_master = mea->mea_master;
 
 	for (i = 0; i < (*tmea)->mea_count; i++) {
 		(*tmea)->mea_ids[i] = mea->mea_ids[i];
Signature · 1 line
1.9.1
#6 lore raw

PATCH 3/3 staging: lustre: lnet: Fix endian sparse warnings

In reply to Amitoj Kaur Chawla

Fix bug found using sparse which generates the following warning:

drivers/staging/lustre/lnet/lnet/lib-msg.c:72:37: warning: cast to restricted __le64 drivers/staging/lustre/lnet/lnet/lib-msg.c:73:37: warning: cast to restricted __le32 drivers/staging/lustre/lnet/lnet/lib-msg.c:116:42: warning: cast to restricted __le32 drivers/staging/lustre/lnet/lnet/lib-msg.c:117:42: warning: cast to restricted __le64 drivers/staging/lustre/lnet/lnet/lib-msg.c:118:42: warning: cast to restricted __le32 drivers/staging/lustre/lnet/lnet/lib-msg.c:120:42: warning: cast to restricted __le32 drivers/staging/lustre/lnet/lnet/lib-msg.c:121:42: warning: cast to restricted __le64 drivers/staging/lustre/lnet/lnet/lib-msg.c:125:42: warning: cast to restricted __le32 drivers/staging/lustre/lnet/lnet/lib-msg.c:126:42: warning: cast to restricted __le64 drivers/staging/lustre/lnet/lnet/lib-msg.c:128:42: warning: cast to restricted __le32 drivers/staging/lustre/lnet/lnet/lib-msg.c:129:42: warning: cast to restricted __le32 drivers/staging/lustre/lnet/lnet/lib-msg.c:384:46: warning: incorrect type in assignment (different base types) drivers/staging/lustre/lnet/lnet/lib-msg.c:384:46: expected unsigned int [unsigned] [usertype] mlength drivers/staging/lustre/lnet/lnet/lib-msg.c:384:46: got restricted __le32 [usertype] <noident>

---
 drivers/staging/lustre/lnet/lnet/lib-msg.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)
drivers/staging/lustre/lnet/lnet/lib-msg.c +12 -12
index 43977e8..4ad9a340 100644
@@ -69,8 +69,8 @@ lnet_build_msg_event(lnet_msg_t *msg, lnet_event_kind_t ev_type)
 
 	if (ev_type == LNET_EVENT_SEND) {
 		/* event for active message */
-		ev->target.nid    = le64_to_cpu(hdr->dest_nid);
-		ev->target.pid    = le32_to_cpu(hdr->dest_pid);
+		ev->target.nid    = hdr->dest_nid;
+		ev->target.pid    = hdr->dest_pid;
 		ev->initiator.nid = LNET_NID_ANY;
 		ev->initiator.pid = the_lnet.ln_pid;
 		ev->sender        = LNET_NID_ANY;
@@ -113,20 +113,20 @@ lnet_build_msg_event(lnet_msg_t *msg, lnet_event_kind_t ev_type)
 
 	case LNET_EVENT_SEND: /* active message */
 		if (msg->msg_type == LNET_MSG_PUT) {
-			ev->pt_index   = le32_to_cpu(hdr->msg.put.ptl_index);
-			ev->match_bits = le64_to_cpu(hdr->msg.put.match_bits);
-			ev->offset     = le32_to_cpu(hdr->msg.put.offset);
+			ev->pt_index   = hdr->msg.put.ptl_index;
+			ev->match_bits = hdr->msg.put.match_bits;
+			ev->offset     = hdr->msg.put.offset;
 			ev->mlength    =
-			ev->rlength    = le32_to_cpu(hdr->payload_length);
-			ev->hdr_data   = le64_to_cpu(hdr->msg.put.hdr_data);
+			ev->rlength    = hdr->payload_length;
+			ev->hdr_data   = hdr->msg.put.hdr_data;
 
 		} else {
 			LASSERT(msg->msg_type == LNET_MSG_GET);
-			ev->pt_index   = le32_to_cpu(hdr->msg.get.ptl_index);
-			ev->match_bits = le64_to_cpu(hdr->msg.get.match_bits);
+			ev->pt_index   = hdr->msg.get.ptl_index;
+			ev->match_bits = hdr->msg.get.match_bits;
 			ev->mlength    =
-			ev->rlength    = le32_to_cpu(hdr->msg.get.sink_length);
-			ev->offset     = le32_to_cpu(hdr->msg.get.src_offset);
+			ev->rlength    = hdr->msg.get.sink_length;
+			ev->offset     = hdr->msg.get.src_offset;
 			ev->hdr_data   = 0;
 		}
 		return;
@@ -381,7 +381,7 @@ lnet_complete_msg_locked(lnet_msg_t *msg, int cpt)
 
 		msg->msg_hdr.msg.ack.dst_wmd = ack_wmd;
 		msg->msg_hdr.msg.ack.match_bits = msg->msg_ev.match_bits;
-		msg->msg_hdr.msg.ack.mlength = cpu_to_le32(msg->msg_ev.mlength);
+		msg->msg_hdr.msg.ack.mlength = msg->msg_ev.mlength;
 
 		/* NB: we probably want to use NID of msg::msg_from as 3rd
 		 * parameter (router NID) if it's routed message */
Signature · 1 line
1.9.1
maintainer
#4 lore raw

Re: [Outreachy kernel] [PATCH 2/3] staging: lustre: lmv: Fix endian sparse warnings

In reply to Amitoj Kaur Chawla
Quoted 37 lines · Amitoj Kaur Chawla

Fix bug found using sparse which generates the following warning:

drivers/staging/lustre/lustre/lmv/lmv_obd.c:2422:25: warning:
incorrect type in assignment (different base types) drivers/staging/lustre/lustre/lmv/lmv_obd.c:2422:25: expected unsigned int [unsigned] [usertype] mea_magic drivers/staging/lustre/lustre/lmv/lmv_obd.c:2422:25: got restricted __le32 [usertype] <noident> drivers/staging/lustre/lustre/lmv/lmv_obd.c:2423:25: warning:
incorrect type in assignment (different base types) drivers/staging/lustre/lustre/lmv/lmv_obd.c:2423:25: expected unsigned int [unsigned] [usertype] mea_count drivers/staging/lustre/lustre/lmv/lmv_obd.c:2423:25: got restricted __le32 [usertype] <noident> drivers/staging/lustre/lustre/lmv/lmv_obd.c:2424:26: warning:
incorrect type in assignment (different base types) drivers/staging/lustre/lustre/lmv/lmv_obd.c:2424:26: expected unsigned int [unsigned] [usertype] mea_master drivers/staging/lustre/lustre/lmv/lmv_obd.c:2424:26: got restricted __le32 [usertype] <noident> drivers/staging/lustre/lustre/lmv/lmv_obd.c:2467:25: warning: cast to restricted __le32 drivers/staging/lustre/lustre/lmv/lmv_obd.c:2477:30: warning: cast to restricted __le32 drivers/staging/lustre/lustre/lmv/lmv_obd.c:2478:31: warning: cast to restricted __le32

---
 drivers/staging/lustre/lustre/lmv/lmv_obd.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/staging/lustre/lustre/lmv/lmv_obd.c +0 -0
index 7e6a060..8d90f19 100644

drivers/staging/lustre/lustre/lmv/lmv_obd.c static int lmv_packmd(struct obd_export *exp, struct lov_mds_md **lmmp, · line 2424

Quoted 9 lines
drivers/staging/lustre/lustre/lmv/lmv_obd.c +3 -3
@@ -2419,9 +2419,9 @@ static int lmv_packmd(struct obd_export *exp, struct lov_mds_md **lmmp,
 	    lsmp->mea_magic != MEA_MAGIC_ALL_CHARS)
 		return -EINVAL;
 
-	meap->mea_magic = cpu_to_le32(lsmp->mea_magic);
-	meap->mea_count = cpu_to_le32(lsmp->mea_count);
-	meap->mea_master = cpu_to_le32(lsmp->mea_master);
+	meap->mea_magic = lsmp->mea_magic;
+	meap->mea_count = lsmp->mea_count;
+	meap->mea_master = lsmp->mea_master;

Yes, deleting the calls will remove the warning, but maybe this isn't the correct fix? I think you just broke the code :(

There is a better fix here, a "correct" one, can you think of it?

thanks,

greg k-h

maintainer
#7 lore raw

Re: [Outreachy kernel] [PATCH 3/3] staging: lustre: lnet: Fix endian sparse warnings

In reply to Amitoj Kaur Chawla
Quoted 82 lines · Amitoj Kaur Chawla

Fix bug found using sparse which generates the following warning:

drivers/staging/lustre/lnet/lnet/lib-msg.c:72:37: warning: cast to restricted __le64 drivers/staging/lustre/lnet/lnet/lib-msg.c:73:37: warning: cast to restricted __le32 drivers/staging/lustre/lnet/lnet/lib-msg.c:116:42: warning: cast to restricted __le32 drivers/staging/lustre/lnet/lnet/lib-msg.c:117:42: warning: cast to restricted __le64 drivers/staging/lustre/lnet/lnet/lib-msg.c:118:42: warning: cast to restricted __le32 drivers/staging/lustre/lnet/lnet/lib-msg.c:120:42: warning: cast to restricted __le32 drivers/staging/lustre/lnet/lnet/lib-msg.c:121:42: warning: cast to restricted __le64 drivers/staging/lustre/lnet/lnet/lib-msg.c:125:42: warning: cast to restricted __le32 drivers/staging/lustre/lnet/lnet/lib-msg.c:126:42: warning: cast to restricted __le64 drivers/staging/lustre/lnet/lnet/lib-msg.c:128:42: warning: cast to restricted __le32 drivers/staging/lustre/lnet/lnet/lib-msg.c:129:42: warning: cast to restricted __le32 drivers/staging/lustre/lnet/lnet/lib-msg.c:384:46: warning: incorrect type in assignment (different base types) drivers/staging/lustre/lnet/lnet/lib-msg.c:384:46: expected unsigned int [unsigned] [usertype] mlength drivers/staging/lustre/lnet/lnet/lib-msg.c:384:46: got restricted __le32 [usertype] <noident>

---
 drivers/staging/lustre/lnet/lnet/lib-msg.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)
drivers/staging/lustre/lnet/lnet/lib-msg.c +11 -11
index 43977e8..4ad9a340 100644
@@ -69,8 +69,8 @@ lnet_build_msg_event(lnet_msg_t *msg, lnet_event_kind_t ev_type)
 
 	if (ev_type == LNET_EVENT_SEND) {
 		/* event for active message */
-		ev->target.nid    = le64_to_cpu(hdr->dest_nid);
-		ev->target.pid    = le32_to_cpu(hdr->dest_pid);
+		ev->target.nid    = hdr->dest_nid;
+		ev->target.pid    = hdr->dest_pid;
 		ev->initiator.nid = LNET_NID_ANY;
 		ev->initiator.pid = the_lnet.ln_pid;
 		ev->sender        = LNET_NID_ANY;
@@ -113,20 +113,20 @@ lnet_build_msg_event(lnet_msg_t *msg, lnet_event_kind_t ev_type)
 
 	case LNET_EVENT_SEND: /* active message */
 		if (msg->msg_type == LNET_MSG_PUT) {
-			ev->pt_index   = le32_to_cpu(hdr->msg.put.ptl_index);
-			ev->match_bits = le64_to_cpu(hdr->msg.put.match_bits);
-			ev->offset     = le32_to_cpu(hdr->msg.put.offset);
+			ev->pt_index   = hdr->msg.put.ptl_index;
+			ev->match_bits = hdr->msg.put.match_bits;
+			ev->offset     = hdr->msg.put.offset;
 			ev->mlength    =
-			ev->rlength    = le32_to_cpu(hdr->payload_length);
-			ev->hdr_data   = le64_to_cpu(hdr->msg.put.hdr_data);
+			ev->rlength    = hdr->payload_length;
+			ev->hdr_data   = hdr->msg.put.hdr_data;
 
 		} else {
 			LASSERT(msg->msg_type == LNET_MSG_GET);
-			ev->pt_index   = le32_to_cpu(hdr->msg.get.ptl_index);
-			ev->match_bits = le64_to_cpu(hdr->msg.get.match_bits);
+			ev->pt_index   = hdr->msg.get.ptl_index;
+			ev->match_bits = hdr->msg.get.match_bits;
 			ev->mlength    =
-			ev->rlength    = le32_to_cpu(hdr->msg.get.sink_length);
-			ev->offset     = le32_to_cpu(hdr->msg.get.src_offset);
+			ev->rlength    = hdr->msg.get.sink_length;
+			ev->offset     = hdr->msg.get.src_offset;
 			ev->hdr_data   = 0;
 		}
 		return;

drivers/staging/lustre/lnet/lnet/lib-msg.c lnet_complete_msg_locked(lnet_msg_t *msg, int cpt) · line 384

Quoted 5 lines
drivers/staging/lustre/lnet/lnet/lib-msg.c +1 -1
@@ -381,7 +381,7 @@ lnet_complete_msg_locked(lnet_msg_t *msg, int cpt)
 
 		msg->msg_hdr.msg.ack.dst_wmd = ack_wmd;
 		msg->msg_hdr.msg.ack.match_bits = msg->msg_ev.match_bits;
-		msg->msg_hdr.msg.ack.mlength = cpu_to_le32(msg->msg_ev.mlength);
+		msg->msg_hdr.msg.ack.mlength = msg->msg_ev.mlength;

Same issue with this patch, I think you just broke things :(

maintainer
#2 lore raw

Re: [Outreachy kernel] [PATCH 1/3] staging: rts5208: Fix endian sparse warnings

In reply to Amitoj Kaur Chawla
Quoted 31 lines · Amitoj Kaur Chawla

Fix bug found using sparse which gives the following warning:

drivers/staging/rts5208/rtsx_transport.c:217:34: warning: incorrect type in assignment (different base types) drivers/staging/rts5208/rtsx_transport.c:217:34: expected unsigned int [unsigned] [usertype] <noident> drivers/staging/rts5208/rtsx_transport.c:217:34: got restricted __le32 [usertype] <noident> drivers/staging/rts5208/rtsx_transport.c:316:44: warning: incorrect type in assignment (different base types) drivers/staging/rts5208/rtsx_transport.c:316:44: expected unsigned long long [unsigned] [long] [long long] [usertype] <noident> drivers/staging/rts5208/rtsx_transport.c:316:44: got restricted __le64 [usertype] <noident> drivers/staging/rts5208/rtsx_transport.c:316:44: warning: incorrect type in assignment (different base types) drivers/staging/rts5208/rtsx_transport.c:316:44: expected unsigned long long [unsigned] [long] [long long] [usertype] <noident> drivers/staging/rts5208/rtsx_transport.c:316:44: got restricted __le64 [usertype] <noident>

---
 drivers/staging/rts5208/rtsx_transport.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rts5208/rtsx_transport.c +0 -0
index f27491e..a650498 100644

drivers/staging/rts5208/rtsx_transport.c Handle_Errors: · line 207

Quoted 5 lines
drivers/staging/rts5208/rtsx_transport.c +1 -1
@@ -204,7 +204,7 @@ Handle_Errors:
 void rtsx_add_cmd(struct rtsx_chip *chip,
 		u8 cmd_type, u16 reg_addr, u8 mask, u8 data)
 {
-	u32 *cb = (u32 *)(chip->host_cmds_ptr);
+	__le32 *cb = (__le32 *)(chip->host_cmds_ptr);

Why __le32?

drivers/staging/rts5208/rtsx_transport.c finish_send_cmd: · line 300

Quoted 9 lines
drivers/staging/rts5208/rtsx_transport.c +1 -1
 	u32 val = 0;
 
 	val |= (u32)(cmd_type & 0x03) << 30;
@@ -297,7 +297,7 @@ finish_send_cmd:
 static inline void rtsx_add_sg_tbl(
 	struct rtsx_chip *chip, u32 addr, u32 len, u8 option)
 {
-	u64 *sgb = (u64 *)(chip->host_sg_tbl_ptr);
+	__le64 *sgb = (__le64 *)(chip->host_sg_tbl_ptr);

Why __le64?

thanks,

greg k-h

#5 lore raw

Re: [Outreachy kernel] [PATCH 2/3] staging: lustre: lmv: Fix endian sparse warnings

In reply to Greg KH
Quoted 51 lines · Greg KH
Quoted 37 lines · Amitoj Kaur Chawla

Fix bug found using sparse which generates the following warning:

drivers/staging/lustre/lustre/lmv/lmv_obd.c:2422:25: warning:
incorrect type in assignment (different base types) drivers/staging/lustre/lustre/lmv/lmv_obd.c:2422:25: expected unsigned int [unsigned] [usertype] mea_magic drivers/staging/lustre/lustre/lmv/lmv_obd.c:2422:25: got restricted __le32 [usertype] <noident> drivers/staging/lustre/lustre/lmv/lmv_obd.c:2423:25: warning:
incorrect type in assignment (different base types) drivers/staging/lustre/lustre/lmv/lmv_obd.c:2423:25: expected unsigned int [unsigned] [usertype] mea_count drivers/staging/lustre/lustre/lmv/lmv_obd.c:2423:25: got restricted __le32 [usertype] <noident> drivers/staging/lustre/lustre/lmv/lmv_obd.c:2424:26: warning:
incorrect type in assignment (different base types) drivers/staging/lustre/lustre/lmv/lmv_obd.c:2424:26: expected unsigned int [unsigned] [usertype] mea_master drivers/staging/lustre/lustre/lmv/lmv_obd.c:2424:26: got restricted __le32 [usertype] <noident> drivers/staging/lustre/lustre/lmv/lmv_obd.c:2467:25: warning: cast to restricted __le32 drivers/staging/lustre/lustre/lmv/lmv_obd.c:2477:30: warning: cast to restricted __le32 drivers/staging/lustre/lustre/lmv/lmv_obd.c:2478:31: warning: cast to restricted __le32

---
 drivers/staging/lustre/lustre/lmv/lmv_obd.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/staging/lustre/lustre/lmv/lmv_obd.c +0 -0
index 7e6a060..8d90f19 100644

drivers/staging/lustre/lustre/lmv/lmv_obd.c static int lmv_packmd(struct obd_export *exp, struct lov_mds_md **lmmp, · line 2424

Quoted 9 lines
drivers/staging/lustre/lustre/lmv/lmv_obd.c +3 -3
@@ -2419,9 +2419,9 @@ static int lmv_packmd(struct obd_export *exp, struct lov_mds_md **lmmp,
          lsmp->mea_magic != MEA_MAGIC_ALL_CHARS)
              return -EINVAL;
 
-     meap->mea_magic = cpu_to_le32(lsmp->mea_magic);
-     meap->mea_count = cpu_to_le32(lsmp->mea_count);
-     meap->mea_master = cpu_to_le32(lsmp->mea_master);
+     meap->mea_magic = lsmp->mea_magic;
+     meap->mea_count = lsmp->mea_count;
+     meap->mea_master = lsmp->mea_master;

Yes, deleting the calls will remove the warning, but maybe this isn't the correct fix? I think you just broke the code :(

Quoted 5 lines

There is a better fix here, a "correct" one, can you think of it?

thanks,

greg k-h

Umm, I can only think of changing the definition instead.

Signature · 1 line
Amitoj