lightnvm: pblk: print incompatible line version correctly

Correct it by converting little endian to cpu endian and also define
a macro for line version so that maintenance is easy.

Signed-off-by: Rakesh Pandit <rakesh@tuxera.com>
Reviewed-by: Javier González <javier@cnexlabs.com>
Signed-off-by: Matias Bjørling <m@bjorling.me>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
Rakesh Pandit
2017-10-13 14:45:59 +02:00
zatwierdzone przez Jens Axboe
rodzic c5493845b7
commit c79819bc08
3 zmienionych plików z 4 dodań i 3 usunięć

Wyświetl plik

@@ -900,9 +900,9 @@ struct pblk_line *pblk_recov_l2p(struct pblk *pblk)
if (le32_to_cpu(smeta_buf->header.identifier) != PBLK_MAGIC)
continue;
if (le16_to_cpu(smeta_buf->header.version) != 1) {
if (smeta_buf->header.version != SMETA_VERSION) {
pr_err("pblk: found incompatible line version %u\n",
smeta_buf->header.version);
le16_to_cpu(smeta_buf->header.version));
return ERR_PTR(-EINVAL);
}