Skip to contentSkip to conversation

drm: misc: few simple cleanups

PATCH Applied Krzysztof Kozlowski 5 participants 14 messages Sep 8, 2024 – Oct 21, 2024

Subsystems (9)
lore
Share & tools
lore
#0 lore raw

cover drm: misc: few simple cleanups

No dependencies, trivial patches.

Best regards,
Krzysztof

---
Krzysztof Kozlowski (5):
drm/meson: drop unused staitc dw_hdmi_dwc_write_bits drm/meson: constify regmap_config drm/fsl-dcu: constify regmap_config drm/mediatek: dp: constify regmap_config drm/bridge: ti-dlpc3433: constify regmap_config

 drivers/gpu/drm/bridge/ti-dlpc3433.c  |  2 +-
 drivers/gpu/drm/fsl-dcu/fsl_tcon.c    |  2 +-
 drivers/gpu/drm/mediatek/mtk_dp.c     |  2 +-
 drivers/gpu/drm/meson/meson_drv.c     |  2 +-
 drivers/gpu/drm/meson/meson_dw_hdmi.c | 14 --------------
 5 files changed, 4 insertions(+), 18 deletions(-)

---
base-commit: ad40aff1edffeccc412cde93894196dca7bc739e
change-id: 20240908-regmap-config-const-2b6e126feb8b

Best regards,

Signature · 1 line
Krzysztof Kozlowski <[email protected]>
#1 lore raw

PATCH 1/5 drm/meson: drop unused staitc dw_hdmi_dwc_write_bits

static inline dw_hdmi_dwc_write_bits() function is not used at all:

drivers/gpu/drm/meson/meson_dw_hdmi.c:276:20: error: unused function 'dw_hdmi_dwc_write_bits' [-Werror,-Wunused-function]

---
 drivers/gpu/drm/meson/meson_dw_hdmi.c | 14 --------------
 1 file changed, 14 deletions(-)
drivers/gpu/drm/meson/meson_dw_hdmi.c +0 -14
index 5565f7777529..b75db829b1da 100644
@@ -272,20 +272,6 @@ static inline void dw_hdmi_g12a_dwc_write(struct meson_dw_hdmi *dw_hdmi,
 	writeb(data, dw_hdmi->hdmitx + addr);
 }
 
-/* Helper to change specific bits in controller registers */
-static inline void dw_hdmi_dwc_write_bits(struct meson_dw_hdmi *dw_hdmi,
-					  unsigned int addr,
-					  unsigned int mask,
-					  unsigned int val)
-{
-	unsigned int data = dw_hdmi->data->dwc_read(dw_hdmi, addr);
-
-	data &= ~mask;
-	data |= val;
-
-	dw_hdmi->data->dwc_write(dw_hdmi, addr, data);
-}
-
 /* Bridge */
 
 /* Setup PHY bandwidth modes */
Signature · 1 line
2.43.0
maintainer Reviewed-by on v1 1/5
#2 lore raw

Re: [PATCH 1/5] drm/meson: drop unused staitc dw_hdmi_dwc_write_bits

Quoted 25 lines · Krzysztof Kozlowski

static inline dw_hdmi_dwc_write_bits() function is not used at all:

drivers/gpu/drm/meson/meson_dw_hdmi.c:276:20: error: unused function 'dw_hdmi_dwc_write_bits' [-Werror,-Wunused-function]

---
  drivers/gpu/drm/meson/meson_dw_hdmi.c | 14 --------------
  1 file changed, 14 deletions(-)
drivers/gpu/drm/meson/meson_dw_hdmi.c +0 -7
index 5565f7777529..b75db829b1da 100644
@@ -272,20 +272,6 @@ static inline void dw_hdmi_g12a_dwc_write(struct meson_dw_hdmi *dw_hdmi,
  	writeb(data, dw_hdmi->hdmitx + addr);
  }
 
-/* Helper to change specific bits in controller registers */
-static inline void dw_hdmi_dwc_write_bits(struct meson_dw_hdmi *dw_hdmi,
-					  unsigned int addr,
-					  unsigned int mask,
-					  unsigned int val)
-{
-	unsigned int data = dw_hdmi->data->dwc_read(dw_hdmi, addr);

drivers/gpu/drm/meson/meson_dw_hdmi.c static inline void dw_hdmi_g12a_dwc_write(struct meson_dw_hdmi *dw_hdmi, · line 277

Quoted 10 lines
drivers/gpu/drm/meson/meson_dw_hdmi.c +0 -7
-
-	data &= ~mask;
-	data |= val;
-
-	dw_hdmi->data->dwc_write(dw_hdmi, addr, data);
-}
-
  /* Bridge */
 
  /* Setup PHY bandwidth modes */
reviewer Reviewed-by on v1 1/5
#3 lore raw

Re: [PATCH 1/5] drm/meson: drop unused staitc dw_hdmi_dwc_write_bits

In reply to Krzysztof Kozlowski
Quoted 6 lines · Krzysztof Kozlowski

static inline dw_hdmi_dwc_write_bits() function is not used at all:

drivers/gpu/drm/meson/meson_dw_hdmi.c:276:20: error: unused function 'dw_hdmi_dwc_write_bits' [-Werror,-Wunused-function]

maybe s/staitc/static/ can be applied to $SUBJECT when applying this patch

Best regards,
Martin

#4 lore raw

PATCH 2/5 drm/meson: constify regmap_config

In reply to Krzysztof Kozlowski

Mark local static 'struct regmap_config' as const for safer and more obvious code.

---
 drivers/gpu/drm/meson/meson_drv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/meson/meson_drv.c +1 -1
index 4bd0baa2a4f5..6c8677d1f562 100644
@@ -126,7 +126,7 @@ static bool meson_vpu_has_available_connectors(struct device *dev)
 	return false;
 }
 
-static struct regmap_config meson_regmap_config = {
+static const struct regmap_config meson_regmap_config = {
 	.reg_bits       = 32,
 	.val_bits       = 32,
 	.reg_stride     = 4,
Signature · 1 line
2.43.0
maintainer Reviewed-by on v1 2/5
#5 lore raw

Re: [PATCH 2/5] drm/meson: constify regmap_config

Quoted 14 lines · Krzysztof Kozlowski

Mark local static 'struct regmap_config' as const for safer and more obvious code.

---
  drivers/gpu/drm/meson/meson_drv.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/meson/meson_drv.c +0 -0
index 4bd0baa2a4f5..6c8677d1f562 100644

drivers/gpu/drm/meson/meson_drv.c static bool meson_vpu_has_available_connectors(struct device *dev) · line 132

Quoted 8 lines
drivers/gpu/drm/meson/meson_drv.c +1 -1
@@ -126,7 +126,7 @@ static bool meson_vpu_has_available_connectors(struct device *dev)
  	return false;
  }
 
-static struct regmap_config meson_regmap_config = {
+static const struct regmap_config meson_regmap_config = {
  	.reg_bits       = 32,
  	.val_bits       = 32,
  	.reg_stride     = 4,
#6 lore raw

PATCH 3/5 drm/fsl-dcu: constify regmap_config

In reply to Krzysztof Kozlowski

Mark local static 'struct regmap_config' as const for safer and more obvious code.

---
 drivers/gpu/drm/fsl-dcu/fsl_tcon.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/fsl-dcu/fsl_tcon.c +1 -1
index 9eb5abaf7d66..49bbd00c77ae 100644
@@ -29,7 +29,7 @@ void fsl_tcon_bypass_enable(struct fsl_tcon *tcon)
 			   FSL_TCON_CTRL1_TCON_BYPASS);
 }
 
-static struct regmap_config fsl_tcon_regmap_config = {
+static const struct regmap_config fsl_tcon_regmap_config = {
 	.reg_bits = 32,
 	.reg_stride = 4,
 	.val_bits = 32,
Signature · 1 line
2.43.0
maintainer Reviewed-by on v1 3/5
#7 lore raw

Re: [PATCH 3/5] drm/fsl-dcu: constify regmap_config

Quoted 14 lines · Krzysztof Kozlowski

Mark local static 'struct regmap_config' as const for safer and more obvious code.

---
  drivers/gpu/drm/fsl-dcu/fsl_tcon.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/fsl-dcu/fsl_tcon.c +0 -0
index 9eb5abaf7d66..49bbd00c77ae 100644

drivers/gpu/drm/fsl-dcu/fsl_tcon.c void fsl_tcon_bypass_enable(struct fsl_tcon *tcon) · line 35

Quoted 8 lines
drivers/gpu/drm/fsl-dcu/fsl_tcon.c +1 -1
@@ -29,7 +29,7 @@ void fsl_tcon_bypass_enable(struct fsl_tcon *tcon)
  			   FSL_TCON_CTRL1_TCON_BYPASS);
  }
 
-static struct regmap_config fsl_tcon_regmap_config = {
+static const struct regmap_config fsl_tcon_regmap_config = {
  	.reg_bits = 32,
  	.reg_stride = 4,
  	.val_bits = 32,
#8 lore raw

PATCH 4/5 drm/mediatek: dp: constify regmap_config

In reply to Krzysztof Kozlowski

Mark local static 'struct regmap_config' as const for safer and more obvious code.

---
 drivers/gpu/drm/mediatek/mtk_dp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/mediatek/mtk_dp.c +1 -1
index d8796a904eca..f0f6f402994a 100644
@@ -311,7 +311,7 @@ static const struct mtk_dp_efuse_fmt mt8195_dp_efuse_fmt[MTK_DP_CAL_MAX] = {
 	},
 };
 
-static struct regmap_config mtk_dp_regmap_config = {
+static const struct regmap_config mtk_dp_regmap_config = {
 	.reg_bits = 32,
 	.val_bits = 32,
 	.reg_stride = 4,
Signature · 1 line
2.43.0
maintainer Reviewed-by on v1 4/5
#9 lore raw

Re: [PATCH 4/5] drm/mediatek: dp: constify regmap_config

Quoted 4 lines · Krzysztof Kozlowski

Mark local static 'struct regmap_config' as const for safer and more obvious code.

Quoted 18 lines
---
  drivers/gpu/drm/mediatek/mtk_dp.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/mediatek/mtk_dp.c +1 -1
index d8796a904eca..f0f6f402994a 100644
@@ -311,7 +311,7 @@ static const struct mtk_dp_efuse_fmt mt8195_dp_efuse_fmt[MTK_DP_CAL_MAX] = {
  	},
  };
 
-static struct regmap_config mtk_dp_regmap_config = {
+static const struct regmap_config mtk_dp_regmap_config = {
  	.reg_bits = 32,
  	.val_bits = 32,
  	.reg_stride = 4,
#11 lore raw

PATCH 5/5 drm/bridge: ti-dlpc3433: constify regmap_config

In reply to Krzysztof Kozlowski

Mark local static 'struct regmap_config' as const for safer and more obvious code.

---
 drivers/gpu/drm/bridge/ti-dlpc3433.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/bridge/ti-dlpc3433.c +1 -1
index 6b559e071301..a0a1b5dd794e 100644
@@ -94,7 +94,7 @@ static const struct regmap_access_table dlpc_volatile_table = {
 	.n_yes_ranges = ARRAY_SIZE(dlpc_volatile_ranges),
 };
 
-static struct regmap_config dlpc_regmap_config = {
+static const struct regmap_config dlpc_regmap_config = {
 	.reg_bits		= 8,
 	.val_bits		= 8,
 	.max_register		= WR_DSI_PORT_EN,
Signature · 1 line
2.43.0
maintainer Reviewed-by on v1 5/5
#12 lore raw

Re: [PATCH 5/5] drm/bridge: ti-dlpc3433: constify regmap_config

Quoted 14 lines · Krzysztof Kozlowski

Mark local static 'struct regmap_config' as const for safer and more obvious code.

---
  drivers/gpu/drm/bridge/ti-dlpc3433.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/bridge/ti-dlpc3433.c +0 -0
index 6b559e071301..a0a1b5dd794e 100644

drivers/gpu/drm/bridge/ti-dlpc3433.c static const struct regmap_access_table dlpc_volatile_table = { · line 100

Quoted 8 lines
drivers/gpu/drm/bridge/ti-dlpc3433.c +1 -1
@@ -94,7 +94,7 @@ static const struct regmap_access_table dlpc_volatile_table = {
  	.n_yes_ranges = ARRAY_SIZE(dlpc_volatile_ranges),
  };
 
-static struct regmap_config dlpc_regmap_config = {
+static const struct regmap_config dlpc_regmap_config = {
  	.reg_bits		= 8,
  	.val_bits		= 8,
  	.max_register		= WR_DSI_PORT_EN,
maintainer Applied
#13 lore raw

Re: (subset) [PATCH 0/5] drm: misc: few simple cleanups

In reply to Krzysztof Kozlowski

Hi,

Quoted 5 lines · Krzysztof Kozlowski

No dependencies, trivial patches.

Best regards,
Krzysztof

Thanks, Applied to https://gitlab.freedesktop.org/drm/misc/kernel.git (drm-misc-next)

[1/5] drm/meson: drop unused staitc dw_hdmi_dwc_write_bits

      https://gitlab.freedesktop.org/drm/misc/kernel/-/commit/d9c12481f980bdad9cf6fdb742e49c5b50622795

[2/5] drm/meson: constify regmap_config
(no commit info)
[5/5] drm/bridge: ti-dlpc3433: constify regmap_config
(no commit info)

Signature · 1 line
Neil