lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Wed, 5 Dec 2018 13:35:34 +0100
From:   Marek Vasut <marek.vasut@...il.com>
To:     Geert Uytterhoeven <geert@...ux-m68k.org>, masonccyang@...c.com.tw
Cc:     Boris Brezillon <boris.brezillon@...tlin.com>,
        Mark Brown <broonie@...nel.org>,
        Geert Uytterhoeven <geert+renesas@...der.be>,
        Simon Horman <horms@...ge.net.au>, juliensu@...c.com.tw,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Linux-Renesas <linux-renesas-soc@...r.kernel.org>,
        linux-spi <linux-spi@...r.kernel.org>, zhengxunli@...c.com.tw
Subject: Re: [PATCH v2 1/2] spi: Add Renesas R-Car Gen3 RPC SPI controller
 driver

On 12/05/2018 10:11 AM, Geert Uytterhoeven wrote:
> Hi Mason,
> 
> On Wed, Dec 5, 2018 at 8:44 AM <masonccyang@...c.com.tw> wrote:
>>> "Marek Vasut" <marek.vasut@...il.com>
>>> 2018/12/05 上午 10:04
>>> 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@...c.com.tw>
> 
>>>> +static u8 rpc_bits_xfer(u32 nbytes)
>>>> +{
>>>> +   if (nbytes > 4)
>>>> +      nbytes = 4;
>>>
>>> Use clamp() ?
>>>
>>
>> nbytes = clamp(nbytes, 1, 4);
>>
>> got many warnings, something like,
>> ./include/linux/kernel.h:845:29: warning: comparison of distinct pointer types lacks a cast
> 
> You can either make the constants unsigned (1U and 4U), or
> use clamp_t(u32, ...).
> 
>>>> +         rpc->smenr |= RPC_SMENR_SPIDE(rpc_bits_xfer
>>>> +               (op->data.nbytes)) | RPC_SMENR_SPIDB
>>>> +               (fls(op->data.buswidth >> 1));
>>>
>>> Drop parenthesis around fls()
>>
>> ?
>> no way.
> 
> Please split the line before RPC_SMENR_SPIDB, and join the next line
> with the parameters, so it becomes obvious the parentheses are needed
> because RPC_SMENR_SPIDB() is a macro taking parameters.

Oh, I didn't notice that, right.

-- 
Best regards,
Marek Vasut

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ