* [PATCH] ALSA: hda: constify attribute_group structures.
@ 2017-06-29 10:37 Arvind Yadav
2017-06-29 16:20 ` Takashi Iwai
0 siblings, 1 reply; 2+ messages in thread
From: Arvind Yadav @ 2017-06-29 10:37 UTC (permalink / raw)
To: perex, tiwai; +Cc: alsa-devel, linux-kernel
attribute_groups are not supposed to change at runtime. All functions
working with attribute_groups provided by <linux/device.h> work with const
attribute_group. So mark the non-const structs as const.
File size before:
text data bss dec hex filename
995 608 0 1603 643 sound/pci/hda/hda_sysfs.o
File size After adding 'const':
text data bss dec hex filename
1035 544 0 1579 62b sound/pci/hda/hda_sysfs.o
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
sound/pci/hda/hda_sysfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/pci/hda/hda_sysfs.c b/sound/pci/hda/hda_sysfs.c
index 9739fce..9b7efec 100644
--- a/sound/pci/hda/hda_sysfs.c
+++ b/sound/pci/hda/hda_sysfs.c
@@ -761,7 +761,7 @@ int snd_hda_load_patch(struct hda_bus *bus, size_t fw_size, const void *fw_buf)
NULL
};
-static struct attribute_group hda_dev_attr_group = {
+static const struct attribute_group hda_dev_attr_group = {
.attrs = hda_dev_attrs,
};
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ALSA: hda: constify attribute_group structures.
2017-06-29 10:37 [PATCH] ALSA: hda: constify attribute_group structures Arvind Yadav
@ 2017-06-29 16:20 ` Takashi Iwai
0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2017-06-29 16:20 UTC (permalink / raw)
To: Arvind Yadav; +Cc: perex, alsa-devel, linux-kernel
On Thu, 29 Jun 2017 12:37:01 +0200,
Arvind Yadav wrote:
>
> attribute_groups are not supposed to change at runtime. All functions
> working with attribute_groups provided by <linux/device.h> work with const
> attribute_group. So mark the non-const structs as const.
>
> File size before:
> text data bss dec hex filename
> 995 608 0 1603 643 sound/pci/hda/hda_sysfs.o
>
> File size After adding 'const':
> text data bss dec hex filename
> 1035 544 0 1579 62b sound/pci/hda/hda_sysfs.o
>
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Applied, thanks.
Takashi
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-06-29 16:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-29 10:37 [PATCH] ALSA: hda: constify attribute_group structures Arvind Yadav
2017-06-29 16:20 ` Takashi Iwai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).