Skip to contentSkip to conversation

constify copied structure

PATCH Applied Julia Lawall 13 participants 32 messages Jan 1, 2020 – Jan 29, 2020

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

cover constify copied structure

Make const static structures that are just copied into other structures.

The semantic patch that detects the opportunity for this change is as
follows: (http://coccinelle.lip6.fr/)

<smpl>
@r disable optional_qualifier@
identifier i,j;
position p;
@@
static struct i j@p = { ... };

@upd@
position p1;
identifier r.j;
expression e;
@@
e = j@p1

@ref@
position p2 != {r.p,upd.p1};
identifier r.j;
@@
j@p2

@script:ocaml depends on upd && !ref@
i << r.i;
j << r.j;
p << r.p;
@@
if j = (List.hd p).current_element
then Coccilib.print_main i p
</smpl>

---

 arch/powerpc/sysdev/mpic.c                          |    4 ++--
 drivers/gpu/drm/bridge/synopsys/dw-hdmi-ahb-audio.c |    2 +-
 drivers/media/i2c/mt9v111.c                         |    2 +-
 drivers/media/platform/davinci/isif.c               |    2 +-
 drivers/media/usb/cx231xx/cx231xx-dvb.c             |    2 +-
 drivers/media/usb/dvb-usb-v2/anysee.c               |    4 ++--
 drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c           |    2 +-
 drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c            |    2 +-
 drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c             |    2 +-
 drivers/ptp/ptp_clockmatrix.c                       |    2 +-
 drivers/usb/gadget/udc/atmel_usba_udc.c             |    2 +-
 drivers/video/fbdev/sa1100fb.c                      |    2 +-
 net/sunrpc/xdr.c                                    |    2 +-
 sound/isa/ad1816a/ad1816a_lib.c                     |    2 +-
 sound/pci/hda/hda_controller.c                      |    2 +-
 sound/soc/qcom/qdsp6/q6asm-dai.c                    |    2 +-
 16 files changed, 18 insertions(+), 18 deletions(-)
#1 lore raw

PATCH 1/16 ALSA: ad1816a: constify copied structure

The snd_ad1816a_timer_table structure is only copied into another structure, so make it const.

The opportunity for this change was found using Coccinelle.

---
 sound/isa/ad1816a/ad1816a_lib.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/isa/ad1816a/ad1816a_lib.c +1 -1
index e1aa5372c483..da6f68b8c248 100644
@@ -409,7 +409,7 @@ static int snd_ad1816a_timer_stop(struct snd_timer *timer)
 	return 0;
 }
 
-static struct snd_timer_hardware snd_ad1816a_timer_table = {
+static const struct snd_timer_hardware snd_ad1816a_timer_table = {
 	.flags =	SNDRV_TIMER_HW_AUTO,
 	.resolution =	10000,
 	.ticks =	65535,
Applied
#2 lore raw

Re: [PATCH 01/16] ALSA: ad1816a: constify copied structure

Quoted 7 lines · Julia Lawall

The snd_ad1816a_timer_table structure is only copied into another structure, so make it const.

The opportunity for this change was found using Coccinelle.

Applied, thanks.

Takashi

#3 lore raw

PATCH 2/16 ALSA: constify copied structure

In reply to Julia Lawall

The azx_pcm_hw structure is only copied into another structure, so make it const.

The opportunity for this change was found using Coccinelle.

---
 sound/pci/hda/hda_controller.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/hda/hda_controller.c +1 -1
index a74c85867eb3..9757667cdd58 100644
@@ -548,7 +548,7 @@ static int azx_get_time_info(struct snd_pcm_substream *substream,
 	return 0;
 }
 
-static struct snd_pcm_hardware azx_pcm_hw = {
+static const struct snd_pcm_hardware azx_pcm_hw = {
 	.info =			(SNDRV_PCM_INFO_MMAP |
 				 SNDRV_PCM_INFO_INTERLEAVED |
 				 SNDRV_PCM_INFO_BLOCK_TRANSFER |
#4 lore raw

Re: [PATCH 02/16] ALSA: constify copied structure

Quoted 7 lines · Julia Lawall

The azx_pcm_hw structure is only copied into another structure, so make it const.

The opportunity for this change was found using Coccinelle.

Applied now. Thanks.

Takashi

#5 lore raw

PATCH 3/16 anysee: constify copied structure

In reply to Julia Lawall

The anysee_tda18212_config and anysee_tda18212_config2 structures are only copied into other structures, so make them const.

The opportunity for this change was found using Coccinelle.

---
 drivers/media/usb/dvb-usb-v2/anysee.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/usb/dvb-usb-v2/anysee.c +2 -2
index fb6d99dea31a..94b8d3e5d8f7 100644
@@ -318,14 +318,14 @@ static struct tda10023_config anysee_tda10023_tda18212_config = {
 	.deltaf = 0xba02,
 };
 
-static struct tda18212_config anysee_tda18212_config = {
+static const struct tda18212_config anysee_tda18212_config = {
 	.if_dvbt_6 = 4150,
 	.if_dvbt_7 = 4150,
 	.if_dvbt_8 = 4150,
 	.if_dvbc = 5000,
 };
 
-static struct tda18212_config anysee_tda18212_config2 = {
+static const struct tda18212_config anysee_tda18212_config2 = {
 	.if_dvbt_6 = 3550,
 	.if_dvbt_7 = 3700,
 	.if_dvbt_8 = 4150,
#6 lore raw

PATCH 4/16 usb: gadget: udc: atmel: constify copied structure

In reply to Julia Lawall

The usba_gadget_template structure is only copied into another structure, so make it const.

The opportunity for this change was found using Coccinelle.

---
 drivers/usb/gadget/udc/atmel_usba_udc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/gadget/udc/atmel_usba_udc.c +1 -1
index 8a42768e3213..6e0432141c40 100644
@@ -1122,7 +1122,7 @@ static struct usb_endpoint_descriptor usba_ep0_desc = {
 	.bInterval = 1,
 };
 
-static struct usb_gadget usba_gadget_template = {
+static const struct usb_gadget usba_gadget_template = {
 	.ops		= &usba_udc_ops,
 	.max_speed	= USB_SPEED_HIGH,
 	.name		= "atmel_usba_udc",
maintainer Acked-by on v1 4/16
#7 lore raw

Re: [PATCH 04/16] usb: gadget: udc: atmel: constify copied structure

Quoted 6 lines · Julia Lawall

The usba_gadget_template structure is only copied into another structure, so make it const.

The opportunity for this change was found using Coccinelle.

Quoted 19 lines
---
  drivers/usb/gadget/udc/atmel_usba_udc.c |    2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/gadget/udc/atmel_usba_udc.c +1 -1
index 8a42768e3213..6e0432141c40 100644
@@ -1122,7 +1122,7 @@ static struct usb_endpoint_descriptor usba_ep0_desc = {
         .bInterval = 1,
  };
 
-static struct usb_gadget usba_gadget_template = {
+static const struct usb_gadget usba_gadget_template = {
         .ops            = &usba_udc_ops,
         .max_speed      = USB_SPEED_HIGH,
         .name           = "atmel_usba_udc",
#8 lore raw

PATCH 5/16 media: isif: constify copied structure

In reply to Julia Lawall

The isif_config_defaults structure is only copied into another structure, so make it const.

The opportunity for this change was found using Coccinelle.

---
 drivers/media/platform/davinci/isif.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/davinci/isif.c +1 -1
index b49378b18e5d..c98edb67cfb2 100644
@@ -29,7 +29,7 @@
 #include "ccdc_hw_device.h"
 
 /* Defaults for module configuration parameters */
-static struct isif_config_params_raw isif_config_defaults = {
+static const struct isif_config_params_raw isif_config_defaults = {
 	.linearize = {
 		.en = 0,
 		.corr_shft = ISIF_NO_SHIFT,
Acked-by on v1 5/16
#9 lore raw

Re: [PATCH 05/16] media: isif: constify copied structure

Quoted 8 lines · Julia Lawall

The isif_config_defaults structure is only copied into another structure, so make it const.

The opportunity for this change was found using Coccinelle.

Cheers,
--Prabhakar Lad

Quoted 18 lines
---
 drivers/media/platform/davinci/isif.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/davinci/isif.c +1 -1
index b49378b18e5d..c98edb67cfb2 100644
@@ -29,7 +29,7 @@
 #include "ccdc_hw_device.h"
 
 /* Defaults for module configuration parameters */
-static struct isif_config_params_raw isif_config_defaults = {
+static const struct isif_config_params_raw isif_config_defaults = {
        .linearize = {
                .en = 0,
                .corr_shft = ISIF_NO_SHIFT,
#10 lore raw

PATCH 6/16 media: mt9v111: constify copied structure

In reply to Julia Lawall

The mt9v111_def_fmt structure is only copied into another structure, so make it const.

The opportunity for this change was found using Coccinelle.

---
 drivers/media/i2c/mt9v111.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/i2c/mt9v111.c +1 -1
index bb41bea950ac..61ae6a0d5679 100644
@@ -103,7 +103,7 @@
 #define MT9V111_MAX_CLKIN				27000000
 
 /* The default sensor configuration at startup time. */
-static struct v4l2_mbus_framefmt mt9v111_def_fmt = {
+static const struct v4l2_mbus_framefmt mt9v111_def_fmt = {
 	.width		= 640,
 	.height		= 480,
 	.code		= MEDIA_BUS_FMT_UYVY8_2X8,
maintainer Acked-by on v1 6/16
#11 lore raw

Re: [PATCH 06/16] media: mt9v111: constify copied structure

Hi Julia,
thanks for the patch

Quoted 6 lines · Julia Lawall

The mt9v111_def_fmt structure is only copied into another structure, so make it const.

The opportunity for this change was found using Coccinelle.

Thanks
j

Quoted 19 lines
---
 drivers/media/i2c/mt9v111.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/i2c/mt9v111.c +1 -1
index bb41bea950ac..61ae6a0d5679 100644
@@ -103,7 +103,7 @@
 #define MT9V111_MAX_CLKIN				27000000
 
 /* The default sensor configuration at startup time. */
-static struct v4l2_mbus_framefmt mt9v111_def_fmt = {
+static const struct v4l2_mbus_framefmt mt9v111_def_fmt = {
 	.width		= 640,
 	.height		= 480,
 	.code		= MEDIA_BUS_FMT_UYVY8_2X8,
#12 lore raw

PATCH 7/16 video: sa1100fb: constify copied structure

In reply to Julia Lawall

The monspecs structure is only copied into another structure, so make it const.

The opportunity for this change was found using Coccinelle.

---
 drivers/video/fbdev/sa1100fb.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/fbdev/sa1100fb.c +1 -1
index 4680cc3efb81..c77b43dbc256 100644
@@ -1053,7 +1053,7 @@ static int sa1100fb_map_video_memory(struct sa1100fb_info *fbi)
 }
 
 /* Fake monspecs to fill in fbinfo structure */
-static struct fb_monspecs monspecs = {
+static const struct fb_monspecs monspecs = {
 	.hfmin	= 30000,
 	.hfmax	= 70000,
 	.vfmin	= 50,
#13 lore raw

Re: [PATCH 07/16] video: sa1100fb: constify copied structure

Quoted 6 lines · Julia Lawall

The monspecs structure is only copied into another structure, so make it const.

The opportunity for this change was found using Coccinelle.

Patch queued for v5.6, thanks.

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

Quoted 18 lines
---
 drivers/video/fbdev/sa1100fb.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/fbdev/sa1100fb.c +1 -1
index 4680cc3efb81..c77b43dbc256 100644
@@ -1053,7 +1053,7 @@ static int sa1100fb_map_video_memory(struct sa1100fb_info *fbi)
 }
 
 /* Fake monspecs to fill in fbinfo structure */
-static struct fb_monspecs monspecs = {
+static const struct fb_monspecs monspecs = {
 	.hfmin	= 30000,
 	.hfmax	= 70000,
 	.vfmin	= 50,
#14 lore raw

PATCH 8/16 pinctrl: ssbi-mpp: constify copied structure

In reply to Julia Lawall

The pm8xxx_pinctrl_desc structure is only copied into another structure, so make it const.

The opportunity for this change was found using Coccinelle.

---
 drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c +1 -1
index 3d8b1d74fa2f..681d8dcf37e3 100644
@@ -430,7 +430,7 @@ static const struct pinconf_ops pm8xxx_pinconf_ops = {
 	.pin_config_group_set = pm8xxx_pin_config_set,
 };
 
-static struct pinctrl_desc pm8xxx_pinctrl_desc = {
+static const struct pinctrl_desc pm8xxx_pinctrl_desc = {
 	.name = "pm8xxx_mpp",
 	.pctlops = &pm8xxx_pinctrl_ops,
 	.pmxops = &pm8xxx_pinmux_ops,
#15 lore raw

Re: [PATCH 08/16] pinctrl: ssbi-mpp: constify copied structure

Quoted 6 lines · Julia Lawall

The pm8xxx_pinctrl_desc structure is only copied into another structure, so make it const.

The opportunity for this change was found using Coccinelle.

That's a pretty cool semantic check finding things like this!

Patch applied.

Yours,
Linus Walleij

#16 lore raw

PATCH 9/16 powerpc/mpic: constify copied structure

In reply to Julia Lawall

The mpic_ipi_chip and mpic_irq_ht_chip structures are only copied into other structures, so make them const.

The opportunity for this change was found using Coccinelle.

---
 arch/powerpc/sysdev/mpic.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/powerpc/sysdev/mpic.c +2 -2
index 934a77324f6b..a3a72b780e67 100644
@@ -964,7 +964,7 @@ static struct irq_chip mpic_irq_chip = {
 };
 
 #ifdef CONFIG_SMP
-static struct irq_chip mpic_ipi_chip = {
+static const struct irq_chip mpic_ipi_chip = {
 	.irq_mask	= mpic_mask_ipi,
 	.irq_unmask	= mpic_unmask_ipi,
 	.irq_eoi	= mpic_end_ipi,
@@ -978,7 +978,7 @@ static struct irq_chip mpic_tm_chip = {
 };
 
 #ifdef CONFIG_MPIC_U3_HT_IRQS
-static struct irq_chip mpic_irq_ht_chip = {
+static const struct irq_chip mpic_irq_ht_chip = {
 	.irq_startup	= mpic_startup_ht_irq,
 	.irq_shutdown	= mpic_shutdown_ht_irq,
 	.irq_mask	= mpic_mask_irq,
#18 lore raw

PATCH 10/16 ASoC: qdsp6: q6asm-dai: constify copied structure

In reply to Julia Lawall

The q6asm_dai_hardware_capture structure is only copied into another structure, so make it const.

The opportunity for this change was found using Coccinelle.

---
 sound/soc/qcom/qdsp6/q6asm-dai.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/qcom/qdsp6/q6asm-dai.c +1 -1
index 5e2327708772..c0d422d0ab94 100644
@@ -72,7 +72,7 @@ struct q6asm_dai_data {
 	long long int sid;
 };
 
-static struct snd_pcm_hardware q6asm_dai_hardware_capture = {
+static const struct snd_pcm_hardware q6asm_dai_hardware_capture = {
 	.info =                 (SNDRV_PCM_INFO_MMAP |
 				SNDRV_PCM_INFO_BLOCK_TRANSFER |
 				SNDRV_PCM_INFO_MMAP_VALID |
maintainer
#19 lore raw

Applied "ASoC: qdsp6: q6asm-dai: constify copied structure" to the asoc tree

The patch

ASoC: qdsp6: q6asm-dai: constify copied structure

has been applied to the asoc tree at

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark

From 0da390ba86d841b1f9770c0a67bdebb4d8dc8be5 Mon Sep 17 00:00:00 2001
From: Julia Lawall <[email protected]>
Date: Wed, 1 Jan 2020 08:43:28 +0100
Subject: [PATCH] ASoC: qdsp6: q6asm-dai: constify copied structure

The q6asm_dai_hardware_capture structure is only copied into another structure, so make it const.

The opportunity for this change was found using Coccinelle.

---
 sound/soc/qcom/qdsp6/q6asm-dai.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/qcom/qdsp6/q6asm-dai.c +1 -1
index 5e2327708772..c0d422d0ab94 100644
@@ -72,7 +72,7 @@ struct q6asm_dai_data {
 	long long int sid;
 };
 
-static struct snd_pcm_hardware q6asm_dai_hardware_capture = {
+static const struct snd_pcm_hardware q6asm_dai_hardware_capture = {
 	.info =                 (SNDRV_PCM_INFO_MMAP |
 				SNDRV_PCM_INFO_BLOCK_TRANSFER |
 				SNDRV_PCM_INFO_MMAP_VALID |
Signature · 1 line
2.20.1
#20 lore raw

PATCH 11/16 media: cx231xx: constify copied structure

In reply to Julia Lawall

The hauppauge_955q_lgdt3306a_config structure is only copied into another structure, so make it const.

The opportunity for this change was found using Coccinelle.

---
 drivers/media/usb/cx231xx/cx231xx-dvb.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/usb/cx231xx/cx231xx-dvb.c +1 -1
index e205f7f0a56a..0037b4b1381e 100644
@@ -147,7 +147,7 @@ static struct tda18271_config pv_tda18271_config = {
 	.small_i2c = TDA18271_03_BYTE_CHUNK_INIT,
 };
 
-static struct lgdt3306a_config hauppauge_955q_lgdt3306a_config = {
+static const struct lgdt3306a_config hauppauge_955q_lgdt3306a_config = {
 	.qam_if_khz         = 4000,
 	.vsb_if_khz         = 3250,
 	.spectral_inversion = 1,
#21 lore raw

PATCH 12/16 SUNRPC: constify copied structure

In reply to Julia Lawall

The empty_iov structure is only copied into another structure, so make it const.

The opportunity for this change was found using Coccinelle.

---
 net/sunrpc/xdr.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/sunrpc/xdr.c +1 -1
index f3104be8ff5d..e5497dc2475b 100644
@@ -1079,7 +1079,7 @@ void xdr_enter_page(struct xdr_stream *xdr, unsigned int len)
 }
 EXPORT_SYMBOL_GPL(xdr_enter_page);
 
-static struct kvec empty_iov = {.iov_base = NULL, .iov_len = 0};
+static const struct kvec empty_iov = {.iov_base = NULL, .iov_len = 0};
 
 void
 xdr_buf_from_iov(struct kvec *iov, struct xdr_buf *buf)
#22 lore raw

PATCH 13/16 ptp: ptp_clockmatrix: constify copied structure

In reply to Julia Lawall

The idtcm_caps structure is only copied into another structure, so make it const.

The opportunity for this change was found using Coccinelle.

---
 drivers/ptp/ptp_clockmatrix.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/ptp/ptp_clockmatrix.c +1 -1
index a5110b7b4ece..e85836715f0b 100644
@@ -1102,7 +1102,7 @@ static void idtcm_display_version_info(struct idtcm *idtcm)
 		 product_id, hw_rev_id, bond_id, csr_id, irq_id);
 }
 
-static struct ptp_clock_info idtcm_caps = {
+static const struct ptp_clock_info idtcm_caps = {
 	.owner		= THIS_MODULE,
 	.max_adj	= 244000,
 	.n_per_out	= 1,
#25 lore raw

PATCH 14/16 pinctrl: qcom: ssbi-gpio: constify copied structure

In reply to Julia Lawall

The pm8xxx_pinctrl_desc structure is only copied into another structure, so make it const.

The opportunity for this change was found using Coccinelle.

---
 drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c +1 -1
index dca86886b1f9..c7912135bbfb 100644
@@ -439,7 +439,7 @@ static const struct pinconf_ops pm8xxx_pinconf_ops = {
 	.pin_config_group_set = pm8xxx_pin_config_set,
 };
 
-static struct pinctrl_desc pm8xxx_pinctrl_desc = {
+static const struct pinctrl_desc pm8xxx_pinctrl_desc = {
 	.name = "pm8xxx_gpio",
 	.pctlops = &pm8xxx_pinctrl_ops,
 	.pmxops = &pm8xxx_pinmux_ops,
#26 lore raw

Re: [PATCH 14/16] pinctrl: qcom: ssbi-gpio: constify copied structure

Quoted 6 lines · Julia Lawall

The pm8xxx_pinctrl_desc structure is only copied into another structure, so make it const.

The opportunity for this change was found using Coccinelle.

Patch applied.

Yours,
Linus Walleij

#27 lore raw

PATCH 15/16 drm: bridge: dw-hdmi: constify copied structure

In reply to Julia Lawall

The dw_hdmi_hw structure is only copied into another structure, so make it const.

The opportunity for this change was found using Coccinelle.

---
 drivers/gpu/drm/bridge/synopsys/dw-hdmi-ahb-audio.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/bridge/synopsys/dw-hdmi-ahb-audio.c +1 -1
index 2b7539701b42..dd56996fe9c7 100644
@@ -291,7 +291,7 @@ static irqreturn_t snd_dw_hdmi_irq(int irq, void *data)
 	return IRQ_HANDLED;
 }
 
-static struct snd_pcm_hardware dw_hdmi_hw = {
+static const struct snd_pcm_hardware dw_hdmi_hw = {
 	.info = SNDRV_PCM_INFO_INTERLEAVED |
 		SNDRV_PCM_INFO_BLOCK_TRANSFER |
 		SNDRV_PCM_INFO_MMAP |
reviewer Reviewed-by on v1 15/16
#28 lore raw

Re: [PATCH 15/16] drm: bridge: dw-hdmi: constify copied structure

Hi Julia,

Thank you for the patch.

Quoted 6 lines · Julia Lawall

The dw_hdmi_hw structure is only copied into another structure, so make it const.

The opportunity for this change was found using Coccinelle.

Quoted 17 lines
---
 drivers/gpu/drm/bridge/synopsys/dw-hdmi-ahb-audio.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/bridge/synopsys/dw-hdmi-ahb-audio.c +1 -1
index 2b7539701b42..dd56996fe9c7 100644
@@ -291,7 +291,7 @@ static irqreturn_t snd_dw_hdmi_irq(int irq, void *data)
 	return IRQ_HANDLED;
 }
 
-static struct snd_pcm_hardware dw_hdmi_hw = {
+static const struct snd_pcm_hardware dw_hdmi_hw = {
 	.info = SNDRV_PCM_INFO_INTERLEAVED |
 		SNDRV_PCM_INFO_BLOCK_TRANSFER |
 		SNDRV_PCM_INFO_MMAP |
Signature · 3 lines
Regards,

Laurent Pinchart
#29 lore raw

Re: [PATCH 15/16] drm: bridge: dw-hdmi: constify copied structure

Quoted 26 lines · Laurent Pinchart

Hi Julia,

Thank you for the patch.

Quoted 6 lines · Julia Lawall

The dw_hdmi_hw structure is only copied into another structure, so make it const.

The opportunity for this change was found using Coccinelle.

Quoted 12 lines
---
 drivers/gpu/drm/bridge/synopsys/dw-hdmi-ahb-audio.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/bridge/synopsys/dw-hdmi-ahb-audio.c +0 -0
index 2b7539701b42..dd56996fe9c7 100644
@@ -291,7 +291,7 @@ static irqreturn_t snd_dw_hdmi_irq(int irq, void *data)
 	return IRQ_HANDLED;
 }
 
Quoted 6 lines

drivers/gpu/drm/bridge/synopsys/dw-hdmi-ahb-audio.c static irqreturn_t snd_dw_hdmi_irq(int irq, void *data) · line 297

Quoted 5 lines
drivers/gpu/drm/bridge/synopsys/dw-hdmi-ahb-audio.c +1 -1
-static struct snd_pcm_hardware dw_hdmi_hw = {
+static const struct snd_pcm_hardware dw_hdmi_hw = {
 	.info = SNDRV_PCM_INFO_INTERLEAVED |
 		SNDRV_PCM_INFO_BLOCK_TRANSFER |
 		SNDRV_PCM_INFO_MMAP |

Applied to drm-misc-next

Neil

#30 lore raw

PATCH 16/16 pinctrl: nuvoton: npcm7xx: constify copied structure

In reply to Julia Lawall

The npcmgpio_irqchip structure is only copied into another structure, so make it const.

The opportunity for this change was found using Coccinelle.

---
 drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c +1 -1
index 22077cbe6880..a935065cdac4 100644
@@ -331,7 +331,7 @@ static unsigned int npcmgpio_irq_startup(struct irq_data *d)
 	return 0;
 }
 
-static struct irq_chip npcmgpio_irqchip = {
+static const struct irq_chip npcmgpio_irqchip = {
 	.name = "NPCM7XX-GPIO-IRQ",
 	.irq_ack = npcmgpio_irq_ack,
 	.irq_unmask = npcmgpio_irq_unmask,
#31 lore raw

Re: [PATCH 16/16] pinctrl: nuvoton: npcm7xx: constify copied structure

Quoted 6 lines · Julia Lawall

The npcmgpio_irqchip structure is only copied into another structure, so make it const.

The opportunity for this change was found using Coccinelle.

Patch applied.

Yours,
Linus Walleij