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] [thread-next>] [day] [month] [year] [list]
Message-ID: <54505b20-a9c6-9ade-dced-cb4c24df0770@cmss.chinamobile.com>
Date:   Wed, 11 Aug 2021 21:47:10 +0800
From:   tangbin <tangbin@...s.chinamobile.com>
To:     "Russell King (Oracle)" <linux@...linux.org.uk>
Cc:     linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] ARM/smp_twd: Cleanup the unnecessary cast

Hi Russell:

On 2021/8/11 21:31, Russell King (Oracle) wrote:
> On Wed, Aug 11, 2021 at 09:15:12PM +0800, Tang Bin wrote:
>> It's not necessary to specify 'int' castingfor 'PTR_ERR(twd_clk)'.
>>
>> Signed-off-by: Tang Bin <tangbin@...s.chinamobile.com>
>> ---
>>   arch/arm/kernel/smp_twd.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c
>> index 9a14f721a..423e9079d 100644
>> --- a/arch/arm/kernel/smp_twd.c
>> +++ b/arch/arm/kernel/smp_twd.c
>> @@ -199,7 +199,7 @@ static void twd_get_clock(struct device_node *np)
>>   		twd_clk = clk_get_sys("smp_twd", NULL);
>>   
>>   	if (IS_ERR(twd_clk)) {
>> -		pr_err("smp_twd: clock not found %d\n", (int) PTR_ERR(twd_clk));
>> +		pr_err("smp_twd: clock not found %d\n", PTR_ERR(twd_clk));
> Sorry, NAK.
>
> This change _will_ produce a compiler warning. "%d" expects an argument
> of type "int", but PTR_ERR() returns a type of "long". Sorry, but the
> cast is entirely necessary.
>
> A better solution today would be to get rid of the PTR_ERR() entirely
> and use %pe, which will get us a textual description of the error when
> the appropriate kernel configuration option is enabled.
>
Got it, Thanks.
>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ