treewide: Remove OOM message after input_alloc_device
Subsystems (31)
cover treewide: Remove OOM message after input_alloc_device
Joe Perches (8):
Documentation: Remove OOM message after input_allocate_device
cell: Remove OOM message after input_allocate_device
hid: Remove OOM message after input_allocate_device
input: Remove OOM message after input_allocate_device
media: Remove OOM message after input_allocate_device platform:x86: Remove OOM message after input_allocate_device
staging: Remove OOM message after input_allocate_device
sound: Remove OOM message after input_allocate_device
Documentation/input/input-programming.txt | 1 - arch/powerpc/platforms/cell/cbe_powerbutton.c | 1 - drivers/hid/hid-input.c | 1 - drivers/hid/hid-picolcd_core.c | 5 ++--- drivers/input/joystick/as5011.c | 2 -- drivers/input/joystick/db9.c | 1 - drivers/input/joystick/gamecon.c | 4 +--- drivers/input/joystick/turbografx.c | 1 - drivers/input/joystick/walkera0701.c | 1 - drivers/input/keyboard/amikbd.c | 4 +--- drivers/input/keyboard/davinci_keyscan.c | 1 - drivers/input/keyboard/gpio_keys.c | 1 - drivers/input/keyboard/lpc32xx-keys.c | 1 - drivers/input/keyboard/max7359_keypad.c | 1 - drivers/input/keyboard/mcs_touchkey.c | 1 - drivers/input/keyboard/mpr121_touchkey.c | 1 - drivers/input/keyboard/nomadik-ske-keypad.c | 1 - drivers/input/keyboard/opencores-kbd.c | 1 - drivers/input/keyboard/pmic8xxx-keypad.c | 1 - drivers/input/keyboard/pxa27x_keypad.c | 1 - drivers/input/keyboard/pxa930_rotary.c | 1 - drivers/input/keyboard/qt1070.c | 1 - drivers/input/keyboard/qt2160.c | 1 - drivers/input/keyboard/sh_keysc.c | 1 - drivers/input/keyboard/tc3589x-keypad.c | 1 - drivers/input/keyboard/tnetv107x-keypad.c | 1 - drivers/input/keyboard/w90p910_keypad.c | 1 - drivers/input/misc/88pm80x_onkey.c | 1 - drivers/input/misc/88pm860x_onkey.c | 1 - drivers/input/misc/arizona-haptics.c | 4 +--- drivers/input/misc/atlas_btns.c | 4 +--- drivers/input/misc/da9052_onkey.c | 1 - drivers/input/misc/da9055_onkey.c | 4 +--- drivers/input/misc/ideapad_slidebar.c | 1 - drivers/input/misc/ims-pcu.c | 7 +------ drivers/input/misc/kxtj9.c | 4 +--- drivers/input/misc/max8997_haptic.c | 1 - drivers/input/misc/mc13783-pwrbutton.c | 4 +--- drivers/input/misc/mpu3050.c | 1 - drivers/input/misc/pcf8574_keypad.c | 1 - drivers/input/misc/pm8xxx-vibrator.c | 1 - drivers/input/misc/pmic8xxx-pwrkey.c | 1 - drivers/input/misc/pwm-beeper.c | 1 - drivers/input/misc/twl4030-pwrbutton.c | 4 +--- drivers/input/misc/twl6040-vibra.c | 1 - drivers/input/mouse/appletouch.c | 4 +--- drivers/input/mouse/bcm5974.c | 4 +--- drivers/input/mouse/cyapa.c | 4 +--- drivers/input/mouse/inport.c | 1 - drivers/input/mouse/logibm.c | 1 - drivers/input/mouse/pc110pad.c | 1 - drivers/input/mouse/pxa930_trkball.c | 1 - drivers/input/tablet/aiptek.c | 5 +---- drivers/input/tablet/gtco.c | 1 - drivers/input/touchscreen/88pm860x-ts.c | 1 - drivers/input/touchscreen/atmel_mxt_ts.c | 1 - drivers/input/touchscreen/atmel_tsadcc.c | 1 - drivers/input/touchscreen/bu21013_ts.c | 1 - drivers/input/touchscreen/cyttsp4_core.c | 2 -- drivers/input/touchscreen/da9034-ts.c | 1 - drivers/input/touchscreen/edt-ft5x06.c | 1 - drivers/input/touchscreen/eeti_ts.c | 5 +---- drivers/input/touchscreen/htcpen.c | 1 - drivers/input/touchscreen/intel-mid-touch.c | 1 - drivers/input/touchscreen/lpc32xx_ts.c | 1 - drivers/input/touchscreen/mcs5000_ts.c | 1 - drivers/input/touchscreen/migor_ts.c | 1 - drivers/input/touchscreen/mk712.c | 1 - drivers/input/touchscreen/pixcir_i2c_ts.c | 1 - drivers/input/touchscreen/s3c2410_ts.c | 1 - drivers/input/touchscreen/ti_am335x_tsc.c | 1 - drivers/input/touchscreen/tnetv107x-ts.c | 1 - drivers/media/rc/imon.c | 8 ++------ drivers/media/usb/em28xx/em28xx-input.c | 4 +--- drivers/media/usb/pwc/pwc-if.c | 1 - drivers/platform/x86/asus-laptop.c | 5 ++--- drivers/platform/x86/eeepc-laptop.c | 4 +--- drivers/platform/x86/ideapad-laptop.c | 4 +--- drivers/platform/x86/intel_mid_powerbtn.c | 4 +--- drivers/platform/x86/panasonic-laptop.c | 5 +---- drivers/platform/x86/thinkpad_acpi.c | 1 - drivers/platform/x86/topstar-laptop.c | 4 +--- drivers/platform/x86/toshiba_acpi.c | 4 +--- drivers/staging/cptm1217/clearpad_tm1217.c | 2 -- drivers/staging/iio/adc/mxs-lradc.c | 4 +--- drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c | 2 -- sound/pci/hda/hda_beep.c | 4 +--- 87 files changed, 29 insertions(+), 152 deletions(-)
Signature · 1 line
1.8.1.2.459.gbcd45b4.dirty
PATCH 1/8 Documentation: Remove OOM message after input_allocate_device
Emitting an OOM message isn't necessary after input_allocate_device as there's a generic OOM and a dump_stack already done.
--- Documentation/input/input-programming.txt | 1 - 1 file changed, 1 deletion(-)
Documentation/input/input-programming.txt +0 -1
@@ -38,7 +38,6 @@ static int __init button_init(void) button_dev = input_allocate_device(); if (!button_dev) { - printk(KERN_ERR "button.c: Not enough memory\n"); error = -ENOMEM; goto err_free_irq; }
Signature · 1 line
1.8.1.2.459.gbcd45b4.dirty
PATCH 2/8 cell: Remove OOM message after input_allocate_device
In reply to Joe PerchesEmitting an OOM message isn't necessary after input_allocate_device as there's a generic OOM and a dump_stack already done.
--- arch/powerpc/platforms/cell/cbe_powerbutton.c | 1 - 1 file changed, 1 deletion(-)
arch/powerpc/platforms/cell/cbe_powerbutton.c +0 -1
@@ -58,7 +58,6 @@ static int __init cbe_powerbutton_init(void) dev =input_allocate_device ();if (!dev) { ret = -ENOMEM ; -printk (KERN_ERR "%s: Not enough memory.\n" , __func__); goto out; }
Signature · 1 line
1.8.1.2.459.gbcd45b4.dirty
Re: [Cbe-oss-dev] [PATCH 2/8] cell: Remove OOM message after input_allocate_device
Hi Joe,
Quoted 13 lines · Joe Perches
Emitting an OOM message isn't necessary after
input_allocate_deviceas there's a generic OOM and adump_stackalready done.Signed-off-by Joe Perches <[email protected]>--- arch/powerpc/platforms/cell/cbe_powerbutton.c | 1 - 1 file changed, 1 deletion(-)arch/powerpc/platforms/cell/cbe_powerbutton.c +0
-0
arch/powerpc/platforms/cell/cbe_powerbutton.c static int __init cbe_powerbutton_init(void) · line 62
Quoted 6 lines
arch/powerpc/platforms/cell/cbe_powerbutton.c +0
-1@@ -58,7 +58,6 @@ static int __init cbe_powerbutton_init(void) dev =input_allocate_device ();if (!dev) { ret = -ENOMEM ; -printk (KERN_ERR "%s: Not enough memory.\n" , __func__); goto out; }
Arnd is out on leave, so I'll say that this looks OK.
PATCH 3/8 hid: Remove OOM message after input_allocate_device
In reply to Joe PerchesEmitting an OOM message isn't necessary after input_allocate_device as there's a generic OOM and a dump_stack already done.
--- drivers/hid/hid-input.c | 1 - drivers/hid/hid-picolcd_core.c | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-)
drivers/hid/hid-input.c +0 -1
@@ -1263,7 +1263,6 @@ static struct hid_input *hidinput_allocate(struct hid_device *hid)if (!hidinput || !input_dev) {kfree (hidinput);input_free_device (input_dev); -hid_err (hid,"Out of memory during hid input probe\n" );return NULL ; }
drivers/hid/hid-picolcd_core.c +2 -3
@@ -431,10 +431,9 @@ static int picolcd_init_keys(struct picolcd_data *data, } idev =input_allocate_device (); -if (idev ==NULL ) { -hid_err (hdev,"failed to allocate input device\n" ); +if (idev ==NULL )return -ENOMEM ; - } +input_set_drvdata (idev, hdev);memcpy (data->keycode, def_keymap,sizeof (def_keymap)); idev->name = hdev->name;
Signature · 1 line
1.8.1.2.459.gbcd45b4.dirty
PATCH 4/8 input: Remove OOM message after input_allocate_device
In reply to Joe PerchesEmitting an OOM message isn't necessary after input_allocate_device as there's a generic OOM and a dump_stack already done.
--- drivers/input/joystick/as5011.c | 2 -- drivers/input/joystick/db9.c | 1 - drivers/input/joystick/gamecon.c | 4 +--- drivers/input/joystick/turbografx.c | 1 - drivers/input/joystick/walkera0701.c | 1 - drivers/input/keyboard/amikbd.c | 4 +--- drivers/input/keyboard/davinci_keyscan.c | 1 - drivers/input/keyboard/gpio_keys.c | 1 - drivers/input/keyboard/lpc32xx-keys.c | 1 - drivers/input/keyboard/max7359_keypad.c | 1 - drivers/input/keyboard/mcs_touchkey.c | 1 - drivers/input/keyboard/mpr121_touchkey.c | 1 - drivers/input/keyboard/nomadik-ske-keypad.c | 1 - drivers/input/keyboard/opencores-kbd.c | 1 - drivers/input/keyboard/pmic8xxx-keypad.c | 1 - drivers/input/keyboard/pxa27x_keypad.c | 1 - drivers/input/keyboard/pxa930_rotary.c | 1 - drivers/input/keyboard/qt1070.c | 1 - drivers/input/keyboard/qt2160.c | 1 - drivers/input/keyboard/sh_keysc.c | 1 - drivers/input/keyboard/tc3589x-keypad.c | 1 - drivers/input/keyboard/tnetv107x-keypad.c | 1 - drivers/input/keyboard/w90p910_keypad.c | 1 - drivers/input/misc/88pm80x_onkey.c | 1 - drivers/input/misc/88pm860x_onkey.c | 1 - drivers/input/misc/arizona-haptics.c | 4 +--- drivers/input/misc/atlas_btns.c | 4 +--- drivers/input/misc/da9052_onkey.c | 1 - drivers/input/misc/da9055_onkey.c | 4 +--- drivers/input/misc/ideapad_slidebar.c | 1 - drivers/input/misc/ims-pcu.c | 7 +------ drivers/input/misc/kxtj9.c | 4 +--- drivers/input/misc/max8997_haptic.c | 1 - drivers/input/misc/mc13783-pwrbutton.c | 4 +--- drivers/input/misc/mpu3050.c | 1 - drivers/input/misc/pcf8574_keypad.c | 1 - drivers/input/misc/pm8xxx-vibrator.c | 1 - drivers/input/misc/pmic8xxx-pwrkey.c | 1 - drivers/input/misc/pwm-beeper.c | 1 - drivers/input/misc/twl4030-pwrbutton.c | 4 +--- drivers/input/misc/twl6040-vibra.c | 1 - drivers/input/mouse/appletouch.c | 4 +--- drivers/input/mouse/bcm5974.c | 4 +--- drivers/input/mouse/cyapa.c | 4 +--- drivers/input/mouse/inport.c | 1 - drivers/input/mouse/logibm.c | 1 - drivers/input/mouse/pc110pad.c | 1 - drivers/input/mouse/pxa930_trkball.c | 1 - drivers/input/tablet/aiptek.c | 5 +---- drivers/input/tablet/gtco.c | 1 - drivers/input/touchscreen/88pm860x-ts.c | 1 - drivers/input/touchscreen/atmel_mxt_ts.c | 1 - drivers/input/touchscreen/atmel_tsadcc.c | 1 - drivers/input/touchscreen/bu21013_ts.c | 1 - drivers/input/touchscreen/cyttsp4_core.c | 2 -- drivers/input/touchscreen/da9034-ts.c | 1 - drivers/input/touchscreen/edt-ft5x06.c | 1 - drivers/input/touchscreen/eeti_ts.c | 5 +---- drivers/input/touchscreen/htcpen.c | 1 - drivers/input/touchscreen/intel-mid-touch.c | 1 - drivers/input/touchscreen/lpc32xx_ts.c | 1 - drivers/input/touchscreen/mcs5000_ts.c | 1 - drivers/input/touchscreen/migor_ts.c | 1 - drivers/input/touchscreen/mk712.c | 1 - drivers/input/touchscreen/pixcir_i2c_ts.c | 1 - drivers/input/touchscreen/s3c2410_ts.c | 1 - drivers/input/touchscreen/ti_am335x_tsc.c | 1 - drivers/input/touchscreen/tnetv107x-ts.c | 1 - 68 files changed, 14 insertions(+), 103 deletions(-)
drivers/input/joystick/as5011.c +0 -2
@@ -254,8 +254,6 @@ static int as5011_probe(struct i2c_client *client, as5011 =kmalloc (sizeof (struct as5011_device ),GFP_KERNEL ); input_dev =input_allocate_device ();if (!as5011 || !input_dev) { -dev_err (&client->dev, -"Can't allocate memory for device structure\n" ); error = -ENOMEM ; goto err_free_mem; }
drivers/input/joystick/db9.c +0 -1
@@ -609,7 +609,6 @@ static struct db9 __init *db9_probe(int parport, int mode) db9->dev[i] = input_dev =input_allocate_device ();if (!input_dev) { -printk (KERN_ERR "db9.c: Not enough memory for input device\n" ); err = -ENOMEM ; goto err_unreg_devs; }
drivers/input/joystick/gamecon.c +1 -3
@@ -824,10 +824,8 @@ static int __init gc_setup_pad(struct gc *gc, int idx, int pad_type) } pad->dev = input_dev =input_allocate_device (); -if (!input_dev) { -pr_err ("Not enough memory for input device\n" ); +if (!input_dev)return -ENOMEM ; - } pad->type = pad_type;
drivers/input/joystick/turbografx.c +0 -1
@@ -204,7 +204,6 @@ static struct tgfx __init *tgfx_probe(int parport, int *n_buttons, int n_devs) tgfx->dev[i] = input_dev =input_allocate_device ();if (!input_dev) { -printk (KERN_ERR "turbografx.c: Not enough memory for input device\n" ); err = -ENOMEM ; goto err_unreg_devs; }
drivers/input/joystick/walkera0701.c +0 -1
@@ -237,7 +237,6 @@ static int walkera0701_connect(struct walkera_dev *w, int parport) w->input_dev =input_allocate_device ();if (!w->input_dev) { -pr_err ("failed to allocate input device\n" ); error = -ENOMEM ; goto err_unregister_device; }
drivers/input/keyboard/amikbd.c +1 -3
@@ -189,10 +189,8 @@ static int __init amikbd_probe(struct platform_device *pdev)int i, j, err; dev =input_allocate_device (); -if (!dev) { -dev_err (&pdev->dev,"Not enough memory for input device\n" ); +if (!dev)return -ENOMEM ; - } dev->name = pdev->name; dev->phys ="amikbd/input0" ;
drivers/input/keyboard/davinci_keyscan.c +0 -1
@@ -200,7 +200,6 @@ static int __init davinci_ks_probe(struct platform_device *pdev) key_dev =input_allocate_device ();if (!key_dev) { -dev_dbg (dev,"could not allocate input device\n" ); error = -ENOMEM ; goto fail1; }
drivers/input/keyboard/gpio_keys.c +0 -1
@@ -704,7 +704,6 @@ static int gpio_keys_probe(struct platform_device *pdev) GFP_KERNEL); input =input_allocate_device ();if (!ddata || !input) { -dev_err (dev,"failed to allocate state\n" ); error = -ENOMEM ; goto fail1; }
drivers/input/keyboard/lpc32xx-keys.c +0 -1
@@ -211,7 +211,6 @@ static int lpc32xx_kscan_probe(struct platform_device *pdev) kscandat->input = input =input_allocate_device ();if (!input) { -dev_err (&pdev->dev,"failed to allocate input device\n" ); error = -ENOMEM ; goto err_free_keymap; }
drivers/input/keyboard/max7359_keypad.c +0 -1
@@ -205,7 +205,6 @@ static int max7359_probe(struct i2c_client *client, keypad =kzalloc (sizeof (struct max7359_keypad ),GFP_KERNEL ); input_dev =input_allocate_device ();if (!keypad || !input_dev) { -dev_err (&client->dev,"failed to allocate memory\n" ); error = -ENOMEM ; goto failed_free_mem; }
drivers/input/keyboard/mcs_touchkey.c +0 -1
@@ -119,7 +119,6 @@ static int mcs_touchkey_probe(struct i2c_client *client, GFP_KERNEL); input_dev =input_allocate_device ();if (!data || !input_dev) { -dev_err (&client->dev,"Failed to allocate memory\n" ); error = -ENOMEM ; goto err_free_mem; }
drivers/input/keyboard/mpr121_touchkey.c +0 -1
@@ -217,7 +217,6 @@ static int mpr_touchkey_probe(struct i2c_client *client, mpr121 =kzalloc (sizeof (struct mpr121_touchkey ),GFP_KERNEL ); input_dev =input_allocate_device ();if (!mpr121 || !input_dev) { -dev_err (&client->dev,"Failed to allocate memory\n" ); error = -ENOMEM ; goto err_free_mem; }
drivers/input/keyboard/nomadik-ske-keypad.c +0 -1
@@ -249,7 +249,6 @@ static int __init ske_keypad_probe(struct platform_device *pdev) keypad =kzalloc (sizeof (struct ske_keypad ),GFP_KERNEL ); input =input_allocate_device ();if (!keypad || !input) { -dev_err (&pdev->dev,"failed to allocate keypad memory\n" ); error = -ENOMEM ; goto err_free_mem; }
drivers/input/keyboard/opencores-kbd.c +0 -1
@@ -59,7 +59,6 @@ static int opencores_kbd_probe(struct platform_device *pdev) opencores_kbd =kzalloc (sizeof (*opencores_kbd),GFP_KERNEL ); input =input_allocate_device ();if (!opencores_kbd || !input) { -dev_err (&pdev->dev,"failed to allocate device structures\n" ); error = -ENOMEM ; goto err_free_mem; }
drivers/input/keyboard/pmic8xxx-keypad.c +0 -1
@@ -597,7 +597,6 @@ static int pmic8xxx_kp_probe(struct platform_device *pdev) kp->input =input_allocate_device ();if (!kp->input) { -dev_err (&pdev->dev,"unable to allocate input device\n" ); rc = -ENOMEM ; goto err_alloc_device; }
drivers/input/keyboard/pxa27x_keypad.c +0 -1
@@ -741,7 +741,6 @@ static int pxa27x_keypad_probe(struct platform_device *pdev) keypad =kzalloc (sizeof (struct pxa27x_keypad ),GFP_KERNEL ); input_dev =input_allocate_device ();if (!keypad || !input_dev) { -dev_err (&pdev->dev,"failed to allocate memory\n" ); error = -ENOMEM ; goto failed_free; }
drivers/input/keyboard/pxa930_rotary.c +0 -1
@@ -125,7 +125,6 @@ static int pxa930_rotary_probe(struct platform_device *pdev)/* allocate and register the input device */ input_dev =input_allocate_device ();if (!input_dev) { -dev_err (&pdev->dev,"failed to allocate input device\n" ); err = -ENOMEM ; goto failed_free_io; }
drivers/input/keyboard/qt1070.c +0 -1
@@ -167,7 +167,6 @@ static int qt1070_probe(struct i2c_client *client, data =kzalloc (sizeof (struct qt1070_data ),GFP_KERNEL ); input =input_allocate_device ();if (!data || !input) { -dev_err (&client->dev,"insufficient memory\n" ); err = -ENOMEM ; goto err_free_mem; }
drivers/input/keyboard/qt2160.c +0 -1
@@ -399,7 +399,6 @@ static int qt2160_probe(struct i2c_client *client, qt2160 =kzalloc (sizeof (struct qt2160_data ),GFP_KERNEL ); input =input_allocate_device ();if (!qt2160 || !input) { -dev_err (&client->dev,"insufficient memory\n" ); error = -ENOMEM ; goto err_free_mem; }
drivers/input/keyboard/sh_keysc.c +0 -1
@@ -210,7 +210,6 @@ static int sh_keysc_probe(struct platform_device *pdev) priv->input =input_allocate_device ();if (!priv->input) { -dev_err (&pdev->dev,"failed to allocate input device\n" ); error = -ENOMEM ; goto err2; }
drivers/input/keyboard/tc3589x-keypad.c +0 -1
@@ -318,7 +318,6 @@ static int tc3589x_keypad_probe(struct platform_device *pdev) keypad =kzalloc (sizeof (struct tc_keypad ),GFP_KERNEL ); input =input_allocate_device ();if (!keypad || !input) { -dev_err (&pdev->dev,"failed to allocate keypad memory\n" ); error = -ENOMEM ; goto err_free_mem; }
drivers/input/keyboard/tnetv107x-keypad.c +0 -1
@@ -243,7 +243,6 @@ static int keypad_probe(struct platform_device *pdev) kp->input_dev =input_allocate_device ();if (!kp->input_dev) { -dev_err (dev,"cannot allocate input device\n" ); error = -ENOMEM ; goto error_input; }
drivers/input/keyboard/w90p910_keypad.c +0 -1
@@ -145,7 +145,6 @@ static int w90p910_keypad_probe(struct platform_device *pdev) keypad =kzalloc (sizeof (struct w90p910_keypad ),GFP_KERNEL ); input_dev =input_allocate_device ();if (!keypad || !input_dev) { -dev_err (&pdev->dev,"failed to allocate driver data\n" ); error = -ENOMEM ; goto failed_free; }
drivers/input/misc/88pm80x_onkey.c +0 -1
@@ -91,7 +91,6 @@ static int pm80x_onkey_probe(struct platform_device *pdev) info->idev =input_allocate_device ();if (!info->idev) { -dev_err (&pdev->dev,"Failed to allocate input dev\n" ); err = -ENOMEM ; goto out; }
drivers/input/misc/88pm860x_onkey.c +0 -1
@@ -78,7 +78,6 @@ static int pm860x_onkey_probe(struct platform_device *pdev) info->idev =input_allocate_device ();if (!info->idev) { -dev_err (chip->dev,"Failed to allocate input dev\n" ); ret = -ENOMEM ; goto out; }
drivers/input/misc/arizona-haptics.c +1 -3
@@ -190,10 +190,8 @@ static int arizona_haptics_probe(struct platform_device *pdev)INIT_WORK (&haptics->work, arizona_haptics_work); haptics->input_dev =input_allocate_device (); -if (haptics->input_dev ==NULL ) { -dev_err (arizona->dev,"Failed to allocate input device\n" ); +if (haptics->input_dev ==NULL )return -ENOMEM ; - }input_set_drvdata (haptics->input_dev, haptics);
drivers/input/misc/atlas_btns.c +1 -3
@@ -79,10 +79,8 @@ static int atlas_acpi_button_add(struct acpi_device *device)int err; input_dev =input_allocate_device (); -if (!input_dev) { -pr_err ("unable to allocate input device\n" ); +if (!input_dev)return -ENOMEM ; - } input_dev->name ="Atlas ACPI button driver" ; input_dev->phys ="ASIM0000/atlas/input0" ;
drivers/input/misc/da9052_onkey.c +0 -1
@@ -85,7 +85,6 @@ static int da9052_onkey_probe(struct platform_device *pdev) onkey =kzalloc (sizeof (*onkey),GFP_KERNEL ); input_dev =input_allocate_device ();if (!onkey || !input_dev) { -dev_err (&pdev->dev,"Failed to allocate memory\n" ); error = -ENOMEM ; goto err_free_mem; }
drivers/input/misc/da9055_onkey.c +1 -3
@@ -94,10 +94,8 @@ static int da9055_onkey_probe(struct platform_device *pdev) } input_dev =input_allocate_device (); -if (!input_dev) { -dev_err (&pdev->dev,"Failed to allocate memory\n" ); +if (!input_dev)return -ENOMEM ; - } onkey->input = input_dev; onkey->da9055 = da9055;
drivers/input/misc/ideapad_slidebar.c +0 -1
@@ -223,7 +223,6 @@ static int __init ideapad_probe(struct platform_device* pdev) slidebar_input_dev =input_allocate_device ();if (!slidebar_input_dev) { -dev_err (&pdev->dev,"Failed to allocate input device\n" ); err = -ENOMEM ; goto err_release_ports; }
drivers/input/misc/ims-pcu.c +1 -6
@@ -206,11 +206,8 @@ static int ims_pcu_setup_buttons(struct ims_pcu *pcu,int error; input =input_allocate_device (); -if (!input) { -dev_err (pcu->dev, -"Not enough memory for input input device\n" ); +if (!input)return -ENOMEM ; - }snprintf (buttons->name,sizeof (buttons->name),"IMS PCU#%d Button Interface" , pcu->device_no);
@@ -290,8 +287,6 @@ static int ims_pcu_setup_gamepad(struct ims_pcu *pcu) gamepad =kzalloc (sizeof (struct ims_pcu_gamepad ),GFP_KERNEL ); input =input_allocate_device ();if (!gamepad || !input) { -dev_err (pcu->dev, -"Not enough memory for gamepad device\n" ); error = -ENOMEM ; goto err_free_mem; }
drivers/input/misc/kxtj9.c +1 -3
@@ -314,10 +314,8 @@ static int kxtj9_setup_input_device(struct kxtj9_data *tj9)int err; input_dev =input_allocate_device (); -if (!input_dev) { -dev_err (&tj9->client->dev,"input device allocate failed\n" ); +if (!input_dev)return -ENOMEM ; - } tj9->input_dev = input_dev;
drivers/input/misc/max8997_haptic.c +0 -1
@@ -260,7 +260,6 @@ static int max8997_haptic_probe(struct platform_device *pdev) chip =kzalloc (sizeof (struct max8997_haptic ),GFP_KERNEL ); input_dev =input_allocate_device ();if (!chip || !input_dev) { -dev_err (&pdev->dev,"unable to allocate memory\n" ); error = -ENOMEM ; goto err_free_mem; }
drivers/input/misc/mc13783-pwrbutton.c +1 -3
@@ -105,10 +105,8 @@ static int mc13783_pwrbutton_probe(struct platform_device *pdev) } pwr =input_allocate_device (); -if (!pwr) { -dev_dbg (&pdev->dev,"Can't allocate power button\n" ); +if (!pwr)return -ENOMEM ; - } priv =kzalloc (sizeof (*priv),GFP_KERNEL );if (!priv) {
drivers/input/misc/mpu3050.c +0 -1
@@ -317,7 +317,6 @@ static int mpu3050_probe(struct i2c_client *client, sensor =kzalloc (sizeof (struct mpu3050_sensor ),GFP_KERNEL ); idev =input_allocate_device ();if (!sensor || !idev) { -dev_err (&client->dev,"failed to allocate driver data\n" ); error = -ENOMEM ; goto err_free_mem; }
drivers/input/misc/pcf8574_keypad.c +0 -1
@@ -99,7 +99,6 @@ static int pcf8574_kp_probe(struct i2c_client *client, const struct i2c_device_i idev =input_allocate_device ();if (!idev) { -dev_err (&client->dev,"Can't allocate input device\n" ); ret = -ENOMEM ; goto fail_allocate; }
drivers/input/misc/pm8xxx-vibrator.c +0 -1
@@ -189,7 +189,6 @@ static int pm8xxx_vib_probe(struct platform_device *pdev) vib =kzalloc (sizeof (*vib),GFP_KERNEL ); input_dev =input_allocate_device ();if (!vib || !input_dev) { -dev_err (&pdev->dev,"couldn't allocate memory\n" ); error = -ENOMEM ; goto err_free_mem; }
drivers/input/misc/pmic8xxx-pwrkey.c +0 -1
@@ -109,7 +109,6 @@ static int pmic8xxx_pwrkey_probe(struct platform_device *pdev) pwr =input_allocate_device ();if (!pwr) { -dev_dbg (&pdev->dev,"Can't allocate power button\n" ); err = -ENOMEM ; goto free_pwrkey; }
drivers/input/misc/pwm-beeper.c +0 -1
@@ -89,7 +89,6 @@ static int pwm_beeper_probe(struct platform_device *pdev) beeper->input =input_allocate_device ();if (!beeper->input) { -dev_err (&pdev->dev,"Failed to allocate input device\n" ); error = -ENOMEM ; goto err_pwm_free; }
drivers/input/misc/twl4030-pwrbutton.c +1 -3
@@ -59,10 +59,8 @@ static int __init twl4030_pwrbutton_probe(struct platform_device *pdev)int err; pwr =input_allocate_device (); -if (!pwr) { -dev_dbg (&pdev->dev,"Can't allocate power button\n" ); +if (!pwr)return -ENOMEM ; - } pwr->evbit[0 ] =BIT_MASK (EV_KEY ); pwr->keybit[BIT_WORD (KEY_POWER )] =BIT_MASK (KEY_POWER );
drivers/input/misc/twl6040-vibra.c +0 -1
@@ -354,7 +354,6 @@ static int twl6040_vibra_probe(struct platform_device *pdev) info->input_dev =input_allocate_device ();if (info->input_dev ==NULL ) { -dev_err (info->dev,"couldn't allocate input device\n" ); ret = -ENOMEM ; goto err_regulator; }
drivers/input/mouse/appletouch.c +1 -3
@@ -798,10 +798,8 @@ static int atp_probe(struct usb_interface *iface,/* allocate memory for our device state and initialize it */ dev =kzalloc (sizeof (struct atp ),GFP_KERNEL ); input_dev =input_allocate_device (); -if (!dev || !input_dev) { -dev_err (&iface->dev,"Out of memory\n" ); +if (!dev || !input_dev) goto err_free_devs; - } dev->udev = udev; dev->intf = iface;
drivers/input/mouse/bcm5974.c +1 -3
@@ -862,10 +862,8 @@ static int bcm5974_probe(struct usb_interface *iface,/* allocate memory for our device state and initialize it */ dev =kzalloc (sizeof (struct bcm5974 ),GFP_KERNEL ); input_dev =input_allocate_device (); -if (!dev || !input_dev) { -dev_err (&iface->dev,"out of memory\n" ); +if (!dev || !input_dev) goto err_free_devs; - } dev->udev = udev; dev->intf = iface;
drivers/input/mouse/cyapa.c +1 -3
@@ -763,10 +763,8 @@ static int cyapa_create_input_dev(struct cyapa *cyapa)return -EINVAL ; input = cyapa->input =input_allocate_device (); -if (!input) { -dev_err (dev,"allocate memory for input device failed\n" ); +if (!input)return -ENOMEM ; - } input->name =CYAPA_NAME ; input->phys = cyapa->phys;
drivers/input/mouse/inport.c +0 -1
@@ -148,7 +148,6 @@ static int __init inport_init(void) inport_dev =input_allocate_device ();if (!inport_dev) { -printk (KERN_ERR "inport.c: Not enough memory for input device\n" ); err = -ENOMEM ; goto err_release_region; }
drivers/input/mouse/logibm.c +0 -1
@@ -141,7 +141,6 @@ static int __init logibm_init(void) logibm_dev =input_allocate_device ();if (!logibm_dev) { -printk (KERN_ERR "logibm.c: Not enough memory for input device\n" ); err = -ENOMEM ; goto err_release_region; }
drivers/input/mouse/pc110pad.c +0 -1
@@ -129,7 +129,6 @@ static int __init pc110pad_init(void) pc110pad_dev =input_allocate_device ();if (!pc110pad_dev) { -printk (KERN_ERR "pc110pad: Not enough memory.\n" ); err = -ENOMEM ; goto err_free_irq; }
drivers/input/mouse/pxa930_trkball.c +0 -1
@@ -194,7 +194,6 @@ static int pxa930_trkball_probe(struct platform_device *pdev) input =input_allocate_device ();if (!input) { -dev_err (&pdev->dev,"failed to allocate input device\n" ); error = -ENOMEM ; goto failed_free_irq; }
drivers/input/tablet/aiptek.c +1 -4
@@ -1710,11 +1710,8 @@ aiptek_probe(struct usb_interface *intf, const struct usb_device_id *id) aiptek =kzalloc (sizeof (struct aiptek ),GFP_KERNEL ); inputdev =input_allocate_device (); -if (!aiptek || !inputdev) { -dev_warn (&intf->dev, -"cannot allocate memory or input device\n" ); +if (!aiptek || !inputdev) goto fail1; - } aiptek->data =usb_alloc_coherent (usbdev,AIPTEK_PACKET_LENGTH ,GFP_ATOMIC , &aiptek->data_dma);
drivers/input/tablet/gtco.c +0 -1
@@ -840,7 +840,6 @@ static int gtco_probe(struct usb_interface *usbinterface, gtco =kzalloc (sizeof (struct gtco ),GFP_KERNEL ); input_dev =input_allocate_device ();if (!gtco || !input_dev) { -dev_err (&usbinterface->dev,"No more memory\n" ); error = -ENOMEM ; goto err_free_devs; }
drivers/input/touchscreen/88pm860x-ts.c +0 -1
@@ -241,7 +241,6 @@ static int pm860x_touch_probe(struct platform_device *pdev) touch->idev =input_allocate_device ();if (touch->idev ==NULL ) { -dev_err (&pdev->dev,"Failed to allocate input device!\n" ); ret = -ENOMEM ; goto out; }
drivers/input/touchscreen/atmel_mxt_ts.c +0 -1
@@ -1142,7 +1142,6 @@ static int mxt_probe(struct i2c_client *client, data =kzalloc (sizeof (struct mxt_data ),GFP_KERNEL ); input_dev =input_allocate_device ();if (!data || !input_dev) { -dev_err (&client->dev,"Failed to allocate memory\n" ); error = -ENOMEM ; goto err_free_mem; }
drivers/input/touchscreen/atmel_tsadcc.c +0 -1
@@ -206,7 +206,6 @@ static int atmel_tsadcc_probe(struct platform_device *pdev) input_dev =input_allocate_device ();if (!input_dev) { -dev_err (&pdev->dev,"failed to allocate input device.\n" ); err = -EBUSY ; goto err_free_mem; }
drivers/input/touchscreen/bu21013_ts.c +0 -1
@@ -524,7 +524,6 @@ static int bu21013_probe(struct i2c_client *client, bu21013_data =kzalloc (sizeof (struct bu21013_ts_data ),GFP_KERNEL ); in_dev =input_allocate_device ();if (!bu21013_data || !in_dev) { -dev_err (&client->dev,"device memory alloc failed\n" ); error = -ENOMEM ; goto err_free_mem; }
drivers/input/touchscreen/cyttsp4_core.c +0 -2
@@ -1958,8 +1958,6 @@ static int cyttsp4_mt_probe(struct cyttsp4 *cd) __func__); md->input =input_allocate_device ();if (md->input ==NULL ) { -dev_err (dev,"%s: Error, failed to allocate input device\n" , - __func__); rc = -ENOSYS ; goto error_alloc_failed; }
drivers/input/touchscreen/da9034-ts.c +0 -1
@@ -325,7 +325,6 @@ static int da9034_touch_probe(struct platform_device *pdev) input_dev =input_allocate_device ();if (!input_dev) { -dev_err (&pdev->dev,"failed to allocate input device\n" ); ret = -ENOMEM ; goto err_free_touch; }
drivers/input/touchscreen/edt-ft5x06.c +0 -1
@@ -736,7 +736,6 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client, tsdata =kzalloc (sizeof (*tsdata),GFP_KERNEL ); input =input_allocate_device ();if (!tsdata || !input) { -dev_err (&client->dev,"failed to allocate driver data.\n" ); error = -ENOMEM ; goto err_free_mem; }
drivers/input/touchscreen/eeti_ts.c +1 -4
@@ -178,11 +178,8 @@ static int eeti_ts_probe(struct i2c_client *client,mutex_init (&priv->mutex); input =input_allocate_device (); - -if (!input) { -dev_err (&client->dev,"Failed to allocate input device.\n" ); +if (!input) goto err1; - } input->evbit[0 ] =BIT_MASK (EV_KEY ) |BIT_MASK (EV_ABS ); input->keybit[BIT_WORD (BTN_TOUCH )] =BIT_MASK (BTN_TOUCH );
drivers/input/touchscreen/htcpen.c +0 -1
@@ -127,7 +127,6 @@ static int htcpen_isa_probe(struct device *dev, unsigned int id) htcpen_dev =input_allocate_device ();if (!htcpen_dev) { -printk (KERN_ERR "htcpen: can't allocate device\n" ); err = -ENOMEM ; goto input_alloc_failed; }
drivers/input/touchscreen/intel-mid-touch.c +0 -1
@@ -584,7 +584,6 @@ static int mrstouch_probe(struct platform_device *pdev) tsdev =kzalloc (sizeof (struct mrstouch_dev ),GFP_KERNEL ); input =input_allocate_device ();if (!tsdev || !input) { -dev_err (&pdev->dev,"unable to allocate memory\n" ); err = -ENOMEM ; goto err_free_mem; }
drivers/input/touchscreen/lpc32xx_ts.c +0 -1
@@ -227,7 +227,6 @@ static int lpc32xx_ts_probe(struct platform_device *pdev) tsc =kzalloc (sizeof (*tsc),GFP_KERNEL ); input =input_allocate_device ();if (!tsc || !input) { -dev_err (&pdev->dev,"failed allocating memory\n" ); error = -ENOMEM ; goto err_free_mem; }
drivers/input/touchscreen/mcs5000_ts.c +0 -1
@@ -200,7 +200,6 @@ static int mcs5000_ts_probe(struct i2c_client *client, data =kzalloc (sizeof (struct mcs5000_ts_data ),GFP_KERNEL ); input_dev =input_allocate_device ();if (!data || !input_dev) { -dev_err (&client->dev,"Failed to allocate memory\n" ); ret = -ENOMEM ; goto err_free_mem; }
drivers/input/touchscreen/migor_ts.c +0 -1
@@ -139,7 +139,6 @@ static int migor_ts_probe(struct i2c_client *client, priv =kzalloc (sizeof (*priv),GFP_KERNEL ); input =input_allocate_device ();if (!priv || !input) { -dev_err (&client->dev,"failed to allocate memory\n" ); error = -ENOMEM ; goto err_free_mem; }
drivers/input/touchscreen/mk712.c +0 -1
@@ -170,7 +170,6 @@ static int __init mk712_init(void) mk712_dev =input_allocate_device ();if (!mk712_dev) { -printk (KERN_ERR "mk712: not enough memory\n" ); err = -ENOMEM ; goto fail1; }
drivers/input/touchscreen/pixcir_i2c_ts.c +0 -1
@@ -141,7 +141,6 @@ static int pixcir_i2c_ts_probe(struct i2c_client *client, tsdata =kzalloc (sizeof (*tsdata),GFP_KERNEL ); input =input_allocate_device ();if (!tsdata || !input) { -dev_err (&client->dev,"Failed to allocate driver data!\n" ); error = -ENOMEM ; goto err_free_mem; }
drivers/input/touchscreen/s3c2410_ts.c +0 -1
@@ -308,7 +308,6 @@ static int s3c2410ts_probe(struct platform_device *pdev) input_dev =input_allocate_device ();if (!input_dev) { -dev_err (dev,"Unable to allocate the input device !!\n" ); ret = -ENOMEM ; goto err_iomap; }
drivers/input/touchscreen/ti_am335x_tsc.c +0 -1
@@ -378,7 +378,6 @@ static int titsc_probe(struct platform_device *pdev) ts_dev =kzalloc (sizeof (struct titsc ),GFP_KERNEL ); input_dev =input_allocate_device ();if (!ts_dev || !input_dev) { -dev_err (&pdev->dev,"failed to allocate memory.\n" ); err = -ENOMEM ; goto err_free_mem; }
drivers/input/touchscreen/tnetv107x-ts.c +0 -1
@@ -306,7 +306,6 @@ static int tsc_probe(struct platform_device *pdev) ts->input_dev =input_allocate_device ();if (!ts->input_dev) { -dev_err (dev,"cannot allocate input device\n" ); error = -ENOMEM ; goto error_input; }
Signature · 1 line
1.8.1.2.459.gbcd45b4.dirty
Re: [PATCH 4/8] input: Remove OOM message after input_allocate_device
Hello Joe,
Quoted 10 lines · Joe Perches
Emitting an OOM message isn't necessary after
input_allocate_deviceas there's a generic OOM and adump_stackalready done.[...]Signed-off-by Joe Perches <[email protected]>drivers/input/joystick/as5011.c +0
-0
drivers/input/joystick/as5011.c static int as5011_probe(struct i2c_client *client, · line 258
Quoted 5 lines
drivers/input/joystick/as5011.c +0
-2@@ -254,8 +254,6 @@ static int as5011_probe(struct i2c_client *client, as5011 =kmalloc (sizeof (struct as5011_device ),GFP_KERNEL ); input_dev =input_allocate_device ();if (!as5011 || !input_dev) { -dev_err (&client->dev, -"Can't allocate memory for device structure\n" );
Don't know if that can happen, but if as5011 is NULL but input_dev isn't the message would still be sensible, wouldn't it? There are several more that suffer the same "problem".
Best regards
Uwe
Signature · 2 lines
Pengutronix e.K. | Uwe Kleine-K?nig | Industrial Linux Solutions | http://www.pengutronix.de/ |
Re: [PATCH 4/8] input: Remove OOM message after input_allocate_device
Quoted 6 lines · Uwe Kleine-K?nig
Hello Joe,
Quoted 3 lines · Joe Perches
Emitting an OOM message isn't necessary after
input_allocate_deviceas there's a generic OOM and adump_stackalready done.
Quoted 15 lines
drivers/input/joystick/as5011.c static int as5011_probe(struct i2c_client *client, · line 258
Quoted 12 lines
[...]Signed-off-by Joe Perches <[email protected]>drivers/input/joystick/as5011.c +0
-2@@ -254,8 +254,6 @@ static int as5011_probe(struct i2c_client *client, as5011 =kmalloc (sizeof (struct as5011_device ),GFP_KERNEL ); input_dev =input_allocate_device ();if (!as5011 || !input_dev) { -dev_err (&client->dev, -"Can't allocate memory for device structure\n" );Don't know if that can happen, but if as5011 is NULL but
input_devisn't the message would still be sensible, wouldn't it? There are several more that suffer the same "problem".
Any k.alloc without __GFP_NOWARN does a generic OOM message and a dump_stack() so there could already be 2 messages anyway.
cheers, Joe
Re: [PATCH 4/8] input: Remove OOM message after input_allocate_device
Quoted 23 lines · Joe Perches
Quoted 6 lines · Uwe Kleine-K?nig
Hello Joe,
Quoted 3 lines · Joe Perches
Emitting an OOM message isn't necessary after
input_allocate_deviceas there's a generic OOM and adump_stackalready done.Quoted 15 lines
drivers/input/joystick/as5011.c static int as5011_probe(struct i2c_client *client, · line 258
Quoted 12 lines
[...]Signed-off-by Joe Perches <[email protected]>drivers/input/joystick/as5011.c +0
-2@@ -254,8 +254,6 @@ static int as5011_probe(struct i2c_client *client, as5011 =kmalloc (sizeof (struct as5011_device ),GFP_KERNEL ); input_dev =input_allocate_device ();if (!as5011 || !input_dev) { -dev_err (&client->dev, -"Can't allocate memory for device structure\n" );Don't know if that can happen, but if as5011 is NULL but
input_devisn't the message would still be sensible, wouldn't it? There are several more that suffer the same "problem".
Quoted 2 lines
Any k.alloc without
__GFP_NOWARNdoes a generic OOM message and adump_stack()so there could already be 2 messages anyway.
Then mention that in the commit log if you still want this patch?!
Best regards
Uwe
Signature · 2 lines
Pengutronix e.K. | Uwe Kleine-K?nig | Industrial Linux Solutions | http://www.pengutronix.de/ |
Re: [PATCH 4/8] input: Remove OOM message after input_allocate_device
Quoted 1 line · Uwe Kleine-K?nig
On Thu, Oct 24, 2013 at 11:43:38AM -0700, Joe Perches wrote:
[]
Quoted 3 lines
Quoted 2 lines
Any k.alloc without
__GFP_NOWARNdoes a generic OOM message and adump_stack()so there could already be 2 messages anyway.Then mention that in the commit log if you still want this patch?!
How do you think this commit message should be changed:
Emitting an OOM message isn't necessary after input_allocate_device as there's a generic OOM and a dump_stack already done.
Re: [PATCH 4/8] input: Remove OOM message after input_allocate_device
Quoted 11 lines · Joe Perches
Quoted 1 line · Uwe Kleine-K?nig
On Thu, Oct 24, 2013 at 11:43:38AM -0700, Joe Perches wrote:
[]
Quoted 3 lines
Quoted 2 lines
Any k.alloc without
__GFP_NOWARNdoes a generic OOM message and adump_stack()so there could already be 2 messages anyway.Then mention that in the commit log if you still want this patch?!
How do you think this commit message should be changed:
Emitting an OOM message isn't necessary after
input_allocate_deviceas there's a generic OOM and adump_stackalready done.
after input_allocate_device and/or k.alloc ...
Best regards
Uwe
Signature · 2 lines
Pengutronix e.K. | Uwe Kleine-K?nig | Industrial Linux Solutions | http://www.pengutronix.de/ |
Dmitry Torokhov
maintainerRe: [PATCH 4/8] input: Remove OOM message after input_allocate_device
In reply to Joe PerchesHi Joe,
Quoted 2 lines · Joe Perches
Emitting an OOM message isn't necessary after
input_allocate_deviceas there's a generic OOM and adump_stackalready done.
No, please don't. The kzalloc may get changed in the future to not dump stack (that was added originally because not everyone was handling OOM properly, right?), input core might get changed to use something else than kzalloc, etc, etc.
The majority of errors use dev_err so we also get idea what device failed (if there are several), and more.
Thanks.
Signature · 1 line
Dmitry
Re: [PATCH 4/8] input: Remove OOM message after input_allocate_device
Quoted 6 lines · Dmitry Torokhov
Hi Joe,
Quoted 2 lines · Joe Perches
Emitting an OOM message isn't necessary after
input_allocate_deviceas there's a generic OOM and adump_stackalready done.
Quoted 7 lines
No, please don't. The kzalloc may get changed in the future to not dump stack (that was added originally because not everyone was handling OOM properly, right?), input core might get changed to use something else than kzalloc, etc, etc.
The majority of errors use
dev_errso we also get idea what device failed (if there are several), and more.
I think that's not valuable as input_allocate_device already has dozens of locations that don't emit a specific OOM and centralizing the location for any generic message would work anyway.
Dmitry Torokhov
maintainerRe: [PATCH 4/8] input: Remove OOM message after input_allocate_device
Quoted 12 lines · Joe Perches
Quoted 11 lines · Dmitry Torokhov
Hi Joe,
Quoted 2 lines · Joe Perches
Emitting an OOM message isn't necessary after
input_allocate_deviceas there's a generic OOM and adump_stackalready done.No, please don't. The kzalloc may get changed in the future to not dump stack (that was added originally because not everyone was handling OOM properly, right?), input core might get changed to use something else than kzalloc, etc, etc.
Quoted 6 lines
Quoted 2 lines
The majority of errors use
dev_errso we also get idea what device failed (if there are several), and more.I think that's not valuable as
input_allocate_devicealready has dozens of locations that don't emit a specific OOM and centralizing the location for any generic message would work anyway.
Not having diagnostic messages in some of the drivers is hardly a justification to remove them from everywhere else.
Signature · 1 line
Dmitry
Re: [PATCH 4/8] input: Remove OOM message after input_allocate_device
Quoted 16 lines · Dmitry Torokhov
Quoted 15 lines · Joe Perches
Quoted 13 lines · Dmitry Torokhov
Hi Joe,
Quoted 2 lines · Joe Perches
Emitting an OOM message isn't necessary after
input_allocate_deviceas there's a generic OOM and adump_stackalready done.No, please don't. The kzalloc may get changed in the future to not dump stack (that was added originally because not everyone was handling OOM properly, right?), input core might get changed to use something else than kzalloc, etc, etc.
The majority of errors use
dev_errso we also get idea what device failed (if there are several), and more.
Quoted 6 lines
Quoted 3 lines
I think that's not valuable as
input_allocate_devicealready has dozens of locations that don't emit a specific OOM and centralizing the location for any generic message would work anyway.Not having diagnostic messages in some of the drivers is hardly a justification to remove them from everywhere else.
But standardization is.
If a diagnostic message is really desired
without the already existing dump_stack(),
it's a small matter of adding something like:
drivers/input/input.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-)
drivers/input/input.c +15 -11
@@ -1736,19 +1736,23 @@ struct input_dev *input_allocate_device(void) {struct input_dev *dev; - dev =kzalloc (sizeof (struct input_dev ),GFP_KERNEL ); -if (dev) { - dev->dev.type = &input_dev_type; - dev->dev.class = &input_class; -device_initialize (&dev->dev); -mutex_init (&dev->mutex); -spin_lock_init (&dev->event_lock); -INIT_LIST_HEAD (&dev->h_list); -INIT_LIST_HEAD (&dev->node); - -__module_get (THIS_MODULE ); + dev =kzalloc (sizeof (struct input_dev ),GFP_KERNEL | __GFP_NOWARN); +if (!dev) { +pr_err ("%pf: input_allocate_device failed\n" , +__builtin_return_address (1 )); +return NULL ; } + dev->dev.type = &input_dev_type; + dev->dev.class = &input_class; +device_initialize (&dev->dev); +mutex_init (&dev->mutex); +spin_lock_init (&dev->event_lock); +INIT_LIST_HEAD (&dev->h_list); +INIT_LIST_HEAD (&dev->node); + +__module_get (THIS_MODULE ); +return dev; }EXPORT_SYMBOL (input_allocate_device);
PATCH 5/8 media: Remove OOM message after input_allocate_device
In reply to Joe PerchesEmitting an OOM message isn't necessary after input_allocate_device as there's a generic OOM and a dump_stack already done.
--- drivers/media/rc/imon.c | 8 ++------ drivers/media/usb/em28xx/em28xx-input.c | 4 +--- drivers/media/usb/pwc/pwc-if.c | 1 - 3 files changed, 3 insertions(+), 10 deletions(-)
drivers/media/rc/imon.c +2 -6
@@ -1909,10 +1909,8 @@ static struct input_dev *imon_init_idev(struct imon_context *ictx)int ret, i; idev =input_allocate_device (); -if (!idev) { -dev_err (ictx->dev,"input dev allocation failed\n" ); +if (!idev) goto out; - } snprintf(ictx->name_idev, sizeof(ictx->name_idev), "iMON Panel, Knob and Mouse(%04x:%04x)",
@@ -1960,10 +1958,8 @@ static struct input_dev *imon_init_touch(struct imon_context *ictx)int ret; touch =input_allocate_device (); -if (!touch) { -dev_err (ictx->dev,"touchscreen input dev allocation failed\n" ); +if (!touch) goto touch_alloc_failed; - } snprintf(ictx->name_touch, sizeof(ictx->name_touch), "iMON USB Touchscreen (%04x:%04x)",
drivers/media/usb/em28xx/em28xx-input.c +1 -3
@@ -508,10 +508,8 @@ static void em28xx_register_snapshot_button(struct em28xx *dev)em28xx_info ("Registering snapshot button...\n" ); input_dev =input_allocate_device (); -if (!input_dev) { -em28xx_errdev ("input_allocate_device failed\n" ); +if (!input_dev)return ; - }usb_make_path (dev->udev, dev->snapshot_button_path,sizeof (dev->snapshot_button_path));
drivers/media/usb/pwc/pwc-if.c +0 -1
@@ -1078,7 +1078,6 @@ static int usb_pwc_probe(struct usb_interface *intf, const struct usb_device_id/* register webcam snapshot button input device */ pdev->button_dev =input_allocate_device ();if (!pdev->button_dev) { -PWC_ERROR ("Err, insufficient memory for webcam snapshot button device." ); rc = -ENOMEM ; goto err_video_unreg; }
Signature · 1 line
1.8.1.2.459.gbcd45b4.dirty
PATCH 6/8 platform:x86: Remove OOM message after input_allocate_device
In reply to Joe PerchesEmitting an OOM message isn't necessary after input_allocate_device as there's a generic OOM and a dump_stack already done.
--- drivers/platform/x86/asus-laptop.c | 5 ++--- drivers/platform/x86/eeepc-laptop.c | 4 +--- drivers/platform/x86/ideapad-laptop.c | 4 +--- drivers/platform/x86/intel_mid_powerbtn.c | 4 +--- drivers/platform/x86/panasonic-laptop.c | 5 +---- drivers/platform/x86/thinkpad_acpi.c | 1 - drivers/platform/x86/topstar-laptop.c | 4 +--- drivers/platform/x86/toshiba_acpi.c | 4 +--- 8 files changed, 8 insertions(+), 23 deletions(-)
drivers/platform/x86/asus-laptop.c +2 -3
@@ -1494,10 +1494,9 @@ static int asus_input_init(struct asus_laptop *asus)int error; input =input_allocate_device (); -if (!input) { -pr_warn ("Unable to allocate input device\n" ); +if (!input)return -ENOMEM ; - } + input->name ="Asus Laptop extra buttons" ; input->phys =ASUS_LAPTOP_FILE "/input0" ; input->id.bustype =BUS_HOST ;
drivers/platform/x86/eeepc-laptop.c +1 -3
@@ -1203,10 +1203,8 @@ static int eeepc_input_init(struct eeepc_laptop *eeepc)int error; input =input_allocate_device (); -if (!input) { -pr_info ("Unable to allocate input device\n" ); +if (!input)return -ENOMEM ; - } input->name ="Asus EeePC extra buttons" ; input->phys =EEEPC_LAPTOP_FILE "/input0" ;
drivers/platform/x86/ideapad-laptop.c +1 -3
@@ -574,10 +574,8 @@ static int ideapad_input_init(struct ideapad_private *priv)int error; inputdev =input_allocate_device (); -if (!inputdev) { -pr_info ("Unable to allocate input device\n" ); +if (!inputdev)return -ENOMEM ; - } inputdev->name ="Ideapad extra buttons" ; inputdev->phys ="ideapad/input0" ;
drivers/platform/x86/intel_mid_powerbtn.c +1 -3
@@ -66,10 +66,8 @@ static int mfld_pb_probe(struct platform_device *pdev)return -EINVAL ; input =input_allocate_device (); -if (!input) { -dev_err (&pdev->dev,"Input device allocation error\n" ); +if (!input)return -ENOMEM ; - } input->name = pdev->name; input->phys ="power-button/input0" ;
drivers/platform/x86/panasonic-laptop.c +1 -4
@@ -490,11 +490,8 @@ static int acpi_pcc_init_input(struct pcc_acpi *pcc)int error; input_dev =input_allocate_device (); -if (!input_dev) { -ACPI_DEBUG_PRINT ((ACPI_DB_ERROR , -"Couldn't allocate input device for hotkey" )); +if (!input_dev)return -ENOMEM ; - } input_dev->name =ACPI_PCC_DRIVER_NAME ; input_dev->phys =ACPI_PCC_INPUT_PHYS ;
drivers/platform/x86/thinkpad_acpi.c +0 -1
@@ -9056,7 +9056,6 @@ static int __init thinkpad_acpi_module_init(void)mutex_init (&tpacpi_inputdev_send_mutex); tpacpi_inputdev =input_allocate_device ();if (!tpacpi_inputdev) { -pr_err ("unable to allocate input device\n" );thinkpad_acpi_module_exit ();return -ENOMEM ; }else {
drivers/platform/x86/topstar-laptop.c +1 -3
@@ -97,10 +97,8 @@ static int acpi_topstar_init_hkey(struct topstar_hkey *hkey)int error; input =input_allocate_device (); -if (!input) { -pr_err ("Unable to allocate input device\n" ); +if (!input)return -ENOMEM ; - } input->name ="Topstar Laptop extra buttons" ; input->phys ="topstar/input0" ;
drivers/platform/x86/toshiba_acpi.c +1 -3
@@ -975,10 +975,8 @@ static int toshiba_acpi_setup_keyboard(struct toshiba_acpi_dev *dev)u32 hci_result; dev->hotkey_dev =input_allocate_device (); -if (!dev->hotkey_dev) { -pr_info ("Unable to register input device\n" ); +if (!dev->hotkey_dev)return -ENOMEM ; - } dev->hotkey_dev->name ="Toshiba input device" ; dev->hotkey_dev->phys ="toshiba_acpi/input0" ;
Signature · 9 lines
1.8.1.2.459.gbcd45b4.dirty ------------------------------------------------------------------------------ October Webinars: Code for Performance Free Intel webinars can help you accelerate application performance. Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from the latest Intel processors and coprocessors. See abstracts and register > http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
Re: [PATCH 6/8] platform:x86: Remove OOM message after input_allocate_device
Quoted 4 lines · Joe Perches
Emitting an OOM message isn't necessary after
input_allocate_deviceas there's a generic OOM and adump_stackalready done.Signed-off-by Joe Perches <[email protected]>
For the thinkpad-acpi bits:
Signature · 11 lines
"One disk to rule them all, One disk to find them. One disk to bring them all and in the darkness grind them. In the Land of Redmond where the shadows lie." -- The Silicon Valley Tarot Henrique Holschuh ------------------------------------------------------------------------------ October Webinars: Code for Performance Free Intel webinars can help you accelerate application performance. Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from the latest Intel processors and coprocessors. See abstracts and register > http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
Matthew Garrett
AppliedRe: [PATCH 6/8] platform:x86: Remove OOM message after input_allocate_device
In reply to Joe PerchesApplied, thanks.
Signature · 1 line
Matthew Garrett <[email protected]>
PATCH 7/8 staging: Remove OOM message after input_allocate_device
In reply to Joe PerchesEmitting an OOM message isn't necessary after input_allocate_device as there's a generic OOM and a dump_stack already done.
--- drivers/staging/cptm1217/clearpad_tm1217.c | 2 -- drivers/staging/iio/adc/mxs-lradc.c | 4 +--- drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c | 2 -- 3 files changed, 1 insertion(+), 7 deletions(-)
drivers/staging/cptm1217/clearpad_tm1217.c +0 -2
@@ -457,8 +457,6 @@ static int cp_tm1217_probe(struct i2c_client *client,for (i =0 ; i <TOUCH_SUPPORTED ; i++) { input_dev =input_allocate_device ();if (input_dev ==NULL ) { -dev_err (ts->dev, -"cp_tm1217:Input Device Struct alloc failed\n" ); retval = -ENOMEM ; goto fail; }
drivers/staging/iio/adc/mxs-lradc.c +1 -3
@@ -529,10 +529,8 @@ static int mxs_lradc_ts_register(struct mxs_lradc *lradc)return 0 ; input =input_allocate_device (); -if (!input) { -dev_err (dev,"Failed to allocate TS device!\n" ); +if (!input)return -ENOMEM ; - } input->name =DRIVER_NAME ; input->id.bustype =BUS_HOST ;
drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c +0 -2
@@ -911,8 +911,6 @@ static int synaptics_rmi4_probe rmi4_data->input_dev =input_allocate_device ();if (rmi4_data->input_dev ==NULL ) { -dev_err (&client->dev,"%s:input device alloc failed\n" , - __func__); retval = -ENOMEM ; goto err_input; }
Signature · 1 line
1.8.1.2.459.gbcd45b4.dirty
Re: [PATCH 7/8] staging: Remove OOM message after input_allocate_device
Quoted 4 lines · Joe Perches
Emitting an OOM message isn't necessary after
input_allocate_deviceas there's a generic OOM and adump_stackalready done.Signed-off-by Joe Perches <[email protected]>
(for iio driver)
Quoted 49 lines
--- drivers/staging/cptm1217/clearpad_tm1217.c | 2 -- drivers/staging/iio/adc/mxs-lradc.c | 4 +--- drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c | 2 -- 3 files changed, 1 insertion(+), 7 deletions(-)drivers/staging/cptm1217/clearpad_tm1217.c +0
-2@@ -457,8 +457,6 @@ static int cp_tm1217_probe(struct i2c_client *client,for (i =0 ; i <TOUCH_SUPPORTED ; i++) { input_dev =input_allocate_device ();if (input_dev ==NULL ) { -dev_err (ts->dev, -"cp_tm1217:Input Device Struct alloc failed\n" ); retval = -ENOMEM ; goto fail; }drivers/staging/iio/adc/mxs-lradc.c +1
-3@@ -529,10 +529,8 @@ static int mxs_lradc_ts_register(struct mxs_lradc *lradc)return 0 ; input =input_allocate_device (); -if (!input) { -dev_err (dev,"Failed to allocate TS device!\n" ); +if (!input)return -ENOMEM ; - } input->name =DRIVER_NAME ; input->id.bustype =BUS_HOST ;drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c +0
-2@@ -911,8 +911,6 @@ static int synaptics_rmi4_probe rmi4_data->input_dev =input_allocate_device ();if (rmi4_data->input_dev ==NULL ) { -dev_err (&client->dev,"%s:input device alloc failed\n" , - __func__); retval = -ENOMEM ; goto err_input; }
PATCH 8/8 sound: Remove OOM message after input_allocate_device
In reply to Joe PerchesEmitting an OOM message isn't necessary after input_allocate_device as there's a generic OOM and a dump_stack already done.
--- sound/pci/hda/hda_beep.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
sound/pci/hda/hda_beep.c +1 -3
@@ -151,10 +151,8 @@ static int snd_hda_do_attach(struct hda_beep *beep)int err; input_dev =input_allocate_device (); -if (!input_dev) { -printk (KERN_INFO "hda_beep: unable to allocate input device\n" ); +if (!input_dev)return -ENOMEM ; - }/* setup digital beep device */ input_dev->name ="HDA Digital PCBeep" ;
Signature · 1 line
1.8.1.2.459.gbcd45b4.dirty
Takashi Iwai
AppliedRe: [PATCH 8/8] sound: Remove OOM message after input_allocate_device
At Wed, 23 Oct 2013 12:14:54 -0700,
Quoted 5 lines · Joe Perches
Emitting an OOM message isn't necessary after
input_allocate_deviceas there's a generic OOM and adump_stackalready done.Signed-off-by Joe Perches <[email protected]>
Thanks, applied.
Takashi
Quoted 23 lines
--- sound/pci/hda/hda_beep.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)sound/pci/hda/hda_beep.c +1
-3@@ -151,10 +151,8 @@ static int snd_hda_do_attach(struct hda_beep *beep)int err; input_dev =input_allocate_device (); -if (!input_dev) { -printk (KERN_INFO "hda_beep: unable to allocate input device\n" ); +if (!input_dev)return -ENOMEM ; - }/* setup digital beep device */ input_dev->name ="HDA Digital PCBeep" ;Signature · 1 line
1.8.1.2.459.gbcd45b4.dirty