Commit 205781b7 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: serial2000: checkpatch.pl cleanup (kmalloc_array)

Fix the checkpatch.pl warning:

WARNING: Prefer kmalloc_array over kmalloc with multiply
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e685d726
...@@ -361,7 +361,8 @@ static int serial2002_setup_subdevice(struct comedi_subdevice *s, ...@@ -361,7 +361,8 @@ static int serial2002_setup_subdevice(struct comedi_subdevice *s,
s->n_chan = chan; s->n_chan = chan;
s->maxdata = 0; s->maxdata = 0;
kfree(s->maxdata_list); kfree(s->maxdata_list);
maxdata_list = kmalloc(sizeof(unsigned int) * s->n_chan, GFP_KERNEL); maxdata_list = kmalloc_array(s->n_chan, sizeof(unsigned int),
GFP_KERNEL);
if (!maxdata_list) if (!maxdata_list)
return -ENOMEM; return -ENOMEM;
s->maxdata_list = maxdata_list; s->maxdata_list = maxdata_list;
...@@ -371,9 +372,8 @@ static int serial2002_setup_subdevice(struct comedi_subdevice *s, ...@@ -371,9 +372,8 @@ static int serial2002_setup_subdevice(struct comedi_subdevice *s,
if (kind == 1 || kind == 2) { if (kind == 1 || kind == 2) {
s->range_table = &range_digital; s->range_table = &range_digital;
} else if (range) { } else if (range) {
range_table_list = range_table_list = kmalloc_array(s->n_chan, sizeof(*range),
kmalloc(sizeof(struct serial2002_range_table_t) * GFP_KERNEL);
s->n_chan, GFP_KERNEL);
if (!range_table_list) if (!range_table_list)
return -ENOMEM; return -ENOMEM;
s->range_table_list = range_table_list; s->range_table_list = range_table_list;
......
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