[alsa-devel] Help requested: new HSS1394 MIDI back-end

Takashi Iwai tiwai at suse.de
Mon Nov 12 12:40:14 CET 2012


At Mon, 12 Nov 2012 12:33:47 +0100,
Clemens Ladisch wrote:
> 
> 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.

OK, let me know when you push out the changes, so that I'll pull it.


thanks,

Takashi


More information about the Alsa-devel mailing list