All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][RESEND] block: sed-opal: fix u64 short atom length
@ 2018-03-01 13:27 Jonas Rabenstein
  2018-03-06 23:45 ` Derrick, Jonathan
  2018-03-07 16:55 ` [PATCH v2] " Jonas Rabenstein
  0 siblings, 2 replies; 7+ messages in thread
From: Jonas Rabenstein @ 2018-03-01 13:27 UTC (permalink / raw)
  To: Jonas Rabenstein, Scott Bauer, Jonathan Derrick, Jens Axboe
  Cc: linux-block, linux-kernel

The length must be given as bytes and not as 4 bit tuples.

Signed-off-by: Jonas Rabenstein <jonas.rabenstein@studium.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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-03-16 16:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-01 13:27 [PATCH][RESEND] block: sed-opal: fix u64 short atom length Jonas Rabenstein
2018-03-06 23:45 ` Derrick, Jonathan
2018-03-07 16:55 ` [PATCH v2] " Jonas Rabenstein
2018-03-07 23:24   ` Scott Bauer
2018-03-07 23:58     ` Jonas Rabenstein
2018-03-16 15:38   ` Scott Bauer
2018-03-16 16:14     ` Jens Axboe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.