Skip to contentSkip to conversation

IB/mthca: make type explicit in mthca_INIT_HCA()

PATCH New Dan Carpenter 1 participant 1 message Aug 16, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 IB/mthca: make type explicit in mthca_INIT_HCA()

The type of the second argument to the MTHCA_PUT() macro determines how many bytes will be written to inbox. Judging from the context, the current code is doing the right thing by writing an int of data. But I would feel more comfortable making it explicit that we are writing 32 bits.

This is just a cleanup.

drivers/infiniband/hw/mthca/mthca_cmd.c +1 -1
index 9d3e5c1..2d2a401 100644
@@ -1359,7 +1359,7 @@ int mthca_INIT_HCA(struct mthca_dev *dev,
 	memset(inbox, 0, INIT_HCA_IN_SIZE);
 
 	if (dev->mthca_flags & MTHCA_FLAG_SINAI_OPT)
-		MTHCA_PUT(inbox, 0x1, INIT_HCA_FLAGS1_OFFSET);
+		MTHCA_PUT(inbox, (u32)0x1, INIT_HCA_FLAGS1_OFFSET);
 
 #if defined(__LITTLE_ENDIAN)
 	*(inbox + INIT_HCA_FLAGS2_OFFSET / 4) &= ~cpu_to_be32(1 << 1);