Re: [RFC/PATCH v6 02/12] media: Media device

From: Andy Walls
Date: Thu Nov 25 2010 - 12:20:43 EST


The signedness of char is ambiguous for 8 bit data, which is why an API would normally use u8 (or s8, I guess).

Since this is known to be character data, I would think char would be fine. I am assuming C compilers would never assume multibyte "char"s.

Regards,
Andy

Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx> wrote:

>Hi Clemens,
>
>Thanks for the review.
>
>On Thursday 25 November 2010 10:33:02 Clemens Ladisch wrote:
>> Laurent Pinchart wrote:
>> > +struct media_device {
>> > ...
>> > + u8 model[32];
>> > + u8 serial[40];
>> > + u8 bus_info[32];
>>
>> All drivers and userspace applications have to treat this as char[], so
>> why u8[]?
>
>Good question. I've copied the V4L2 practice of using u8 (or __u8) for fixed-
>length strings in structures. I can't think of any reason for that.
>
>I will replace u8 with char unless someone comes up with a good reason to keep
>u8.
>
>--
>Regards,
>
>Laurent Pinchart
>--
>To unsubscribe from this list: send the line "unsubscribe linux-media" in
>the body of a message to majordomo@xxxxxxxxxxxxxxx
>More majordomo info at http://vger.kernel.org/majordomo-info.html
N‹§²æìr¸›yúèšØb²X¬¶ÇvØ^–)Þ{.nÇ+‰·¥Š{±‘êçzX§¶›¡Ü}©ž²ÆzÚ&j:+v‰¨¾«‘êçzZ+€Ê+zf£¢·hšˆ§~†­†Ûiÿûàz¹®w¥¢¸?™¨è­Ú&¢)ßf”ù^jÇy§m…á@A«a¶Úÿ 0¶ìh®å’i