Static structure micro_bl_props, having type backlight_properties, is
used only once, when it is passed as the last argument to function
devm_backlight_device_register(). devm_backlight_device_register() is
defined with its last parameter being declared constant. Hence make
micro_bl_props itself constant as well.
Issue found with Coccinelle.
Signed-off-by: Nishka Dasgupta <redacted>
---
drivers/video/backlight/ipaq_micro_bl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
From: Daniel Thompson <hidden> Date: 2019-08-13 09:12:55
On Tue, Aug 13, 2019 at 02:28:55PM +0530, Nishka Dasgupta wrote:
Static structure micro_bl_props, having type backlight_properties, is
used only once, when it is passed as the last argument to function
devm_backlight_device_register(). devm_backlight_device_register() is
defined with its last parameter being declared constant. Hence make
micro_bl_props itself constant as well.
Issue found with Coccinelle.
Did you do any review to see if this pattern occurs in other backlight
drivers (it looks to me like the same pattern appears in
rave-sp-backlight.c... do the tools bring that one out as well).
Daniel.
From: Daniel Thompson <hidden> Date: 2019-09-03 16:19:27
On Tue, Aug 13, 2019 at 10:12:51AM +0100, Daniel Thompson wrote:
On Tue, Aug 13, 2019 at 02:28:55PM +0530, Nishka Dasgupta wrote:
quoted
Static structure micro_bl_props, having type backlight_properties, is
used only once, when it is passed as the last argument to function
devm_backlight_device_register(). devm_backlight_device_register() is
defined with its last parameter being declared constant. Hence make
micro_bl_props itself constant as well.
Issue found with Coccinelle.
Did you do any review to see if this pattern occurs in other backlight
drivers (it looks to me like the same pattern appears in
rave-sp-backlight.c... do the tools bring that one out as well).
On Tue, 3 Sep 2019 at 21:49, Daniel Thompson [off-list ref] wrote:
On Tue, Aug 13, 2019 at 10:12:51AM +0100, Daniel Thompson wrote:
quoted
On Tue, Aug 13, 2019 at 02:28:55PM +0530, Nishka Dasgupta wrote:
quoted
Static structure micro_bl_props, having type backlight_properties, is
used only once, when it is passed as the last argument to function
devm_backlight_device_register(). devm_backlight_device_register() is
defined with its last parameter being declared constant. Hence make
micro_bl_props itself constant as well.
Issue found with Coccinelle.
Did you do any review to see if this pattern occurs in other backlight
drivers (it looks to me like the same pattern appears in
rave-sp-backlight.c... do the tools bring that one out as well).
Ping?
Sorry, did my reply not go through?
I had said:
No, the Coccinelle script I'm using doesn't flag any other backlight
drivers. It's possible that the script just missed something. Which
structure in rave-sp-backlight.c could potentially be made const?
Thanking you,
Nishka
From: Daniel Thompson <hidden> Date: 2019-09-12 10:15:55
On Tue, Aug 13, 2019 at 02:28:55PM +0530, Nishka Dasgupta wrote:
Static structure micro_bl_props, having type backlight_properties, is
used only once, when it is passed as the last argument to function
devm_backlight_device_register(). devm_backlight_device_register() is
defined with its last parameter being declared constant. Hence make
micro_bl_props itself constant as well.
Issue found with Coccinelle.
Signed-off-by: Nishka Dasgupta <redacted>