[PATCH v4] sound: rawmidi: Add framing mode

Takashi Iwai tiwai at suse.de
Mon Apr 12 13:54:22 CEST 2021


On Mon, 12 Apr 2021 13:44:45 +0200,
Jaroslav Kysela wrote:
> 
> Dne 12. 04. 21 v 13:17 Takashi Iwai napsal(a):
> 
> >> In this case, we have 31 free bits and this information can be stored there. I
> >> would prefer to keep the reserved bytes for some large fields.
> > 
> > Again, C language doesn't define the position of the bit fields.
> > That's the primary problem.
> 
> Yes and no. It seems that it's not a big C compiler implementation problem,
> because other drivers are using the bitfields in the uapi structures, too.
> Yes, it may need some extra care.

Right, and the need for care is mostly for little merit -- that's the
point.  I'm not against about the bit flags at all, but pointing that
the C bit fields are too error-prone for ioctl structs.

> > If we really have to save the space, it's a nice workaround.  But for
> > other purposes, there is really little merit and more flip side by
> > that.
> 
> I see your reluctance to talk about extension of the bit field word, but
> perhaps, we may be clever and define the flag word for the newly added
> parameters now. The space may be used more precisely in the future with this
> change.

Sure, that pattern is common and recommended for bit-wise flags.


thanks,

Takashi


More information about the Alsa-devel mailing list