Thread (5 messages) 5 messages, 3 authors, 2018-01-02

Re: thermal/drivers/hisi: Remove bogus const from function return type

From: Eduardo Valentin <edubezval@gmail.com>
Date: 2018-01-01 18:21:31
Also in: lkml

Hello Geert,

On Sun, Nov 19, 2017 at 12:04:27PM +0100, Geert Uytterhoeven wrote:
With gcc-4.1.2:

    drivers/thermal/hisi_thermal.c: In function ‘hisi_thermal_probe’:
    drivers/thermal/hisi_thermal.c:530: warning: type qualifiers ignored on function return type

Remove the "const" keyword to fix this.
Interesting.

I intentionally asked Daniel to include the modifier because sparse
pointed this to me:

This patch adds this issue to hisi driver (sparse)

drivers/thermal/hisi_thermal.c:398:24: warning: incorrect type in assignment (different modifiers)
drivers/thermal/hisi_thermal.c:398:24:    expected int ( *platform_probe )( ... )
drivers/thermal/hisi_thermal.c:398:24:    got void const *

which makes sense to me to be const, given that it is receiving the return 
of a function which returns a const void *. 
nclude/linux/of_device.h:extern const void *of_device_get_match_data(const struct device *dev);

Cheers,
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help