You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
hpsa: get rid of type/attribute/direction bit field where possible
Using bit fields for hardware command fields isn't portable and relies on assumptions about how the compiler lays out the bits. We can fix this in the driver's internal command structure, but the ioctl interface we can't change because it is part of the userland ABI. Signed-off-by: Don Brace <don.brace@pmcs.com> Reviewed-by: Webb Scales <webb.scales@hp.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
committed by
Christoph Hellwig
parent
50a0decf75
commit
a505b86fde
+13
-5
@@ -320,11 +320,19 @@ struct CommandListHeader {
|
||||
|
||||
struct RequestBlock {
|
||||
u8 CDBLen;
|
||||
struct {
|
||||
u8 Type:3;
|
||||
u8 Attribute:3;
|
||||
u8 Direction:2;
|
||||
} Type;
|
||||
/*
|
||||
* type_attr_dir:
|
||||
* type: low 3 bits
|
||||
* attr: middle 3 bits
|
||||
* dir: high 2 bits
|
||||
*/
|
||||
u8 type_attr_dir;
|
||||
#define TYPE_ATTR_DIR(t, a, d) ((((d) & 0x03) << 6) |\
|
||||
(((a) & 0x07) << 3) |\
|
||||
((t) & 0x07))
|
||||
#define GET_TYPE(tad) ((tad) & 0x07)
|
||||
#define GET_ATTR(tad) (((tad) >> 3) & 0x07)
|
||||
#define GET_DIR(tad) (((tad) >> 6) & 0x03)
|
||||
u16 Timeout;
|
||||
u8 CDB[16];
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user