Re: [PATCH 2/2] ASoC: hdmi-codec: add channel mapping control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Dec 12 2016 21:55, Takashi Iwai wrote:
On Mon, 12 Dec 2016 13:12:16 +0100,
Takashi Sakamoto wrote:

On Dec 12 2016 18:54, Takashi Iwai wrote:
+enum hdmi_codec_cea_spk_placement {
+	FL  = (1 <<  0),	/* Front Left           */
+	FC  = (1 <<  1),	/* Front Center         */
+	FR  = (1 <<  2),	/* Front Right          */
+	FLC = (1 <<  3),	/* Front Left Center    */
+	FRC = (1 <<  4),	/* Front Right Center   */
+	RL  = (1 <<  5),	/* Rear Left            */
+	RC  = (1 <<  6),	/* Rear Center          */
+	RR  = (1 <<  7),	/* Rear Right           */
+	RLC = (1 <<  8),	/* Rear Left Center     */
+	RRC = (1 <<  9),	/* Rear Right Center    */
+	LFE = (1 << 10),	/* Low Frequency Effect */
+};

BIT() macro in "linux/bitops.h" is available.
will be corrected in a v2

One slight caution: BIT() expands to an unsigned long type.

Mmm, indeed. This is my wrong indication, sorry.
Thanks for your correction.

Well, it's not necessarily wrong.  My point is that it requires
caution sometimes, as it's not blindly convertible.
In short: it depends on the code.

Hm. Here, I prefer to avoiding needless type-coversions, especially between 'signed' and 'unsigned'. In C semantics of enumerator specifiers, these values are handled as 'int' type. On the other hand, the BIT() macro has 'UL' suffix.

In short: carefulness.


Regards

Takashi Sakamoto
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux