12 Nov
2012
12 Nov
'12
12:33 p.m.
Takashi Iwai wrote:
Clemens Ladisch wrote:
+static int scs_init_hss_address(struct scs *scs) +{
- u8 data[8];
- int err;
- *(__be64 *)data = cpu_to_be64(scs->hss_handler.offset);
Wouldn't it be safer to use unaligned access or a union?
Oops, indeed. But safest would be to avoid playing byte-array games:
__be64 data = cpu_to_be64(((u64)HSS1394_TAG_CHANGE_ADDRESS << 56) | scs->hss_handler.offset);
Now fixed in the same branch.
Regards, Clemens