diff options
author | Markus Elfring <elfring@users.sourceforge.net> | 2017-08-09 03:11:26 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2017-08-10 11:55:11 -0400 |
commit | 949a0c23de89c02907970de7214c16b47ccf0482 (patch) | |
tree | 8b7779d88c4d61a21a53b169d62fbf9688b39409 | |
parent | c997aabbd3503c61901059caf457115098f344a4 (diff) |
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: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | sound/synth/emux/emux_seq.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sound/synth/emux/emux_seq.c b/sound/synth/emux/emux_seq.c index 53820f75ba3e..12acf18c5be4 100644 --- a/sound/synth/emux/emux_seq.c +++ b/sound/synth/emux/emux_seq.c | |||
@@ -149,7 +149,8 @@ snd_emux_create_port(struct snd_emux *emu, char *name, | |||
149 | snd_printk(KERN_ERR "no memory\n"); | 149 | snd_printk(KERN_ERR "no memory\n"); |
150 | return NULL; | 150 | return NULL; |
151 | } | 151 | } |
152 | p->chset.channels = kcalloc(max_channels, sizeof(struct snd_midi_channel), GFP_KERNEL); | 152 | p->chset.channels = kcalloc(max_channels, sizeof(*p->chset.channels), |
153 | GFP_KERNEL); | ||
153 | if (p->chset.channels == NULL) { | 154 | if (p->chset.channels == NULL) { |
154 | snd_printk(KERN_ERR "no memory\n"); | 155 | snd_printk(KERN_ERR "no memory\n"); |
155 | kfree(p); | 156 | kfree(p); |
@@ -371,7 +372,7 @@ int snd_emux_init_virmidi(struct snd_emux *emu, struct snd_card *card) | |||
371 | if (emu->midi_ports <= 0) | 372 | if (emu->midi_ports <= 0) |
372 | return 0; | 373 | return 0; |
373 | 374 | ||
374 | emu->vmidi = kcalloc(emu->midi_ports, sizeof(struct snd_rawmidi *), GFP_KERNEL); | 375 | emu->vmidi = kcalloc(emu->midi_ports, sizeof(*emu->vmidi), GFP_KERNEL); |
375 | if (emu->vmidi == NULL) | 376 | if (emu->vmidi == NULL) |
376 | return -ENOMEM; | 377 | return -ENOMEM; |
377 | 378 | ||