[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20180220192039.3912-2-jonas.rabenstein@studium.uni-erlangen.de>
Date: Tue, 20 Feb 2018 20:20:39 +0100
From: Jonas Rabenstein <jonas.rabenstein@...dium.uni-erlangen.de>
To: Jonas Rabenstein <jonas.rabenstein@...dium.uni-erlangen.de>,
Scott Bauer <scott.bauer@...el.com>,
Jonathan Derrick <jonathan.derrick@...el.com>,
Jens Axboe <axboe@...nel.dk>
Cc: linux-block@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] block: sed-opal: fix u64 short atom length
The length must be given as bytes and not as 4 bit tuples.
Signed-off-by: Jonas Rabenstein <jonas.rabenstein@...dium.uni-erlangen.de>
---
block/sed-opal.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/block/sed-opal.c b/block/sed-opal.c
index 36842bfa572e..d5f565e1557a 100644
--- a/block/sed-opal.c
+++ b/block/sed-opal.c
@@ -562,7 +562,7 @@ static void add_token_u64(int *err, struct opal_dev *cmd, u64 number)
}
msb = fls(number);
- len = DIV_ROUND_UP(msb, 4);
+ len = DIV_ROUND_UP(msb, 8);
if (cmd->pos >= IO_BUFFER_LENGTH - len - 1) {
pr_debug("Error adding u64: end of buffer.\n");
--
2.13.6
Powered by blists - more mailing lists