From 4a3988e274f9f3f340dc4553f23102df3748a973 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Fri, 2 Dec 2011 02:39:43 +0000 Subject: [PATCH] Use get_unaligned_be16() for reading the two bytes specifying the buffer length to allow the compiler to generate better code for reading these two bytes. BSD-signed-off-by: Bart Van Assche git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3947 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index 14252684e..9f5d55d76 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -933,7 +933,7 @@ static int scst_set_lun_not_supported_inquiry(struct scst_cmd *cmd) } if (cmd->bufflen == 0) - cmd->bufflen = min_t(int, 36, (cmd->cdb[3] << 8) | cmd->cdb[4]); + cmd->bufflen = min_t(int, 36, get_unaligned_be16(&cmd->cdb[3])); cmd->sg = scst_alloc(cmd->bufflen, GFP_ATOMIC, &cmd->sg_cnt); if (cmd->sg == NULL) {