Skip to contentSkip to conversation

media: go7007: Constify static struct snd_device_ops

PATCH New Rikard Falkeborn 1 participant 1 message Jan 25, 2022

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

PATCH 1/1 media: go7007: Constify static struct snd_device_ops

The only usage of go7007_snd_device_ops is to pass its address to snd_device_new() which takes a pointer to const struct snd_device_ops. Make it const to allow the compiler to put it in read-only memory.

---
 drivers/media/usb/go7007/snd-go7007.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/usb/go7007/snd-go7007.c +1 -1
index 2ce85ab38db5..9a6bd87fce03 100644
@@ -191,7 +191,7 @@ static int go7007_snd_free(struct snd_device *device)
 	return 0;
 }
 
-static struct snd_device_ops go7007_snd_device_ops = {
+static const struct snd_device_ops go7007_snd_device_ops = {
 	.dev_free	= go7007_snd_free,
 };
 
Signature · 1 line
2.35.0