Skip to contentSkip to conversation

drm: dw-hdmi-i2s: Make structure dw_hdmi_i2s_ops constant

PATCH New Nishka Dasgupta 1 participant 1 message Aug 13, 2019

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

PATCH 1/1 drm: dw-hdmi-i2s: Make structure dw_hdmi_i2s_ops constant

Static structure dw_hdmi_i2s_ops, of type hdmi_codec_ops, is used only when assigned as a value to field ops of variable pdata, which has type hdmi_codec_pdata. Field ops of hdmi_codec_pdata is declared as a const; hence make dw_hdmi_i2s_ops constant as well.
Issue found with Coccinelle.

---
 drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c +1 -1
index 5cbb71a866d5..35daf9a21708 100644
@@ -104,7 +104,7 @@ static int dw_hdmi_i2s_get_dai_id(struct snd_soc_component *component,
 	return -EINVAL;
 }
 
-static struct hdmi_codec_ops dw_hdmi_i2s_ops = {
+static const struct hdmi_codec_ops dw_hdmi_i2s_ops = {
 	.hw_params	= dw_hdmi_i2s_hw_params,
 	.audio_shutdown	= dw_hdmi_i2s_audio_shutdown,
 	.get_dai_id	= dw_hdmi_i2s_get_dai_id,
Signature · 6 lines
2.19.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel