On Fri, Aug 26, 2005 at 07:09:50PM -0700, Andrew Vasquez wrote:
> Generalize WWN to u64 interger conversions.
>
> On some platforms the hard-casting of the 8 byte node_name
> and port_name arrays to an u64 would cause unaligned-access
> warnings. Generalize the conversions with consistent
> shifting of WWN bytes.
>
> Signed-off-by: Andrew Vasquez <[EMAIL PROTECTED]>
> ---
>
> drivers/scsi/qla2xxx/qla_attr.c | 27 +++++++++++++++++----------
> 1 files changed, 17 insertions(+), 10 deletions(-)
>
> c7a5df1dc950e8a1cc04aa9a184619dfc78e5ed6
> diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c
> --- a/drivers/scsi/qla2xxx/qla_attr.c
> +++ b/drivers/scsi/qla2xxx/qla_attr.c
> @@ -345,6 +345,15 @@ struct class_device_attribute *qla2x00_h
>
> /* Host attributes. */
>
> +static u64
> +wwn_to_u64(uint8_t *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];
> +}
Shouldn't this go into the transport class? Could probably be an inline
aswell.
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html