mirror of
https://github.com/torvalds/linux.git
synced 2026-05-05 23:05:25 -04:00
ALSA: info: Minor optimization
Just a minor code optimization to reduce the source code size slightly. No functional changes. Reviewed-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
@@ -463,11 +463,12 @@ static struct snd_info_entry *create_subdir(struct module *mod,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static struct snd_info_entry *
|
static struct snd_info_entry *
|
||||||
snd_info_create_entry(const char *name, struct snd_info_entry *parent);
|
snd_info_create_entry(const char *name, struct snd_info_entry *parent,
|
||||||
|
struct module *module);
|
||||||
|
|
||||||
int __init snd_info_init(void)
|
int __init snd_info_init(void)
|
||||||
{
|
{
|
||||||
snd_proc_root = snd_info_create_entry("asound", NULL);
|
snd_proc_root = snd_info_create_entry("asound", NULL, THIS_MODULE);
|
||||||
if (!snd_proc_root)
|
if (!snd_proc_root)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
snd_proc_root->mode = S_IFDIR | 0555;
|
snd_proc_root->mode = S_IFDIR | 0555;
|
||||||
@@ -684,7 +685,8 @@ EXPORT_SYMBOL(snd_info_get_str);
|
|||||||
* Return: The pointer of the new instance, or %NULL on failure.
|
* Return: The pointer of the new instance, or %NULL on failure.
|
||||||
*/
|
*/
|
||||||
static struct snd_info_entry *
|
static struct snd_info_entry *
|
||||||
snd_info_create_entry(const char *name, struct snd_info_entry *parent)
|
snd_info_create_entry(const char *name, struct snd_info_entry *parent,
|
||||||
|
struct module *module)
|
||||||
{
|
{
|
||||||
struct snd_info_entry *entry;
|
struct snd_info_entry *entry;
|
||||||
entry = kzalloc(sizeof(*entry), GFP_KERNEL);
|
entry = kzalloc(sizeof(*entry), GFP_KERNEL);
|
||||||
@@ -701,6 +703,7 @@ snd_info_create_entry(const char *name, struct snd_info_entry *parent)
|
|||||||
INIT_LIST_HEAD(&entry->children);
|
INIT_LIST_HEAD(&entry->children);
|
||||||
INIT_LIST_HEAD(&entry->list);
|
INIT_LIST_HEAD(&entry->list);
|
||||||
entry->parent = parent;
|
entry->parent = parent;
|
||||||
|
entry->module = module;
|
||||||
if (parent)
|
if (parent)
|
||||||
list_add_tail(&entry->list, &parent->children);
|
list_add_tail(&entry->list, &parent->children);
|
||||||
return entry;
|
return entry;
|
||||||
@@ -720,14 +723,9 @@ struct snd_info_entry *snd_info_create_module_entry(struct module * module,
|
|||||||
const char *name,
|
const char *name,
|
||||||
struct snd_info_entry *parent)
|
struct snd_info_entry *parent)
|
||||||
{
|
{
|
||||||
struct snd_info_entry *entry;
|
|
||||||
|
|
||||||
if (!parent)
|
if (!parent)
|
||||||
parent = snd_proc_root;
|
parent = snd_proc_root;
|
||||||
entry = snd_info_create_entry(name, parent);
|
return snd_info_create_entry(name, parent, module);
|
||||||
if (entry)
|
|
||||||
entry->module = module;
|
|
||||||
return entry;
|
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(snd_info_create_module_entry);
|
EXPORT_SYMBOL(snd_info_create_module_entry);
|
||||||
|
|
||||||
@@ -745,14 +743,9 @@ struct snd_info_entry *snd_info_create_card_entry(struct snd_card *card,
|
|||||||
const char *name,
|
const char *name,
|
||||||
struct snd_info_entry * parent)
|
struct snd_info_entry * parent)
|
||||||
{
|
{
|
||||||
struct snd_info_entry *entry;
|
|
||||||
|
|
||||||
if (!parent)
|
if (!parent)
|
||||||
parent = card->proc_root;
|
parent = card->proc_root;
|
||||||
entry = snd_info_create_entry(name, parent);
|
return snd_info_create_entry(name, parent, card->module);
|
||||||
if (entry)
|
|
||||||
entry->module = card->module;
|
|
||||||
return entry;
|
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(snd_info_create_card_entry);
|
EXPORT_SYMBOL(snd_info_create_card_entry);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user