2024-04-24 06:34:49

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH v2 00/19] backlight: Constify lcd_ops

Hi,

Changes in v2:
- Collect tags, including wrongly places Thomas' tag (which requires me
to manually edit 15 other patches to drop it).
- Combine here checkpatch patch:
https://lore.kernel.org/all/[email protected]/
- Link to v1: https://lore.kernel.org/r/[email protected]

Dependencies
============
All further patches depend on the first patch. Therefore everything
could go via backlight tree (please ack) or via cross-tree pulls. Or
whatever maintainer choose, just coordinate this with backlight.

Best regards,
Krzysztof

---
Krzysztof Kozlowski (19):
backlight: Constify lcd_ops
backlight: ams369fg06: Constify lcd_ops
backlight: corgi_lcd: Constify lcd_ops
backlight: hx8357: Constify lcd_ops
backlight: ili922x: Constify lcd_ops
backlight: ili9320: Constify lcd_ops
backlight: jornada720_lcd: Constify lcd_ops
backlight: l4f00242t03: Constify lcd_ops
backlight: lms283gf05: Constify lcd_ops
backlight: lms501kf03: Constify lcd_ops
backlight: ltv350qv: Constify lcd_ops
backlight: otm3225a: Constify lcd_ops
backlight: platform_lcd: Constify lcd_ops
backlight: tdo24m: Constify lcd_ops
HID: picoLCD: Constify lcd_ops
fbdev: clps711x: Constify lcd_ops
fbdev: imx: Constify lcd_ops
fbdev: omap: lcd_ams_delta: Constify lcd_ops
const_structs.checkpatch: add lcd_ops

drivers/hid/hid-picolcd_lcd.c | 2 +-
drivers/video/backlight/ams369fg06.c | 2 +-
drivers/video/backlight/corgi_lcd.c | 2 +-
drivers/video/backlight/hx8357.c | 2 +-
drivers/video/backlight/ili922x.c | 2 +-
drivers/video/backlight/ili9320.c | 2 +-
drivers/video/backlight/jornada720_lcd.c | 2 +-
drivers/video/backlight/l4f00242t03.c | 2 +-
drivers/video/backlight/lcd.c | 4 ++--
drivers/video/backlight/lms283gf05.c | 2 +-
drivers/video/backlight/lms501kf03.c | 2 +-
drivers/video/backlight/ltv350qv.c | 2 +-
drivers/video/backlight/otm3225a.c | 2 +-
drivers/video/backlight/platform_lcd.c | 2 +-
drivers/video/backlight/tdo24m.c | 2 +-
drivers/video/fbdev/clps711x-fb.c | 2 +-
drivers/video/fbdev/imxfb.c | 2 +-
drivers/video/fbdev/omap/lcd_ams_delta.c | 2 +-
include/linux/lcd.h | 6 +++---
scripts/const_structs.checkpatch | 1 +
20 files changed, 23 insertions(+), 22 deletions(-)
---
base-commit: a59668a9397e7245b26e9be85d23f242ff757ae8
change-id: 20240414-video-backlight-lcd-ops-276d8439ffb8

Best regards,
--
Krzysztof Kozlowski <[email protected]>



2024-04-24 06:34:58

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH v2 01/19] backlight: Constify lcd_ops

'struct lcd_ops' passed in lcd_device_register() is not modified by core
backlight code, so it can be made const for code safety. This allows
drivers to also define the structure as const.

Reviewed-by: Daniel Thompson <[email protected]>
Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
drivers/video/backlight/lcd.c | 4 ++--
include/linux/lcd.h | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/video/backlight/lcd.c b/drivers/video/backlight/lcd.c
index ba4771cbd781..ceec90ca758b 100644
--- a/drivers/video/backlight/lcd.c
+++ b/drivers/video/backlight/lcd.c
@@ -191,7 +191,7 @@ static const struct class lcd_class = {
* or a pointer to the newly allocated device.
*/
struct lcd_device *lcd_device_register(const char *name, struct device *parent,
- void *devdata, struct lcd_ops *ops)
+ void *devdata, const struct lcd_ops *ops)
{
struct lcd_device *new_ld;
int rc;
@@ -279,7 +279,7 @@ static int devm_lcd_device_match(struct device *dev, void *res, void *data)
*/
struct lcd_device *devm_lcd_device_register(struct device *dev,
const char *name, struct device *parent,
- void *devdata, struct lcd_ops *ops)
+ void *devdata, const struct lcd_ops *ops)
{
struct lcd_device **ptr, *lcd;

diff --git a/include/linux/lcd.h b/include/linux/lcd.h
index 238fb1dfed98..68703a51dc53 100644
--- a/include/linux/lcd.h
+++ b/include/linux/lcd.h
@@ -61,7 +61,7 @@ struct lcd_device {
points to something in the body of that driver, it is also invalid. */
struct mutex ops_lock;
/* If this is NULL, the backing module is unloaded */
- struct lcd_ops *ops;
+ const struct lcd_ops *ops;
/* Serialise access to set_power method */
struct mutex update_lock;
/* The framebuffer notifier block */
@@ -102,10 +102,10 @@ static inline void lcd_set_power(struct lcd_device *ld, int power)
}

extern struct lcd_device *lcd_device_register(const char *name,
- struct device *parent, void *devdata, struct lcd_ops *ops);
+ struct device *parent, void *devdata, const struct lcd_ops *ops);
extern struct lcd_device *devm_lcd_device_register(struct device *dev,
const char *name, struct device *parent,
- void *devdata, struct lcd_ops *ops);
+ void *devdata, const struct lcd_ops *ops);
extern void lcd_device_unregister(struct lcd_device *ld);
extern void devm_lcd_device_unregister(struct device *dev,
struct lcd_device *ld);

--
2.43.0


2024-04-24 06:35:15

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH v2 02/19] backlight: ams369fg06: Constify lcd_ops

'struct lcd_ops' is not modified by core backlight code, so it can be
made const for increased code safety.

Reviewed-by: Daniel Thompson <[email protected]>
Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
drivers/video/backlight/ams369fg06.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/backlight/ams369fg06.c b/drivers/video/backlight/ams369fg06.c
index 522dd81110b8..57ec205d2bd2 100644
--- a/drivers/video/backlight/ams369fg06.c
+++ b/drivers/video/backlight/ams369fg06.c
@@ -427,7 +427,7 @@ static int ams369fg06_set_brightness(struct backlight_device *bd)
return ret;
}

-static struct lcd_ops ams369fg06_lcd_ops = {
+static const struct lcd_ops ams369fg06_lcd_ops = {
.get_power = ams369fg06_get_power,
.set_power = ams369fg06_set_power,
};

--
2.43.0


2024-04-24 06:35:50

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH v2 04/19] backlight: hx8357: Constify lcd_ops

'struct lcd_ops' is not modified by core backlight code, so it can be
made const for increased code safety.

Reviewed-by: Daniel Thompson <[email protected]>
Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
drivers/video/backlight/hx8357.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/backlight/hx8357.c b/drivers/video/backlight/hx8357.c
index 339d9128fbde..cdd7b7686723 100644
--- a/drivers/video/backlight/hx8357.c
+++ b/drivers/video/backlight/hx8357.c
@@ -559,7 +559,7 @@ static int hx8357_get_power(struct lcd_device *lcdev)
return lcd->state;
}

-static struct lcd_ops hx8357_ops = {
+static const struct lcd_ops hx8357_ops = {
.set_power = hx8357_set_power,
.get_power = hx8357_get_power,
};

--
2.43.0


2024-04-24 06:36:06

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH v2 05/19] backlight: ili922x: Constify lcd_ops

'struct lcd_ops' is not modified by core backlight code, so it can be
made const for increased code safety.

Reviewed-by: Daniel Thompson <[email protected]>
Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
drivers/video/backlight/ili922x.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/backlight/ili922x.c b/drivers/video/backlight/ili922x.c
index c8e0e655dc86..7683e209ad6b 100644
--- a/drivers/video/backlight/ili922x.c
+++ b/drivers/video/backlight/ili922x.c
@@ -472,7 +472,7 @@ static int ili922x_get_power(struct lcd_device *ld)
return ili->power;
}

-static struct lcd_ops ili922x_ops = {
+static const struct lcd_ops ili922x_ops = {
.get_power = ili922x_get_power,
.set_power = ili922x_set_power,
};

--
2.43.0


2024-04-24 06:36:12

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH v2 03/19] backlight: corgi_lcd: Constify lcd_ops

'struct lcd_ops' is not modified by core backlight code, so it can be
made const for increased code safety.

Reviewed-by: Daniel Thompson <[email protected]>
Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
drivers/video/backlight/corgi_lcd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/backlight/corgi_lcd.c b/drivers/video/backlight/corgi_lcd.c
index dd765098ad98..aad1680c9075 100644
--- a/drivers/video/backlight/corgi_lcd.c
+++ b/drivers/video/backlight/corgi_lcd.c
@@ -380,7 +380,7 @@ static int corgi_lcd_get_power(struct lcd_device *ld)
return lcd->power;
}

-static struct lcd_ops corgi_lcd_ops = {
+static const struct lcd_ops corgi_lcd_ops = {
.get_power = corgi_lcd_get_power,
.set_power = corgi_lcd_set_power,
.set_mode = corgi_lcd_set_mode,

--
2.43.0


2024-04-24 06:36:23

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH v2 06/19] backlight: ili9320: Constify lcd_ops

'struct lcd_ops' is not modified by core backlight code, so it can be
made const for increased code safety.

Reviewed-by: Daniel Thompson <[email protected]>
Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
drivers/video/backlight/ili9320.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/backlight/ili9320.c b/drivers/video/backlight/ili9320.c
index 2acd2708f8ca..3e318d1891b6 100644
--- a/drivers/video/backlight/ili9320.c
+++ b/drivers/video/backlight/ili9320.c
@@ -161,7 +161,7 @@ static int ili9320_get_power(struct lcd_device *ld)
return lcd->power;
}

-static struct lcd_ops ili9320_ops = {
+static const struct lcd_ops ili9320_ops = {
.get_power = ili9320_get_power,
.set_power = ili9320_set_power,
};

--
2.43.0


2024-04-24 06:36:40

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH v2 07/19] backlight: jornada720_lcd: Constify lcd_ops

'struct lcd_ops' is not modified by core backlight code, so it can be
made const for increased code safety.

Reviewed-by: Daniel Thompson <[email protected]>
Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
drivers/video/backlight/jornada720_lcd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/backlight/jornada720_lcd.c b/drivers/video/backlight/jornada720_lcd.c
index 6796a7c2db25..5c64fa61e810 100644
--- a/drivers/video/backlight/jornada720_lcd.c
+++ b/drivers/video/backlight/jornada720_lcd.c
@@ -81,7 +81,7 @@ static int jornada_lcd_set_power(struct lcd_device *ld, int power)
return 0;
}

-static struct lcd_ops jornada_lcd_props = {
+static const struct lcd_ops jornada_lcd_props = {
.get_contrast = jornada_lcd_get_contrast,
.set_contrast = jornada_lcd_set_contrast,
.get_power = jornada_lcd_get_power,

--
2.43.0


2024-04-24 06:37:15

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH v2 09/19] backlight: lms283gf05: Constify lcd_ops

'struct lcd_ops' is not modified by core backlight code, so it can be
made const for increased code safety.

Reviewed-by: Daniel Thompson <[email protected]>
Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
drivers/video/backlight/lms283gf05.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/backlight/lms283gf05.c b/drivers/video/backlight/lms283gf05.c
index 36856962ed83..a65490e83d3d 100644
--- a/drivers/video/backlight/lms283gf05.c
+++ b/drivers/video/backlight/lms283gf05.c
@@ -139,7 +139,7 @@ static int lms283gf05_power_set(struct lcd_device *ld, int power)
return 0;
}

-static struct lcd_ops lms_ops = {
+static const struct lcd_ops lms_ops = {
.set_power = lms283gf05_power_set,
.get_power = NULL,
};

--
2.43.0


2024-04-24 06:37:49

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH v2 11/19] backlight: ltv350qv: Constify lcd_ops

'struct lcd_ops' is not modified by core backlight code, so it can be
made const for increased code safety.

Reviewed-by: Daniel Thompson <[email protected]>
Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
drivers/video/backlight/ltv350qv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/backlight/ltv350qv.c b/drivers/video/backlight/ltv350qv.c
index d54f501e4285..cdc4c087f230 100644
--- a/drivers/video/backlight/ltv350qv.c
+++ b/drivers/video/backlight/ltv350qv.c
@@ -217,7 +217,7 @@ static int ltv350qv_get_power(struct lcd_device *ld)
return lcd->power;
}

-static struct lcd_ops ltv_ops = {
+static const struct lcd_ops ltv_ops = {
.get_power = ltv350qv_get_power,
.set_power = ltv350qv_set_power,
};

--
2.43.0


2024-04-24 06:38:07

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH v2 12/19] backlight: otm3225a: Constify lcd_ops

'struct lcd_ops' is not modified by core backlight code, so it can be
made const for increased code safety.

Reviewed-by: Daniel Thompson <[email protected]>
Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
drivers/video/backlight/otm3225a.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/backlight/otm3225a.c b/drivers/video/backlight/otm3225a.c
index 4568020abf3c..efe52fa08b07 100644
--- a/drivers/video/backlight/otm3225a.c
+++ b/drivers/video/backlight/otm3225a.c
@@ -205,7 +205,7 @@ static int otm3225a_get_power(struct lcd_device *ld)
return dd->power;
}

-static struct lcd_ops otm3225a_ops = {
+static const struct lcd_ops otm3225a_ops = {
.set_power = otm3225a_set_power,
.get_power = otm3225a_get_power,
};

--
2.43.0


2024-04-24 06:38:40

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH v2 14/19] backlight: tdo24m: Constify lcd_ops

'struct lcd_ops' is not modified by core backlight code, so it can be
made const for increased code safety.

Reviewed-by: Daniel Thompson <[email protected]>
Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
drivers/video/backlight/tdo24m.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/backlight/tdo24m.c b/drivers/video/backlight/tdo24m.c
index fc6fbaf85594..c413b3c68e95 100644
--- a/drivers/video/backlight/tdo24m.c
+++ b/drivers/video/backlight/tdo24m.c
@@ -322,7 +322,7 @@ static int tdo24m_set_mode(struct lcd_device *ld, struct fb_videomode *m)
return lcd->adj_mode(lcd, mode);
}

-static struct lcd_ops tdo24m_ops = {
+static const struct lcd_ops tdo24m_ops = {
.get_power = tdo24m_get_power,
.set_power = tdo24m_set_power,
.set_mode = tdo24m_set_mode,

--
2.43.0


2024-04-24 06:38:54

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH v2 08/19] backlight: l4f00242t03: Constify lcd_ops

'struct lcd_ops' is not modified by core backlight code, so it can be
made const for increased code safety.

Reviewed-by: Daniel Thompson <[email protected]>
Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
drivers/video/backlight/l4f00242t03.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/backlight/l4f00242t03.c b/drivers/video/backlight/l4f00242t03.c
index bd5137ee203b..dd0874f8c7ff 100644
--- a/drivers/video/backlight/l4f00242t03.c
+++ b/drivers/video/backlight/l4f00242t03.c
@@ -158,7 +158,7 @@ static int l4f00242t03_lcd_power_set(struct lcd_device *ld, int power)
return 0;
}

-static struct lcd_ops l4f_ops = {
+static const struct lcd_ops l4f_ops = {
.set_power = l4f00242t03_lcd_power_set,
.get_power = l4f00242t03_lcd_power_get,
};

--
2.43.0


2024-04-24 06:38:56

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH v2 15/19] HID: picoLCD: Constify lcd_ops

'struct lcd_ops' is not modified by core backlight code, so it can be
made const for increased code safety.

Reviewed-by: Bruno Prémont <[email protected]>
Signed-off-by: Krzysztof Kozlowski <[email protected]>
---

Depends on the first patch in the series.
---
drivers/hid/hid-picolcd_lcd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hid/hid-picolcd_lcd.c b/drivers/hid/hid-picolcd_lcd.c
index 0c4b76de8ae5..061a33ba7b1d 100644
--- a/drivers/hid/hid-picolcd_lcd.c
+++ b/drivers/hid/hid-picolcd_lcd.c
@@ -46,7 +46,7 @@ static int picolcd_check_lcd_fb(struct lcd_device *ldev, struct fb_info *fb)
return fb && fb == picolcd_fbinfo((struct picolcd_data *)lcd_get_data(ldev));
}

-static struct lcd_ops picolcd_lcdops = {
+static const struct lcd_ops picolcd_lcdops = {
.get_contrast = picolcd_get_contrast,
.set_contrast = picolcd_set_contrast,
.check_fb = picolcd_check_lcd_fb,

--
2.43.0


2024-04-24 06:39:11

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH v2 16/19] fbdev: clps711x: Constify lcd_ops

'struct lcd_ops' is not modified by core backlight code, so it can be
made const for increased code safety.

Reviewed-by: Thomas Zimmermann <[email protected]>
Signed-off-by: Krzysztof Kozlowski <[email protected]>
---

Depends on the first patch in the series.
---
drivers/video/fbdev/clps711x-fb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/clps711x-fb.c b/drivers/video/fbdev/clps711x-fb.c
index dcfd1fbbc7e1..6171a98a48fd 100644
--- a/drivers/video/fbdev/clps711x-fb.c
+++ b/drivers/video/fbdev/clps711x-fb.c
@@ -197,7 +197,7 @@ static int clps711x_lcd_set_power(struct lcd_device *lcddev, int blank)
return 0;
}

-static struct lcd_ops clps711x_lcd_ops = {
+static const struct lcd_ops clps711x_lcd_ops = {
.check_fb = clps711x_lcd_check_fb,
.get_power = clps711x_lcd_get_power,
.set_power = clps711x_lcd_set_power,

--
2.43.0


2024-04-24 06:39:25

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH v2 17/19] fbdev: imx: Constify lcd_ops

'struct lcd_ops' is not modified by core backlight code, so it can be
made const for increased code safety.

Reviewed-by: Thomas Zimmermann <[email protected]>
Signed-off-by: Krzysztof Kozlowski <[email protected]>
---

Depends on the first patch in the series.
---
drivers/video/fbdev/imxfb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/imxfb.c b/drivers/video/fbdev/imxfb.c
index a4dbc72f93c3..4ebfe9b9df60 100644
--- a/drivers/video/fbdev/imxfb.c
+++ b/drivers/video/fbdev/imxfb.c
@@ -857,7 +857,7 @@ static int imxfb_lcd_set_power(struct lcd_device *lcddev, int power)
return 0;
}

-static struct lcd_ops imxfb_lcd_ops = {
+static const struct lcd_ops imxfb_lcd_ops = {
.check_fb = imxfb_lcd_check_fb,
.get_contrast = imxfb_lcd_get_contrast,
.set_contrast = imxfb_lcd_set_contrast,

--
2.43.0


2024-04-24 06:39:42

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH v2 18/19] fbdev: omap: lcd_ams_delta: Constify lcd_ops

'struct lcd_ops' is not modified by core backlight code, so it can be
made const for increased code safety.

Reviewed-by: Thomas Zimmermann <[email protected]>
Signed-off-by: Krzysztof Kozlowski <[email protected]>
---

Depends on the first patch in the series.
---
drivers/video/fbdev/omap/lcd_ams_delta.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/omap/lcd_ams_delta.c b/drivers/video/fbdev/omap/lcd_ams_delta.c
index 6f860c814d2c..97e2b71b64d7 100644
--- a/drivers/video/fbdev/omap/lcd_ams_delta.c
+++ b/drivers/video/fbdev/omap/lcd_ams_delta.c
@@ -76,7 +76,7 @@ static int ams_delta_lcd_get_contrast(struct lcd_device *dev)
return ams_delta_lcd & AMS_DELTA_MAX_CONTRAST;
}

-static struct lcd_ops ams_delta_lcd_ops = {
+static const struct lcd_ops ams_delta_lcd_ops = {
.get_power = ams_delta_lcd_get_power,
.set_power = ams_delta_lcd_set_power,
.get_contrast = ams_delta_lcd_get_contrast,

--
2.43.0


2024-04-24 06:39:51

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH v2 10/19] backlight: lms501kf03: Constify lcd_ops

'struct lcd_ops' is not modified by core backlight code, so it can be
made const for increased code safety.

Reviewed-by: Daniel Thompson <[email protected]>
Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
drivers/video/backlight/lms501kf03.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/backlight/lms501kf03.c b/drivers/video/backlight/lms501kf03.c
index 5c46df8022bf..8aebe0af3391 100644
--- a/drivers/video/backlight/lms501kf03.c
+++ b/drivers/video/backlight/lms501kf03.c
@@ -304,7 +304,7 @@ static int lms501kf03_set_power(struct lcd_device *ld, int power)
return lms501kf03_power(lcd, power);
}

-static struct lcd_ops lms501kf03_lcd_ops = {
+static const struct lcd_ops lms501kf03_lcd_ops = {
.get_power = lms501kf03_get_power,
.set_power = lms501kf03_set_power,
};

--
2.43.0


2024-04-24 06:39:57

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH v2 19/19] const_structs.checkpatch: add lcd_ops

'struct lcd_ops' is not modified by core code.

Suggested-by: Thomas Weißschuh <[email protected]>
Signed-off-by: Krzysztof Kozlowski <[email protected]>

---

Patch making lcd_ops const in progress:
https://lore.kernel.org/r/[email protected]

Cc: Lee Jones <[email protected]>
Cc: Daniel Thompson <[email protected]>
Cc: Jingoo Han <[email protected]>
Cc: [email protected]
Cc: [email protected]
---
scripts/const_structs.checkpatch | 1 +
1 file changed, 1 insertion(+)

diff --git a/scripts/const_structs.checkpatch b/scripts/const_structs.checkpatch
index fa96cfd16e99..52e5bfb61fd0 100644
--- a/scripts/const_structs.checkpatch
+++ b/scripts/const_structs.checkpatch
@@ -39,6 +39,7 @@ kgdb_arch
kgdb_io
kobj_type
kset_uevent_ops
+lcd_ops
lock_manager_operations
machine_desc
microcode_ops

--
2.43.0


2024-04-24 06:41:18

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH v2 13/19] backlight: platform_lcd: Constify lcd_ops

'struct lcd_ops' is not modified by core backlight code, so it can be
made const for increased code safety.

Reviewed-by: Daniel Thompson <[email protected]>
Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
drivers/video/backlight/platform_lcd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/backlight/platform_lcd.c b/drivers/video/backlight/platform_lcd.c
index dc37494baf42..76872f5c34c5 100644
--- a/drivers/video/backlight/platform_lcd.c
+++ b/drivers/video/backlight/platform_lcd.c
@@ -62,7 +62,7 @@ static int platform_lcd_match(struct lcd_device *lcd, struct fb_info *info)
return plcd->us->parent == info->device;
}

-static struct lcd_ops platform_lcd_ops = {
+static const struct lcd_ops platform_lcd_ops = {
.get_power = platform_lcd_get_power,
.set_power = platform_lcd_set_power,
.check_fb = platform_lcd_match,

--
2.43.0


2024-04-24 07:06:13

by Peng Fan

[permalink] [raw]
Subject: RE: [PATCH v2 17/19] fbdev: imx: Constify lcd_ops

> Subject: [PATCH v2 17/19] fbdev: imx: Constify lcd_ops
>
> 'struct lcd_ops' is not modified by core backlight code, so it can be made
> const for increased code safety.
>
> Reviewed-by: Thomas Zimmermann <[email protected]>
> Signed-off-by: Krzysztof Kozlowski <[email protected]>

Reviewed-by: Peng Fan <[email protected]>
> ---
>
> Depends on the first patch in the series.
> ---
> drivers/video/fbdev/imxfb.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/video/fbdev/imxfb.c b/drivers/video/fbdev/imxfb.c index
> a4dbc72f93c3..4ebfe9b9df60 100644
> --- a/drivers/video/fbdev/imxfb.c
> +++ b/drivers/video/fbdev/imxfb.c
> @@ -857,7 +857,7 @@ static int imxfb_lcd_set_power(struct lcd_device
> *lcddev, int power)
> return 0;
> }
>
> -static struct lcd_ops imxfb_lcd_ops = {
> +static const struct lcd_ops imxfb_lcd_ops = {
> .check_fb = imxfb_lcd_check_fb,
> .get_contrast = imxfb_lcd_get_contrast,
> .set_contrast = imxfb_lcd_set_contrast,
>
> --
> 2.43.0
>

2024-04-24 10:09:12

by Daniel Thompson

[permalink] [raw]
Subject: Re: [PATCH v2 19/19] const_structs.checkpatch: add lcd_ops

On Wed, Apr 24, 2024 at 08:33:45AM +0200, Krzysztof Kozlowski wrote:
> 'struct lcd_ops' is not modified by core code.
>
> Suggested-by: Thomas Wei?schuh <[email protected]>
> Signed-off-by: Krzysztof Kozlowski <[email protected]>

Reviewed-by: Daniel Thompson <[email protected]>


Daniel.

2024-05-02 07:21:46

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH v2 19/19] const_structs.checkpatch: add lcd_ops

On Wed, 24 Apr 2024, Krzysztof Kozlowski wrote:

> 'struct lcd_ops' is not modified by core code.
>
> Suggested-by: Thomas Weißschuh <[email protected]>
> Signed-off-by: Krzysztof Kozlowski <[email protected]>
>
> ---
>
> Patch making lcd_ops const in progress:
> https://lore.kernel.org/r/[email protected]
>
> Cc: Lee Jones <[email protected]>
> Cc: Daniel Thompson <[email protected]>
> Cc: Jingoo Han <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> ---
> scripts/const_structs.checkpatch | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/scripts/const_structs.checkpatch b/scripts/const_structs.checkpatch
> index fa96cfd16e99..52e5bfb61fd0 100644
> --- a/scripts/const_structs.checkpatch
> +++ b/scripts/const_structs.checkpatch
> @@ -39,6 +39,7 @@ kgdb_arch
> kgdb_io
> kobj_type
> kset_uevent_ops
> +lcd_ops

Acked-by: Lee Jones <[email protected]>

> lock_manager_operations
> machine_desc
> microcode_ops

--
Lee Jones [李琼斯]

2024-05-02 07:22:58

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH v2 00/19] backlight: Constify lcd_ops

On Wed, 24 Apr 2024, Krzysztof Kozlowski wrote:

> Hi,
>
> Changes in v2:
> - Collect tags, including wrongly places Thomas' tag (which requires me
> to manually edit 15 other patches to drop it).
> - Combine here checkpatch patch:
> https://lore.kernel.org/all/[email protected]/
> - Link to v1: https://lore.kernel.org/r/[email protected]

What's missing? Are we good to go?

> Dependencies
> ============
> All further patches depend on the first patch. Therefore everything
> could go via backlight tree (please ack) or via cross-tree pulls. Or
> whatever maintainer choose, just coordinate this with backlight.
>
> Best regards,
> Krzysztof
>
> ---
> Krzysztof Kozlowski (19):
> backlight: Constify lcd_ops
> backlight: ams369fg06: Constify lcd_ops
> backlight: corgi_lcd: Constify lcd_ops
> backlight: hx8357: Constify lcd_ops
> backlight: ili922x: Constify lcd_ops
> backlight: ili9320: Constify lcd_ops
> backlight: jornada720_lcd: Constify lcd_ops
> backlight: l4f00242t03: Constify lcd_ops
> backlight: lms283gf05: Constify lcd_ops
> backlight: lms501kf03: Constify lcd_ops
> backlight: ltv350qv: Constify lcd_ops
> backlight: otm3225a: Constify lcd_ops
> backlight: platform_lcd: Constify lcd_ops
> backlight: tdo24m: Constify lcd_ops
> HID: picoLCD: Constify lcd_ops
> fbdev: clps711x: Constify lcd_ops
> fbdev: imx: Constify lcd_ops
> fbdev: omap: lcd_ams_delta: Constify lcd_ops
> const_structs.checkpatch: add lcd_ops
>
> drivers/hid/hid-picolcd_lcd.c | 2 +-
> drivers/video/backlight/ams369fg06.c | 2 +-
> drivers/video/backlight/corgi_lcd.c | 2 +-
> drivers/video/backlight/hx8357.c | 2 +-
> drivers/video/backlight/ili922x.c | 2 +-
> drivers/video/backlight/ili9320.c | 2 +-
> drivers/video/backlight/jornada720_lcd.c | 2 +-
> drivers/video/backlight/l4f00242t03.c | 2 +-
> drivers/video/backlight/lcd.c | 4 ++--
> drivers/video/backlight/lms283gf05.c | 2 +-
> drivers/video/backlight/lms501kf03.c | 2 +-
> drivers/video/backlight/ltv350qv.c | 2 +-
> drivers/video/backlight/otm3225a.c | 2 +-
> drivers/video/backlight/platform_lcd.c | 2 +-
> drivers/video/backlight/tdo24m.c | 2 +-
> drivers/video/fbdev/clps711x-fb.c | 2 +-
> drivers/video/fbdev/imxfb.c | 2 +-
> drivers/video/fbdev/omap/lcd_ams_delta.c | 2 +-
> include/linux/lcd.h | 6 +++---
> scripts/const_structs.checkpatch | 1 +
> 20 files changed, 23 insertions(+), 22 deletions(-)
> ---
> base-commit: a59668a9397e7245b26e9be85d23f242ff757ae8
> change-id: 20240414-video-backlight-lcd-ops-276d8439ffb8
>
> Best regards,
> --
> Krzysztof Kozlowski <[email protected]>
>

--
Lee Jones [李琼斯]

2024-05-02 07:47:49

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH v2 00/19] backlight: Constify lcd_ops

On 02/05/2024 09:22, Lee Jones wrote:
> On Wed, 24 Apr 2024, Krzysztof Kozlowski wrote:
>
>> Hi,
>>
>> Changes in v2:
>> - Collect tags, including wrongly places Thomas' tag (which requires me
>> to manually edit 15 other patches to drop it).
>> - Combine here checkpatch patch:
>> https://lore.kernel.org/all/[email protected]/
>> - Link to v1: https://lore.kernel.org/r/[email protected]
>
> What's missing? Are we good to go?

Nothing missing, you can take entire set (also last checkpatch patch
which you acked).

Best regards,
Krzysztof


2024-05-03 09:42:09

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH v2 00/19] backlight: Constify lcd_ops

On Wed, 24 Apr 2024 08:33:26 +0200, Krzysztof Kozlowski wrote:
> Changes in v2:
> - Collect tags, including wrongly places Thomas' tag (which requires me
> to manually edit 15 other patches to drop it).
> - Combine here checkpatch patch:
> https://lore.kernel.org/all/[email protected]/
> - Link to v1: https://lore.kernel.org/r/[email protected]
>
> [...]

Applied, thanks!

[01/19] backlight: Constify lcd_ops
commit: 9258e31adebf0ccf0797867841f3f9800695dba2
[02/19] backlight: ams369fg06: Constify lcd_ops
commit: 8053c4fa200c3fef07859bac9469ad3f26f5aba1
[03/19] backlight: corgi_lcd: Constify lcd_ops
commit: 18c5d4ab9f6312f2c9c6c409287d552112db810a
[04/19] backlight: hx8357: Constify lcd_ops
commit: 1d669c1998b559393ec2eaac0449f4989a255049
[05/19] backlight: ili922x: Constify lcd_ops
commit: e77fef89de954b1557cb91b64696cd4fc06c80ad
[06/19] backlight: ili9320: Constify lcd_ops
commit: 06cfc92faa1eabb2ea226c58d6fd0b5ab117ee39
[07/19] backlight: jornada720_lcd: Constify lcd_ops
commit: a54b4999dc204bc5839bb70602078c7c8e4a5010
[08/19] backlight: l4f00242t03: Constify lcd_ops
commit: 657e6c1b270e9f4a890059f5d08a08ea842fa1a8
[09/19] backlight: lms283gf05: Constify lcd_ops
commit: 66e5a10818fd332e973d36429e36f4c436a86a91
[10/19] backlight: lms501kf03: Constify lcd_ops
commit: 31c205d1e8426dd0cce0143c500ff1ff71fe64d1
[11/19] backlight: ltv350qv: Constify lcd_ops
commit: 24424f84d7568d9d794657622e080b1cba1e9290
[12/19] backlight: otm3225a: Constify lcd_ops
commit: 02949072ee8fb6141cd8ac2be9867ef466580ddb
[13/19] backlight: platform_lcd: Constify lcd_ops
commit: d217a8d5a39851caa16996756682715c9debb4a9
[14/19] backlight: tdo24m: Constify lcd_ops
commit: c7a1809d1982f671e66a4b1c1ffd8bdd5ba260aa
[15/19] HID: picoLCD: Constify lcd_ops
commit: 238724635763e7c5d82c0581b0c49e5dfdd5505a
[16/19] fbdev: clps711x: Constify lcd_ops
commit: 55d9a955375af3b3fd5725a9b5cbc658d4bdd244
[17/19] fbdev: imx: Constify lcd_ops
commit: a6abbb5783345c4c7cc9fbd583b81e167bd0207d
[18/19] fbdev: omap: lcd_ams_delta: Constify lcd_ops
commit: ca991e8e096c9f0cff0300289e2d4813192b8ef3
[19/19] const_structs.checkpatch: add lcd_ops
commit: f02aeccbec6108d768f54d31e7cb48b06c0e3814

--
Lee Jones [李琼斯]


2024-05-03 09:43:36

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH v2 00/19] backlight: Constify lcd_ops

On Fri, 03 May 2024, Lee Jones wrote:

> On Wed, 24 Apr 2024 08:33:26 +0200, Krzysztof Kozlowski wrote:
> > Changes in v2:
> > - Collect tags, including wrongly places Thomas' tag (which requires me
> > to manually edit 15 other patches to drop it).
> > - Combine here checkpatch patch:
> > https://lore.kernel.org/all/[email protected]/
> > - Link to v1: https://lore.kernel.org/r/[email protected]
> >
> > [...]
>
> Applied, thanks!
>
> [01/19] backlight: Constify lcd_ops
> commit: 9258e31adebf0ccf0797867841f3f9800695dba2
> [02/19] backlight: ams369fg06: Constify lcd_ops
> commit: 8053c4fa200c3fef07859bac9469ad3f26f5aba1
> [03/19] backlight: corgi_lcd: Constify lcd_ops
> commit: 18c5d4ab9f6312f2c9c6c409287d552112db810a
> [04/19] backlight: hx8357: Constify lcd_ops
> commit: 1d669c1998b559393ec2eaac0449f4989a255049
> [05/19] backlight: ili922x: Constify lcd_ops
> commit: e77fef89de954b1557cb91b64696cd4fc06c80ad
> [06/19] backlight: ili9320: Constify lcd_ops
> commit: 06cfc92faa1eabb2ea226c58d6fd0b5ab117ee39
> [07/19] backlight: jornada720_lcd: Constify lcd_ops
> commit: a54b4999dc204bc5839bb70602078c7c8e4a5010
> [08/19] backlight: l4f00242t03: Constify lcd_ops
> commit: 657e6c1b270e9f4a890059f5d08a08ea842fa1a8
> [09/19] backlight: lms283gf05: Constify lcd_ops
> commit: 66e5a10818fd332e973d36429e36f4c436a86a91
> [10/19] backlight: lms501kf03: Constify lcd_ops
> commit: 31c205d1e8426dd0cce0143c500ff1ff71fe64d1
> [11/19] backlight: ltv350qv: Constify lcd_ops
> commit: 24424f84d7568d9d794657622e080b1cba1e9290
> [12/19] backlight: otm3225a: Constify lcd_ops
> commit: 02949072ee8fb6141cd8ac2be9867ef466580ddb
> [13/19] backlight: platform_lcd: Constify lcd_ops
> commit: d217a8d5a39851caa16996756682715c9debb4a9
> [14/19] backlight: tdo24m: Constify lcd_ops
> commit: c7a1809d1982f671e66a4b1c1ffd8bdd5ba260aa
> [15/19] HID: picoLCD: Constify lcd_ops
> commit: 238724635763e7c5d82c0581b0c49e5dfdd5505a
> [16/19] fbdev: clps711x: Constify lcd_ops
> commit: 55d9a955375af3b3fd5725a9b5cbc658d4bdd244
> [17/19] fbdev: imx: Constify lcd_ops
> commit: a6abbb5783345c4c7cc9fbd583b81e167bd0207d
> [18/19] fbdev: omap: lcd_ams_delta: Constify lcd_ops
> commit: ca991e8e096c9f0cff0300289e2d4813192b8ef3
> [19/19] const_structs.checkpatch: add lcd_ops
> commit: f02aeccbec6108d768f54d31e7cb48b06c0e3814

Please ensure you use checkpatch.pl before submitting:

====

ERROR: Does not appear to be a unified-diff format patch

total: 1 errors, 0 warnings, 0 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or --fix-inplace.

"[PATCH v2 19/19] const_structs.checkpatch: add lcd_ops" has style problems, please review.

NOTE: If any of the errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.
WARNING: Missing commit description - Add an appropriate one

ERROR: Missing Signed-off-by: line(s)

total: 1 errors, 1 warnings, 7 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or --fix-inplace.

Your patch has style problems, please review.

NOTE: If any of the errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.

====

Some of them are a little odd. I fixed the relevant ones

Submitted for build testing.

If successful, I'll submit a PR for the other maintainers soon.

--
Lee Jones [李琼斯]

2024-05-03 09:56:34

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH v2 00/19] backlight: Constify lcd_ops

On Fri, 03 May 2024, Lee Jones wrote:

> On Fri, 03 May 2024, Lee Jones wrote:
>
> > On Wed, 24 Apr 2024 08:33:26 +0200, Krzysztof Kozlowski wrote:
> > > Changes in v2:
> > > - Collect tags, including wrongly places Thomas' tag (which requires me
> > > to manually edit 15 other patches to drop it).
> > > - Combine here checkpatch patch:
> > > https://lore.kernel.org/all/[email protected]/
> > > - Link to v1: https://lore.kernel.org/r/[email protected]
> > >
> > > [...]
> >
> > Applied, thanks!
> >
> > [01/19] backlight: Constify lcd_ops
> > commit: 9258e31adebf0ccf0797867841f3f9800695dba2
> > [02/19] backlight: ams369fg06: Constify lcd_ops
> > commit: 8053c4fa200c3fef07859bac9469ad3f26f5aba1
> > [03/19] backlight: corgi_lcd: Constify lcd_ops
> > commit: 18c5d4ab9f6312f2c9c6c409287d552112db810a
> > [04/19] backlight: hx8357: Constify lcd_ops
> > commit: 1d669c1998b559393ec2eaac0449f4989a255049
> > [05/19] backlight: ili922x: Constify lcd_ops
> > commit: e77fef89de954b1557cb91b64696cd4fc06c80ad
> > [06/19] backlight: ili9320: Constify lcd_ops
> > commit: 06cfc92faa1eabb2ea226c58d6fd0b5ab117ee39
> > [07/19] backlight: jornada720_lcd: Constify lcd_ops
> > commit: a54b4999dc204bc5839bb70602078c7c8e4a5010
> > [08/19] backlight: l4f00242t03: Constify lcd_ops
> > commit: 657e6c1b270e9f4a890059f5d08a08ea842fa1a8
> > [09/19] backlight: lms283gf05: Constify lcd_ops
> > commit: 66e5a10818fd332e973d36429e36f4c436a86a91
> > [10/19] backlight: lms501kf03: Constify lcd_ops
> > commit: 31c205d1e8426dd0cce0143c500ff1ff71fe64d1
> > [11/19] backlight: ltv350qv: Constify lcd_ops
> > commit: 24424f84d7568d9d794657622e080b1cba1e9290
> > [12/19] backlight: otm3225a: Constify lcd_ops
> > commit: 02949072ee8fb6141cd8ac2be9867ef466580ddb
> > [13/19] backlight: platform_lcd: Constify lcd_ops
> > commit: d217a8d5a39851caa16996756682715c9debb4a9
> > [14/19] backlight: tdo24m: Constify lcd_ops
> > commit: c7a1809d1982f671e66a4b1c1ffd8bdd5ba260aa
> > [15/19] HID: picoLCD: Constify lcd_ops
> > commit: 238724635763e7c5d82c0581b0c49e5dfdd5505a
> > [16/19] fbdev: clps711x: Constify lcd_ops
> > commit: 55d9a955375af3b3fd5725a9b5cbc658d4bdd244
> > [17/19] fbdev: imx: Constify lcd_ops
> > commit: a6abbb5783345c4c7cc9fbd583b81e167bd0207d
> > [18/19] fbdev: omap: lcd_ams_delta: Constify lcd_ops
> > commit: ca991e8e096c9f0cff0300289e2d4813192b8ef3
> > [19/19] const_structs.checkpatch: add lcd_ops
> > commit: f02aeccbec6108d768f54d31e7cb48b06c0e3814
>
> Please ensure you use checkpatch.pl before submitting:
>
> ====
>
> ERROR: Does not appear to be a unified-diff format patch
>
> total: 1 errors, 0 warnings, 0 lines checked
>
> NOTE: For some of the reported defects, checkpatch may be able to
> mechanically convert to the typical style using --fix or --fix-inplace.
>
> "[PATCH v2 19/19] const_structs.checkpatch: add lcd_ops" has style problems, please review.
>
> NOTE: If any of the errors are false positives, please report
> them to the maintainer, see CHECKPATCH in MAINTAINERS.
> WARNING: Missing commit description - Add an appropriate one
>
> ERROR: Missing Signed-off-by: line(s)
>
> total: 1 errors, 1 warnings, 7 lines checked
>
> NOTE: For some of the reported defects, checkpatch may be able to
> mechanically convert to the typical style using --fix or --fix-inplace.
>
> Your patch has style problems, please review.
>
> NOTE: If any of the errors are false positives, please report
> them to the maintainer, see CHECKPATCH in MAINTAINERS.
>
> ====
>
> Some of them are a little odd. I fixed the relevant ones

Change of plan - I actually can't find anything to fix.

All of this reports seem bogus!

--
Lee Jones [李琼斯]