Commit 949a0c23 authored by Markus Elfring's avatar Markus Elfring Committed by Takashi Iwai

ALSA: emux: Improve a size determination in two functions

Replace the specification of data types by pointer dereferences
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer according to the Linux coding style convention.
Signed-off-by: default avatarMarkus Elfring <elfring@users.sourceforge.net>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent c997aabb
...@@ -149,7 +149,8 @@ snd_emux_create_port(struct snd_emux *emu, char *name, ...@@ -149,7 +149,8 @@ snd_emux_create_port(struct snd_emux *emu, char *name,
snd_printk(KERN_ERR "no memory\n"); snd_printk(KERN_ERR "no memory\n");
return NULL; return NULL;
} }
p->chset.channels = kcalloc(max_channels, sizeof(struct snd_midi_channel), GFP_KERNEL); p->chset.channels = kcalloc(max_channels, sizeof(*p->chset.channels),
GFP_KERNEL);
if (p->chset.channels == NULL) { if (p->chset.channels == NULL) {
snd_printk(KERN_ERR "no memory\n"); snd_printk(KERN_ERR "no memory\n");
kfree(p); kfree(p);
...@@ -371,7 +372,7 @@ int snd_emux_init_virmidi(struct snd_emux *emu, struct snd_card *card) ...@@ -371,7 +372,7 @@ int snd_emux_init_virmidi(struct snd_emux *emu, struct snd_card *card)
if (emu->midi_ports <= 0) if (emu->midi_ports <= 0)
return 0; return 0;
emu->vmidi = kcalloc(emu->midi_ports, sizeof(struct snd_rawmidi *), GFP_KERNEL); emu->vmidi = kcalloc(emu->midi_ports, sizeof(*emu->vmidi), GFP_KERNEL);
if (emu->vmidi == NULL) if (emu->vmidi == NULL)
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment