Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 281183
b: refs/heads/master
c: d83fb18
h: refs/heads/master
i:
  281181: 6a84e6d
  281179: f5d9a93
  281175: e4ca49c
  281167: b2636cc
  281151: cc7547b
v: v3
  • Loading branch information
Thomas Meyer authored and Greg Kroah-Hartman committed Nov 30, 2011
1 parent d753c4c commit d4784d4
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 25 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 201320435d017e8ebd449034547ef0518ec4d056
refs/heads/master: d83fb184945cd2daaafd33a702bba9cb7ed502bf
3 changes: 1 addition & 2 deletions trunk/drivers/staging/iio/accel/lis3l02dq_ring.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,7 @@ static int lis3l02dq_read_all(struct iio_dev *indio_dev, u8 *rx_array)
struct spi_message msg;
int ret, i, j = 0;

xfers = kzalloc((buffer->scan_count) * 2
* sizeof(*xfers), GFP_KERNEL);
xfers = kcalloc((buffer->scan_count) * 2, sizeof(*xfers), GFP_KERNEL);
if (!xfers)
return -ENOMEM;

Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/staging/iio/adc/ad7280a.c
Original file line number Diff line number Diff line change
Expand Up @@ -488,8 +488,8 @@ static int ad7280_channel_init(struct ad7280_state *st)
{
int dev, ch, cnt;

st->channels = kzalloc(sizeof(*st->channels) *
((st->slave_num + 1) * 12 + 2), GFP_KERNEL);
st->channels = kcalloc((st->slave_num + 1) * 12 + 2,
sizeof(*st->channels), GFP_KERNEL);
if (st->channels == NULL)
return -ENOMEM;

Expand Down Expand Up @@ -683,7 +683,7 @@ static irqreturn_t ad7280_event_handler(int irq, void *private)
unsigned *channels;
int i, ret;

channels = kzalloc(sizeof(*channels) * st->scan_cnt, GFP_KERNEL);
channels = kcalloc(st->scan_cnt, sizeof(*channels), GFP_KERNEL);
if (channels == NULL)
return IRQ_HANDLED;

Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/staging/iio/iio_simple_dummy.c
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,8 @@ static __init int iio_dummy_init(void)
return -EINVAL;
}
/* Fake a bus */
iio_dummy_devs = kzalloc(sizeof(*iio_dummy_devs)*instances, GFP_KERNEL);
iio_dummy_devs = kcalloc(instances, sizeof(*iio_dummy_devs),
GFP_KERNEL);
/* Here we have no actual device so call probe */
for (i = 0; i < instances; i++) {
ret = iio_dummy_probe(i);
Expand Down
14 changes: 6 additions & 8 deletions trunk/drivers/staging/iio/industrialio-buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -315,10 +315,9 @@ int iio_buffer_register(struct iio_dev *indio_dev,
attrcount += ret;
}
if (indio_dev->masklength && buffer->scan_mask == NULL) {
buffer->scan_mask
= kzalloc(sizeof(*buffer->scan_mask)*
BITS_TO_LONGS(indio_dev->masklength),
GFP_KERNEL);
buffer->scan_mask = kcalloc(BITS_TO_LONGS(indio_dev->masklength),
sizeof(*buffer->scan_mask),
GFP_KERNEL);
if (buffer->scan_mask == NULL) {
ret = -ENOMEM;
goto error_cleanup_dynamic;
Expand All @@ -328,10 +327,9 @@ int iio_buffer_register(struct iio_dev *indio_dev,

buffer->scan_el_group.name = iio_scan_elements_group_name;

buffer->scan_el_group.attrs
= kzalloc(sizeof(buffer->scan_el_group.attrs[0])*
(attrcount + 1),
GFP_KERNEL);
buffer->scan_el_group.attrs = kcalloc(attrcount + 1,
sizeof(buffer->scan_el_group.attrs[0]),
GFP_KERNEL);
if (buffer->scan_el_group.attrs == NULL) {
ret = -ENOMEM;
goto error_free_scan_mask;
Expand Down
14 changes: 6 additions & 8 deletions trunk/drivers/staging/iio/industrialio-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -669,10 +669,9 @@ static int iio_device_register_sysfs(struct iio_dev *indio_dev)
if (indio_dev->name)
attrcount++;

indio_dev->chan_attr_group.attrs
= kzalloc(sizeof(indio_dev->chan_attr_group.attrs[0])*
(attrcount + 1),
GFP_KERNEL);
indio_dev->chan_attr_group.attrs = kcalloc(attrcount + 1,
sizeof(indio_dev->chan_attr_group.attrs[0]),
GFP_KERNEL);
if (indio_dev->chan_attr_group.attrs == NULL) {
ret = -ENOMEM;
goto error_clear_attrs;
Expand Down Expand Up @@ -965,10 +964,9 @@ static int iio_device_register_eventset(struct iio_dev *indio_dev)
}

indio_dev->event_interface->group.name = iio_event_group_name;
indio_dev->event_interface->group.attrs =
kzalloc(sizeof(indio_dev->event_interface->group.attrs[0])
*(attrcount + 1),
GFP_KERNEL);
indio_dev->event_interface->group.attrs = kcalloc(attrcount + 1,
sizeof(indio_dev->event_interface->group.attrs[0]),
GFP_KERNEL);
if (indio_dev->event_interface->group.attrs == NULL) {
ret = -ENOMEM;
goto error_free_setup_event_lines;
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/staging/iio/meter/ade7758_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -746,12 +746,12 @@ static int __devinit ade7758_probe(struct spi_device *spi)
spi_set_drvdata(spi, indio_dev);

/* Allocate the comms buffers */
st->rx = kzalloc(sizeof(*st->rx)*ADE7758_MAX_RX, GFP_KERNEL);
st->rx = kcalloc(ADE7758_MAX_RX, sizeof(*st->rx), GFP_KERNEL);
if (st->rx == NULL) {
ret = -ENOMEM;
goto error_free_dev;
}
st->tx = kzalloc(sizeof(*st->tx)*ADE7758_MAX_TX, GFP_KERNEL);
st->tx = kcalloc(ADE7758_MAX_TX, sizeof(*st->tx), GFP_KERNEL);
if (st->tx == NULL) {
ret = -ENOMEM;
goto error_free_rx;
Expand Down

0 comments on commit d4784d4

Please sign in to comment.