mirror of
https://github.com/adulau/aha.git
synced 2025-01-04 07:03:38 +00:00
[SCSI] fc_transport: Generalize WWN to u64 interger conversions.
On some platforms the hard-casting of 8 byte node_name and port_name arrays to an u64 would cause unaligned-access warnings. Generalize the conversions with a transport helper function which performs consistent shifting of WWN bytes. Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
This commit is contained in:
parent
37be6eeb49
commit
218fba0004
1 changed files with 8 additions and 0 deletions
|
@ -439,4 +439,12 @@ int fc_remote_port_block(struct fc_rport *rport);
|
||||||
void fc_remote_port_unblock(struct fc_rport *rport);
|
void fc_remote_port_unblock(struct fc_rport *rport);
|
||||||
int scsi_is_fc_rport(const struct device *);
|
int scsi_is_fc_rport(const struct device *);
|
||||||
|
|
||||||
|
static inline u64 wwn_to_u64(u8 *wwn)
|
||||||
|
{
|
||||||
|
return (u64)wwn[0] << 56 | (u64)wwn[1] << 48 |
|
||||||
|
(u64)wwn[2] << 40 | (u64)wwn[3] << 32 |
|
||||||
|
(u64)wwn[4] << 24 | (u64)wwn[5] << 16 |
|
||||||
|
(u64)wwn[6] << 8 | (u64)wwn[7];
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* SCSI_TRANSPORT_FC_H */
|
#endif /* SCSI_TRANSPORT_FC_H */
|
||||||
|
|
Loading…
Reference in a new issue