diff options
author | Bart Van Assche <bart.vanassche@sandisk.com> | 2017-05-23 16:48:27 -0700 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2017-07-06 22:57:59 -0700 |
commit | a85d667e58bddf73be84d1981b41eaac985ed216 (patch) | |
tree | b997450b0dce7048845834d1756a7e12cb19d069 /drivers/target/target_core_xcopy.c | |
parent | f2b72d6a8eed0eb02e6346886514a27df1efe827 (diff) | |
download | op-kernel-dev-a85d667e58bddf73be84d1981b41eaac985ed216.zip op-kernel-dev-a85d667e58bddf73be84d1981b41eaac985ed216.tar.gz |
target: Use {get,put}_unaligned_be*() instead of open coding these functions
Introduce the function get_unaligned_be24(). Use {get,put}_unaligned_be*()
where appropriate. This patch does not change any functionality.
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Cc: Andy Grover <agrover@redhat.com>
Cc: David Disseldorp <ddiss@suse.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target/target_core_xcopy.c')
-rw-r--r-- | drivers/target/target_core_xcopy.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/target/target_core_xcopy.c b/drivers/target/target_core_xcopy.c index cac5a20..f12cf0c 100644 --- a/drivers/target/target_core_xcopy.c +++ b/drivers/target/target_core_xcopy.c @@ -311,9 +311,7 @@ static int target_xcopy_parse_segdesc_02(struct se_cmd *se_cmd, struct xcopy_op (unsigned long long)xop->dst_lba); if (dc != 0) { - xop->dbl = (desc[29] & 0xff) << 16; - xop->dbl |= (desc[30] & 0xff) << 8; - xop->dbl |= desc[31] & 0xff; + xop->dbl = get_unaligned_be24(&desc[29]); pr_debug("XCOPY seg desc 0x02: DC=1 w/ dbl: %u\n", xop->dbl); } |