Skip to content

Commit b1898b7

Browse files
committed
libnvme/cmds: fix nvme_init_copy_range_elbt for big endian build
Since the function just depended on the little endian build. Signed-off-by: Tokunori Ikegami <[email protected]>
1 parent 612a752 commit b1898b7

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

libnvme/src/nvme/cmds.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5247,7 +5247,11 @@ nvme_init_copy_range_elbt(__u8 *elbt, __u8 *eilbrt, int size)
52475247
int i;
52485248

52495249
for (i = 0; i < size; i++)
5250+
#if __BYTE_ORDER == __LITTLE_ENDIAN
52505251
elbt[size - 1 - i] = eilbrt[i];
5252+
#else /* __BYTE_ORDER == __LITTLE_ENDIAN */
5253+
elbt[i] = eilbrt[i];
5254+
#endif /* __BYTE_ORDER == __LITTLE_ENDIAN */
52515255
}
52525256

52535257
/**

0 commit comments

Comments
 (0)