diff mbox series

[ibdiags,14/16] ibdiags: Add missing endian conversions on constants

Message ID 20190409131133.16140-15-jgg@ziepe.ca (mailing list archive)
State Not Applicable
Headers show
Series More warning fixes for infiniband-diags | expand

Commit Message

Jason Gunthorpe April 9, 2019, 1:11 p.m. UTC
From: Jason Gunthorpe <jgg@mellanox.com>

These constants are all the same in both endians so this is no functional
change. Found by sparse.

Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
---
 src/ibsendtrap.c | 2 +-
 src/smpdump.c    | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/src/ibsendtrap.c b/src/ibsendtrap.c
index 8a3a3e6fd0449d..98d2b8b6c880dc 100644
--- a/src/ibsendtrap.c
+++ b/src/ibsendtrap.c
@@ -127,7 +127,7 @@  static void build_trap256_local(ib_mad_notice_attr_t * n, ib_portid_t * port)
 	n->g_or_v.generic.trap_num = htobe16(256);
 	n->issuer_lid = htobe16((uint16_t) port->lid);
 	n->data_details.ntc_256.lid = n->issuer_lid;
-	n->data_details.ntc_256.dr_slid = 0xffff;
+	n->data_details.ntc_256.dr_slid = htobe16(0xffff);
 	n->data_details.ntc_256.method = 1;
 	n->data_details.ntc_256.attr_id = htobe16(0x15);
 	n->data_details.ntc_256.attr_mod = htobe32(0x12);
diff --git a/src/smpdump.c b/src/smpdump.c
index cdd783600b602b..039eca03418016 100644
--- a/src/smpdump.c
+++ b/src/smpdump.c
@@ -93,8 +93,8 @@  static void drsmp_get_init(void *umad, DRPath * path, int attr, int mod)
 	smp->attr_id = htons(attr);
 	smp->attr_mod = htonl(mod);
 	smp->tid = htobe64(drmad_tid++);
-	smp->dr_slid = 0xffff;
-	smp->dr_dlid = 0xffff;
+	smp->dr_slid = htobe16(0xffff);
+	smp->dr_dlid = htobe16(0xffff);
 
 	umad_set_addr(umad, 0xffff, 0, 0, 0);