diff options
author | Joe Perches <joe@perches.com> | 2013-02-11 09:41:29 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-02-11 10:10:33 -0800 |
commit | 78110bb8dc4a7ff331bfa3cfe7d4e287cfb3f22b (patch) | |
tree | 6534f66eb765163602ad1af98c651bea6ae09416 /drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c | |
parent | ad463ac42771a0bb8a706cf8a985788fe5f5c1c6 (diff) | |
download | op-kernel-dev-78110bb8dc4a7ff331bfa3cfe7d4e287cfb3f22b.zip op-kernel-dev-78110bb8dc4a7ff331bfa3cfe7d4e287cfb3f22b.tar.gz |
staging: Remove unnecessary OOM messages
alloc failures already get standardized OOM
messages and a dump_stack.
For the affected mallocs around these OOM messages:
Converted kzallocs with multiplies to kcalloc.
Converted kmallocs with multiplies to kmalloc_array.
Converted a kmalloc/strlen/strncpy to kstrdup.
Moved a spin_lock below a removed OOM message and
removed a now unnecessary spin_unlock.
Neatened alignment and whitespace.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c')
-rw-r--r-- | drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c b/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c index 299f518..6a21f67 100644 --- a/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c +++ b/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c @@ -742,13 +742,9 @@ static int synaptics_rmi4_i2c_query_device(struct synaptics_rmi4_data *pdata) case SYNAPTICS_RMI4_TOUCHPAD_FUNC_NUM: if (rmi_fd.intr_src_count) { rfi = kmalloc(sizeof(*rfi), - GFP_KERNEL); - if (!rfi) { - dev_err(&client->dev, - "%s:kmalloc failed\n", - __func__); - return -ENOMEM; - } + GFP_KERNEL); + if (!rfi) + return -ENOMEM; retval = synpatics_rmi4_touchpad_detect (pdata, rfi, &rmi_fd, @@ -900,12 +896,10 @@ static int synaptics_rmi4_probe } /* Allocate and initialize the instance data for this client */ - rmi4_data = kzalloc(sizeof(struct synaptics_rmi4_data) * 2, - GFP_KERNEL); - if (!rmi4_data) { - dev_err(&client->dev, "%s: no memory allocated\n", __func__); + rmi4_data = kcalloc(2, sizeof(struct synaptics_rmi4_data), + GFP_KERNEL); + if (!rmi4_data) return -ENOMEM; - } rmi4_data->input_dev = input_allocate_device(); if (rmi4_data->input_dev == NULL) { |