mirror of
https://github.com/SCST-project/scst.git
synced 2026-08-20 06:06:23 +00:00
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 <bvanassche@acm.org> git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3947 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
+1
-1
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user