aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2013-02-11 09:41:29 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-02-11 10:10:33 -0800
commit78110bb8dc4a7ff331bfa3cfe7d4e287cfb3f22b (patch)
tree6534f66eb765163602ad1af98c651bea6ae09416 /drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c
parentMerge tag 'iio-for-3.9d' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next (diff)
downloadlinux-dev-78110bb8dc4a7ff331bfa3cfe7d4e287cfb3f22b.tar.xz
linux-dev-78110bb8dc4a7ff331bfa3cfe7d4e287cfb3f22b.zip
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.c18
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 299f51810199..6a21f67af086 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) {