Re: [PATCH v2 1/2] spi: Add Renesas R-Car Gen3 RPC SPI controller driver

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

 



On 12/06/2018 10:12 AM, Geert Uytterhoeven wrote:
> Hi Mason,
> 
> On Thu, Dec 6, 2018 at 8:31 AM <masonccyang@xxxxxxxxxxx> wrote:
>>>>> Re: [PATCH v2 1/2] spi: Add Renesas R-Car Gen3 RPC SPI controller driver
>>>>>
>>>>> On 12/03/2018 10:18 AM, Mason Yang wrote:
>>>>>> Add a driver for Renesas R-Car Gen3 RPC SPI controller.
>>>>>>
>>>>>> Signed-off-by: Mason Yang <masonccyang@xxxxxxxxxxx>
> 
>>>>>> +   xfercnt = xferpos;
>>>>>> +   rpc->xferlen = xfer[--xferpos].len;
>>>>>> +   rpc->cmd = RPC_SMCMR_CMD(((u8 *)xfer[0].tx_buf)[0]);
>>>>>
>>>>> Is the cast needed ?
>>>>
>>>> yes!
>>>
>>> Why ?
>>
>> Get a compiler warning due to tx_bug is void *, as Geert replied.
>>
>> Using get_unaligned(), patched code would be
>> ---------------------------------------------------------------
>>  rpc->cmd = RPC_SMCMR_CMD(get_unaligned((u8 *)xfer[0].tx_buf));
>> ----------------------------------------------------------------
> 
> Using get_unaligned(0 is a bit strange for accessing a single byte quantity.
> Please keep the normal pointer dereference (including the cast).

Oh, right, for single bytes this is OK.

-- 
Best regards,
Marek Vasut



[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux