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/asus_oled | |
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/asus_oled')
-rw-r--r-- | drivers/staging/asus_oled/asus_oled.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/drivers/staging/asus_oled/asus_oled.c b/drivers/staging/asus_oled/asus_oled.c index 0018547..d0a5a28 100644 --- a/drivers/staging/asus_oled/asus_oled.c +++ b/drivers/staging/asus_oled/asus_oled.c @@ -164,11 +164,8 @@ static void enable_oled(struct asus_oled_dev *odev, uint8_t enabl) struct asus_oled_packet *packet; packet = kzalloc(sizeof(struct asus_oled_packet), GFP_KERNEL); - - if (!packet) { - dev_err(&odev->udev->dev, "out of memory\n"); + if (!packet) return; - } setup_packet_header(packet, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00); @@ -323,11 +320,8 @@ static void send_data(struct asus_oled_dev *odev) struct asus_oled_packet *packet; packet = kzalloc(sizeof(struct asus_oled_packet), GFP_KERNEL); - - if (!packet) { - dev_err(&odev->udev->dev, "out of memory\n"); + if (!packet) return; - } if (odev->pack_mode == PACK_MODE_G1) { /* When sending roll-mode data the display updated only @@ -665,11 +659,8 @@ static int asus_oled_probe(struct usb_interface *interface, } odev = kzalloc(sizeof(struct asus_oled_dev), GFP_KERNEL); - - if (odev == NULL) { - dev_err(&interface->dev, "Out of memory\n"); + if (odev == NULL) return -ENOMEM; - } odev->udev = usb_get_dev(udev); odev->pic_mode = ASUS_OLED_STATIC; |