Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1499763
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 14/34] [media] DaVinci-VPFE-Capture: Delete three error messages for a failed memory allocation |
| Date | 2016-10-12 17:10 +0200 |
| Message-ID | <srtkm-688-35@gated-at.bofh.it> (permalink) |
| References | <srsHD-5Fa-11@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 12 Oct 2016 10:22:47 +0200
The script "checkpatch.pl" pointed information out like the following.
WARNING: Possible unnecessary 'out of memory' message
Thus remove such a logging statement in two functions.
Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/media/platform/davinci/vpfe_capture.c | 13 +++----------
1 file changed, 3 insertions(+), 10 deletions(-)
diff --git a/drivers/media/platform/davinci/vpfe_capture.c b/drivers/media/platform/davinci/vpfe_capture.c
index 5c1b8cf..23142f0 100644
--- a/drivers/media/platform/davinci/vpfe_capture.c
+++ b/drivers/media/platform/davinci/vpfe_capture.c
@@ -512,11 +512,9 @@ static int vpfe_open(struct file *file)
/* Allocate memory for the file handle object */
fh = kmalloc(sizeof(struct vpfe_fh), GFP_KERNEL);
- if (NULL == fh) {
- v4l2_err(&vpfe_dev->v4l2_dev,
- "unable to allocate memory for file handle object\n");
+ if (!fh)
return -ENOMEM;
- }
+
/* store pointer to fh in private_data member of file */
file->private_data = fh;
fh->vpfe_dev = vpfe_dev;
@@ -1853,11 +1851,8 @@ static int vpfe_probe(struct platform_device *pdev)
/* Allocate memory for ccdc configuration */
ccdc_cfg = kmalloc(sizeof(struct ccdc_config), GFP_KERNEL);
- if (NULL == ccdc_cfg) {
- v4l2_err(pdev->dev.driver,
- "Memory allocation failed for ccdc_cfg\n");
+ if (!ccdc_cfg)
goto probe_free_dev_mem;
- }
mutex_lock(&ccdc_lock);
@@ -1944,8 +1939,6 @@ static int vpfe_probe(struct platform_device *pdev)
sizeof(*vpfe_dev->sd),
GFP_KERNEL);
if (NULL == vpfe_dev->sd) {
- v4l2_err(&vpfe_dev->v4l2_dev,
- "unable to allocate memory for subdevice pointers\n");
ret = -ENOMEM;
goto probe_out_video_unregister;
}
--
2.10.1
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 00/34] [media] DaVinci-Video Processing: Fine-tuning for several function implementations SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-12 16:30 +0200 [PATCH 01/34] [media] DaVinci-VPBE: Use kmalloc_array() in vpbe_initialize() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-12 16:30 +0200 [PATCH 04/34] [media] DaVinci-VPBE: Combine substrings for four messages SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-12 16:40 +0200 [PATCH 02/34] [media] DaVinci-VPBE: Delete two error messages for a failed memory allocation SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-12 16:40 +0200 [PATCH 10/34] [media] DaVinci-VPBE: Check return value of a setup_if_config() call in vpbe_set_output() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-12 16:50 +0200 [PATCH 09/34] [media] DaVinci-VPBE: Reduce the scope for a variable in vpbe_set_default_output() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-12 16:50 +0200 [PATCH 06/34] [media] DaVinci-VPBE: Return an error code only by a single variable in vpbe_initialize() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-12 16:50 +0200 [PATCH 08/34] [media] DaVinci-VPBE: Return the success indication only as a constant in vpbe_set_mode() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-12 16:50 +0200 [PATCH 07/34] [media] DaVinci-VPBE: Delete an unnecessary variable initialisation in vpbe_initialize() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-12 16:50 +0200 [PATCH 05/34] [media] DaVinci-VPBE: Return an error code only as a constant in vpbe_probe() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-12 16:50 +0200 [PATCH 13/34] [media] DaVinci-VPFE-Capture: Use kmalloc_array() in vpfe_probe() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-12 17:00 +0200 [PATCH 12/34] [media] DaVinci-VPBE: Delete an unnecessary variable initialisation in vpbe_set_output() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-12 17:00 +0200 [PATCH 18/34] [media] DaVinci-VPFE-Capture: Combine substrings for an error message in vpfe_enum_input() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-12 17:00 +0200 [PATCH 15/34] [media] DaVinci-VPFE-Capture: Improve another size determination in vpfe_probe() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-12 17:00 +0200 [PATCH 16/34] [media] DaVinci-VPFE-Capture: Delete an unnecessary variable initialisation in vpfe_probe() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-12 17:00 +0200 [PATCH 11/34] [media] DaVinci-VPBE: Rename a jump label in vpbe_set_output() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-12 17:00 +0200 [PATCH 17/34] [media] DaVinci-VPFE-Capture: Improve another size determination in vpfe_enum_input() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-12 17:00 +0200 [PATCH 25/34] [media] DaVinci-VPIF-Capture: Use kcalloc() in vpif_probe() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-12 17:10 +0200 [PATCH 20/34] [media] DaVinci-VPFE-Capture: Adjust 13 checks for null pointers SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-12 17:10 +0200 [PATCH 22/34] [media] DaVinci-VPFE-Capture: Move two assignments in vpfe_s_input() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-12 17:10 +0200 [PATCH 24/34] [media] DaVinci-VPFE-Capture: Delete an unnecessary return statement in vpfe_unregister_ccdc_device() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-12 17:10 +0200 [PATCH 19/34] [media] DaVinci-VPFE-Capture: Improve another size determination in vpfe_open() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-12 17:10 +0200 [PATCH 28/34] [media] DaVinci-VPIF-Capture: Delete an unnecessary variable initialisation in vpif_querystd() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-12 17:10 +0200 [PATCH 26/34] [media] DaVinci-VPIF-Capture: Delete an error message for a failed memory allocation SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-12 17:10 +0200 [PATCH 23/34] [media] DaVinci-VPFE-Capture: Delete unnecessary braces in vpfe_isr() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-12 17:10 +0200 [PATCH 14/34] [media] DaVinci-VPFE-Capture: Delete three error messages for a failed memory allocation SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-12 17:10 +0200 [PATCH 21/34] [media] DaVinci-VPFE-Capture: Delete an unnecessary variable initialisation in 11 functions SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-12 17:10 +0200 [PATCH 32/34] [media] DaVinci-VPIF-Display: Adjust 11 checks for null pointers SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-12 17:20 +0200 [PATCH 30/34] [media] DaVinci-VPIF-Display: Use kcalloc() in vpif_probe() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-12 17:20 +0200 [PATCH 33/34] [media] DaVinci-VPIF-Display: Delete an unnecessary variable initialisation in vpif_channel_isr() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-12 17:20 +0200 [PATCH 31/34] [media] DaVinci-VPIF-Display: Delete an error message for a failed memory allocation SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-12 17:20 +0200 [PATCH 34/34] [media] DaVinci-VPIF-Display: Delete an unnecessary variable initialisation in process_progressive_mode() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-12 17:20 +0200 [PATCH 29/34] [media] DaVinci-VPIF-Capture: Delete an unnecessary variable initialisation in vpif_channel_isr() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-12 17:20 +0200 [PATCH resent 03/34] [media] DaVinci-VPBE: Adjust 16 checks for null pointers SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-12 19:20 +0200 [PATCH resent 27/34] [media] DaVinci-VPIF-Capture: Adjust ten checks for null pointers SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-12 19:20 +0200 Re: [PATCH 00/34] [media] DaVinci-Video Processing: Fine-tuning for several function implementations "Lad, Prabhakar" <prabhakar.csengg@gmail.com> - 2016-10-23 19:30 +0200
csiph-web