nvme: lightnvm: make MLC num_pairs little endian
authorJohannes Thumshirn <jthumshirn@suse.de>
Thu, 7 Jul 2016 07:54:10 +0000 (09:54 +0200)
committerJens Axboe <axboe@fb.com>
Thu, 7 Jul 2016 14:51:52 +0000 (08:51 -0600)
According to the OpenChannel SSD interface specification the NAND flash
MLC page pairing information's number of page page pairings field is the
first two bytes in the MLC Page Pairing data structure. The hardware's
data structure itself is little endian so annotate it as such, like the
rest of lighnvm's data structures.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Matias Bjørling <m@bjorling.me>
Signed-off-by: Jens Axboe <axboe@fb.com>
drivers/nvme/host/lightnvm.c

index a0af0558354c304f1b1ef68e9953acd22731c645..97fe6109c98f4af993e3842d2afef88328302601 100644 (file)
@@ -156,7 +156,7 @@ struct nvme_nvm_completion {
 
 #define NVME_NVM_LP_MLC_PAIRS 886
 struct nvme_nvm_lp_mlc {
-       __u16                   num_pairs;
+       __le16                  num_pairs;
        __u8                    pairs[NVME_NVM_LP_MLC_PAIRS];
 };