scsi: treewide: Consolidate {get,put}_unaligned_[bl]e24() definitions
Move the get_unaligned_be24(), get_unaligned_le24() and put_unaligned_le24() definitions from various drivers into include/linux/unaligned/generic.h. Add a put_unaligned_be24() implementation. Link: https://lore.kernel.org/r/20200313203102.16613-4-bvanassche@acm.org Cc: Keith Busch <kbusch@kernel.org> Cc: Sagi Grimberg <sagi@grimberg.me> Cc: Jens Axboe <axboe@fb.com> Cc: Harvey Harrison <harvey.harrison@gmail.com> Cc: Martin K. Petersen <martin.petersen@oracle.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Andrew Morton <akpm@linux-foundation.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> # For drivers/usb Reviewed-by: Felipe Balbi <balbi@kernel.org> # For drivers/usb/gadget Signed-off-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:

committed by
Martin K. Petersen

parent
7251c0a410
commit
a7afff31d5
@@ -116,10 +116,4 @@ static inline bool target_dev_configured(struct se_device *se_dev)
|
||||
return !!(se_dev->dev_flags & DF_CONFIGURED);
|
||||
}
|
||||
|
||||
/* Only use get_unaligned_be24() if reading p - 1 is allowed. */
|
||||
static inline uint32_t get_unaligned_be24(const uint8_t *const p)
|
||||
{
|
||||
return get_unaligned_be32(p - 1) & 0xffffffU;
|
||||
}
|
||||
|
||||
#endif /* TARGET_CORE_BACKEND_H */
|
||||
|
Reference in New Issue
Block a user