Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1240025

Re: [PATCH] usb: gadget: f_uac1: Convert use of __constant_cpu_to_le16 to cpu_to_le16

From Felipe Balbi <balbi@ti.com>
Newsgroups linux.kernel
Subject Re: [PATCH] usb: gadget: f_uac1: Convert use of __constant_cpu_to_le16 to cpu_to_le16
Date 2015-10-06 01:30 +0200
Message-ID <qgnmF-5iM-3@gated-at.bofh.it> (permalink)
References <pZ4gq-4Yl-11@gated-at.bofh.it> <pZvJE-2Cq-13@gated-at.bofh.it> <q06ga-4Gw-9@gated-at.bofh.it> <q0VVn-3cH-7@gated-at.bofh.it> <q0Xu9-5hU-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

Vaishali Thakkar <vthakkar1994@gmail.com> writes:

> On Mon, Aug 24, 2015 at 2:29 PM, David Laight <David.Laight@aculab.com> wrote:
>> From: Vaishali Thakkar [mailto:vthakkar1994@gmail.com]
>>> Sent: 22 August 2015 02:57
>> ...
>>> >> -     .bcdADC =               __constant_cpu_to_le16(0x0100),
>>> >> -     .wTotalLength =         __constant_cpu_to_le16(UAC_DT_TOTAL_LENGTH),
>>> >> +     .bcdADC =               cpu_to_le16(0x0100),
>>> >> +     .wTotalLength =         cpu_to_le16(UAC_DT_TOTAL_LENGTH),
>>> >
>>> > Have you test compiled this on a big-endian system?
>>> > My gut feeling is that is fails.
>>>
>>> No. I have tested it on little-endian system only. But I'll
>>> be really surprised if this will fail. Can you please tell me
>>> if I am missing something in this particular case or same
>>> applies for other cases because most of the cases like
>>> __constant_<foo> are already converted to <foo>?
>>>
>>> As far as I know, if the argument is a constant the
>>> conversion happens at compile time. And unfolding both
>>> definitions returns to same expression. Still I am trying if
>>> someone can test it for me on big endian system.
>>
>> Flip one to cpu_to_be16() and see if it still compiles.
>
> Yes. It still compiles.

it's unclear to me if this is really safe to apply. Until then I'm
dropping this from queue. Seems like, at a minimum, we need a better
commit log

-- 
balbi

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: [PATCH] usb: gadget: f_uac1: Convert use of __constant_cpu_to_le16 to cpu_to_le16 Felipe Balbi <balbi@ti.com> - 2015-10-06 01:30 +0200
  Re: [PATCH] usb: gadget: f_uac1: Convert use of __constant_cpu_to_le16  to cpu_to_le16 Vaishali Thakkar <vthakkar1994@gmail.com> - 2015-10-06 03:40 +0200

csiph-web