]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
ALSA: hda: Constify snd_device_ops definitions
authorTakashi Iwai <tiwai@suse.de>
Fri, 3 Jan 2020 08:16:24 +0000 (09:16 +0100)
committerTakashi Iwai <tiwai@suse.de>
Fri, 3 Jan 2020 08:23:55 +0000 (09:23 +0100)
Now we may declare const for snd_device_ops definitions, so let's do
it for optimization.

There should be no functional changes by this patch.

Link: https://lore.kernel.org/r/20200103081714.9560-9-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/hda_beep.c
sound/pci/hda/hda_codec.c
sound/pci/hda/hda_intel.c
sound/pci/hda/hda_tegra.c

index b7d9160ed868873eba09797c60a2cb6147b80fdb..f5fd62ed4df5b669e43c76e99cb18f1eba243f9d 100644 (file)
@@ -192,7 +192,7 @@ static int beep_dev_free(struct snd_device *device)
  */
 int snd_hda_attach_beep_device(struct hda_codec *codec, int nid)
 {
-       static struct snd_device_ops ops = {
+       static const struct snd_device_ops ops = {
                .dev_register = beep_dev_register,
                .dev_disconnect = beep_dev_disconnect,
                .dev_free = beep_dev_free,
index a2fb19129219e11bb700e78e7dd7e0ba32170ca1..8f166bbc438b3fe41a0c7e9dd0621e78ddf59269 100644 (file)
@@ -915,7 +915,7 @@ int snd_hda_codec_device_new(struct hda_bus *bus, struct snd_card *card,
        char component[31];
        hda_nid_t fg;
        int err;
-       static struct snd_device_ops dev_ops = {
+       static const struct snd_device_ops dev_ops = {
                .dev_register = snd_hda_codec_dev_register,
                .dev_free = snd_hda_codec_dev_free,
        };
index c7efb6f66bdc74ad45f6af469494b136c2f11bcb..4733268ec74ee8e967f6bdc1e788e8fdf72ddaef 100644 (file)
@@ -1743,7 +1743,7 @@ static int azx_create(struct snd_card *card, struct pci_dev *pci,
                      int dev, unsigned int driver_caps,
                      struct azx **rchip)
 {
-       static struct snd_device_ops ops = {
+       static const struct snd_device_ops ops = {
                .dev_disconnect = azx_dev_disconnect,
                .dev_free = azx_dev_free,
        };
index 9d0784aed9e47fb903b3fb9c854f8038f9031cd2..567c9ebddb2e29ae7b4a37d935864c1f63a35f41 100644 (file)
@@ -366,7 +366,7 @@ static int hda_tegra_create(struct snd_card *card,
                            unsigned int driver_caps,
                            struct hda_tegra *hda)
 {
-       static struct snd_device_ops ops = {
+       static const struct snd_device_ops ops = {
                .dev_disconnect = hda_tegra_dev_disconnect,
                .dev_free = hda_tegra_dev_free,
        };