[PATCH 09/18] [media] RedRat3: Move a variable assignment in redrat3_dev_probe()

2016-10-13 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 13 Oct 2016 14:07:03 +0200 * One local variable was set to an error code before a concrete error situation was detected. Thus move the corresponding assignment into three if branches to indicate a memory allocation failure there.

[PATCH 03/18] [media] RedRat3: Return directly after a failed kcalloc() in redrat3_transmit_ir()

2016-10-13 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 13 Oct 2016 10:34:29 +0200 * Return directly after a call of the function "kcalloc" failed at the beginning. * Reorder two calls for the function "kfree" at the end. Signed-off-by: Markus Elfring

[PATCH 06/18] [media] RedRat3: Delete an unnecessary variable initialisation in redrat3_get_firmware_rev()

2016-10-13 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 13 Oct 2016 13:21:55 +0200 The local variable "rc" will be set to an appropriate value a bit later. Thus omit the explicit initialisation at the beginning. Signed-off-by: Markus Elfring ---

[PATCH 05/18] [media] RedRat3: Delete six messages for a failed memory allocation

2016-10-13 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 13 Oct 2016 13:20:19 +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 five functions. Link:

[PATCH 04/18] [media] RedRat3: One function call less in redrat3_transmit_ir() after error detection

2016-10-13 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 13 Oct 2016 10:50:24 +0200 The kfree() function was called in one case by the redrat3_transmit_ir() function during error handling even if the passed variable contained a null pointer. * Adjust jump targets according to the Linux

[PATCH 02/18] [media] RedRat3: Move two assignments in redrat3_transmit_ir()

2016-10-13 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 13 Oct 2016 10:25:57 +0200 Move the assignment for the data structure member "transmitting" and the local variable "curlencheck" behind the source code for memory allocations by this function. Signed-off-by: Markus Elfring

[PATCH 01/18] [media] RedRat3: Use kcalloc() in two functions

2016-10-13 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 13 Oct 2016 08:35:57 +0200 * Multiplications for the size determination of memory allocations indicated that array data structures should be processed. Thus use the corresponding function "kcalloc". This issue was detected by

[PATCH resent 27/34] [media] DaVinci-VPIF-Capture: Adjust ten checks for null pointers

2016-10-12 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 12 Oct 2016 15:20:34 +0200 The script "checkpatch.pl" pointed information out like the following. Comparison to NULL could be written ... Thus fix the affected source code places. Signed-off-by: Markus Elfring

[PATCH resent 03/34] [media] DaVinci-VPBE: Adjust 16 checks for null pointers

2016-10-12 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 11 Oct 2016 13:37:10 +0200 The script "checkpatch.pl" pointed information out like the following. Comparison to NULL could be written ... Thus fix the affected source code places. Signed-off-by: Markus Elfring

[PATCH 32/34] [media] DaVinci-VPIF-Display: Adjust 11 checks for null pointers

2016-10-12 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 12 Oct 2016 15:40:32 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The script "checkpatch.pl" pointed information out like the following. Comparison to NULL could be written … Thus

[PATCH 33/34] [media] DaVinci-VPIF-Display: Delete an unnecessary variable initialisation in vpif_channel_isr()

2016-10-12 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 12 Oct 2016 15:43:12 +0200 The local variable "channel_id" will be reassigned with the following statement at the beginning. Thus omit the explicit initialisation. Signed-off-by: Markus Elfring ---

[PATCH 30/34] [media] DaVinci-VPIF-Display: Use kcalloc() in vpif_probe()

2016-10-12 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 12 Oct 2016 15:30:44 +0200 * A multiplication for the size determination of a memory allocation indicated that an array data structure should be processed. Thus use the corresponding function "kcalloc". This issue was detected

[PATCH 29/34] [media] DaVinci-VPIF-Capture: Delete an unnecessary variable initialisation in vpif_channel_isr()

2016-10-12 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 12 Oct 2016 15:25:08 +0200 The local variable "channel_id" will be set to an appropriate value a bit later. Thus omit the explicit initialisation at the beginning. Signed-off-by: Markus Elfring ---

[PATCH 31/34] [media] DaVinci-VPIF-Display: Delete an error message for a failed memory allocation

2016-10-12 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 12 Oct 2016 15:38:41 +0200 Omit an extra message for a memory allocation failure in this function. Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf Signed-off-by: Markus Elfring

[PATCH 34/34] [media] DaVinci-VPIF-Display: Delete an unnecessary variable initialisation in process_progressive_mode()

2016-10-12 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 12 Oct 2016 15:45:03 +0200 The local variable "addr" will be set to an appropriate value a bit later. Thus omit the explicit initialisation at the beginning. Signed-off-by: Markus Elfring ---

[PATCH 25/34] [media] DaVinci-VPIF-Capture: Use kcalloc() in vpif_probe()

2016-10-12 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 12 Oct 2016 15:15:34 +0200 * A multiplication for the size determination of a memory allocation indicated that an array data structure should be processed. Thus use the corresponding function "kcalloc". This issue was detected

[PATCH 28/34] [media] DaVinci-VPIF-Capture: Delete an unnecessary variable initialisation in vpif_querystd()

2016-10-12 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 12 Oct 2016 15:22:45 +0200 The local variable "ret" will be set to an appropriate value a bit later. Thus omit the explicit initialisation at the beginning. Signed-off-by: Markus Elfring ---

[PATCH 26/34] [media] DaVinci-VPIF-Capture: Delete an error message for a failed memory allocation

2016-10-12 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 12 Oct 2016 15:18:45 +0200 Omit an extra message for a memory allocation failure in this function. Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf Signed-off-by: Markus Elfring

[PATCH 24/34] [media] DaVinci-VPFE-Capture: Delete an unnecessary return statement in vpfe_unregister_ccdc_device()

2016-10-12 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 12 Oct 2016 15:10:54 +0200 The script "checkpatch.pl" pointed information out like the following. WARNING: void function return statements are not generally useful Thus remove such a statement here. Signed-off-by: Markus Elfring

[PATCH 20/34] [media] DaVinci-VPFE-Capture: Adjust 13 checks for null pointers

2016-10-12 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 12 Oct 2016 10:46:28 +0200 Convert comparisons with the preprocessor symbol "NULL" to condition checks without it. Signed-off-by: Markus Elfring --- drivers/media/platform/davinci/vpfe_capture.c | 25

[PATCH 19/34] [media] DaVinci-VPFE-Capture: Improve another size determination in vpfe_open()

2016-10-12 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 12 Oct 2016 10:44:05 +0200 Replace the specification of a data structure by a pointer dereference as the parameter for the operator "sizeof" to make the corresponding size determination a bit safer. Signed-off-by: Markus Elfring

[PATCH 18/34] [media] DaVinci-VPFE-Capture: Combine substrings for an error message in vpfe_enum_input()

2016-10-12 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 12 Oct 2016 10:40:10 +0200 The script "checkpatch.pl" pointed information out like the following. WARNING: quoted string split across lines Thus fix an affected source code place. Signed-off-by: Markus Elfring

[PATCH 22/34] [media] DaVinci-VPFE-Capture: Move two assignments in vpfe_s_input()

2016-10-12 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 12 Oct 2016 11:22:23 +0200 Move assignments for two local variables into an else branch so that their setting will only be performed after corresponding data processing succeeded by this function. Signed-off-by: Markus Elfring

[PATCH 21/34] [media] DaVinci-VPFE-Capture: Delete an unnecessary variable initialisation in 11 functions

2016-10-12 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 12 Oct 2016 10:50:54 +0200 The local variable "ret" will be set to an appropriate value a bit later. Thus omit the explicit initialisation at the beginning. Signed-off-by: Markus Elfring ---

[PATCH 14/34] [media] DaVinci-VPFE-Capture: Delete three error messages for a failed memory allocation

2016-10-12 Thread SF Markus Elfring
From: Markus Elfring 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:

[PATCH 12/34] [media] DaVinci-VPBE: Delete an unnecessary variable initialisation in vpbe_set_output()

2016-10-12 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 12 Oct 2016 10:16:23 +0200 The local variable "ret" will be set to an appropriate value a bit later. Thus omit the explicit initialisation at the beginning. Signed-off-by: Markus Elfring ---

[PATCH 13/34] [media] DaVinci-VPFE-Capture: Use kmalloc_array() in vpfe_probe()

2016-10-12 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 12 Oct 2016 10:20:02 +0200 * A multiplication for the size determination of a memory allocation indicated that an array data structure should be processed. Thus use the corresponding function "kmalloc_array". This issue was

[PATCH 17/34] [media] DaVinci-VPFE-Capture: Improve another size determination in vpfe_enum_input()

2016-10-12 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 12 Oct 2016 10:33:42 +0200 Replace the specification of a data structure by a pointer dereference as the parameter for the operator "sizeof" to make the corresponding size determination a bit safer. Signed-off-by: Markus Elfring

[PATCH 11/34] [media] DaVinci-VPBE: Rename a jump label in vpbe_set_output()

2016-10-12 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 12 Oct 2016 10:10:19 +0200 Adjust jump labels according to the Linux coding style convention. Signed-off-by: Markus Elfring --- drivers/media/platform/davinci/vpbe.c | 8 1 file changed, 4

[PATCH 15/34] [media] DaVinci-VPFE-Capture: Improve another size determination in vpfe_probe()

2016-10-12 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 12 Oct 2016 10:24:57 +0200 Replace the specification of a data structure by a pointer dereference as the parameter for the operator "sizeof" to make the corresponding size determination a bit safer. Signed-off-by: Markus Elfring

[PATCH 16/34] [media] DaVinci-VPFE-Capture: Delete an unnecessary variable initialisation in vpfe_probe()

2016-10-12 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 12 Oct 2016 10:30:28 +0200 * Return an error code as a constant after a failed call of the function "vpfe_initialize". * The local variable "ret" will be set then to an appropriate value a bit later. Thus omit the explicit

[PATCH 09/34] [media] DaVinci-VPBE: Reduce the scope for a variable in vpbe_set_default_output()

2016-10-12 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 12 Oct 2016 09:54:26 +0200 * Move the definition for the variable "ret" into an if branch so that an extra initialisation can be avoided at the beginning by this refactoring. * Return a success code as a constant at the end.

[PATCH 10/34] [media] DaVinci-VPBE: Check return value of a setup_if_config() call in vpbe_set_output()

2016-10-12 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 12 Oct 2016 09:56:56 +0200 * A function was called over the pointer "setup_if_config" in the data structure "venc_platform_data". But the return value was not used so far. Thus assign it to the local variable "ret" which will be

[PATCH 06/34] [media] DaVinci-VPBE: Return an error code only by a single variable in vpbe_initialize()

2016-10-12 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 11 Oct 2016 14:15:57 +0200 An error code was assigned to the local variable "err" in an if branch. But this variable was not used further then. Use the local variable "ret" instead like at other places in this function. Fixes:

[PATCH 08/34] [media] DaVinci-VPBE: Return the success indication only as a constant in vpbe_set_mode()

2016-10-12 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 12 Oct 2016 09:51:29 +0200 * Return a success code without storing it in an intermediate variable. * Delete the local variable "ret" which became unnecessary with this refactoring. Signed-off-by: Markus Elfring

[PATCH 07/34] [media] DaVinci-VPBE: Delete an unnecessary variable initialisation in vpbe_initialize()

2016-10-12 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 12 Oct 2016 09:45:39 +0200 The local variable "ret" will be set to an appropriate value a bit later. Thus omit the explicit initialisation at the beginning. Signed-off-by: Markus Elfring ---

[PATCH 05/34] [media] DaVinci-VPBE: Return an error code only as a constant in vpbe_probe()

2016-10-12 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 11 Oct 2016 13:43:25 +0200 * Return an error code without storing it in an intermediate variable. * Delete the local variable "ret" which became unnecessary with this refactoring. Signed-off-by: Markus Elfring

[PATCH 04/34] [media] DaVinci-VPBE: Combine substrings for four messages

2016-10-12 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 11 Oct 2016 13:40:14 +0200 The script "checkpatch.pl" pointed information out like the following. WARNING: quoted string split across lines Thus fix the affected source code places. Signed-off-by: Markus Elfring

[PATCH 02/34] [media] DaVinci-VPBE: Delete two error messages for a failed memory allocation

2016-10-12 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 11 Oct 2016 09:56:13 +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:

[PATCH 01/34] [media] DaVinci-VPBE: Use kmalloc_array() in vpbe_initialize()

2016-10-12 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 11 Oct 2016 09:40:41 +0200 * A multiplication for the size determination of a memory allocation indicated that an array data structure should be processed. Thus use the corresponding function "kmalloc_array". This issue was

[PATCH 00/34] [media] DaVinci-Video Processing: Fine-tuning for several function implementations

2016-10-12 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 12 Oct 2016 16:20:02 +0200 Several update suggestions were taken into account from static source code analysis. Markus Elfring (34): Use kmalloc_array() in vpbe_initialize() Delete two error messages for a failed memory

[PATCH 2/2] [media] blackfin-capture: Delete an error message for a failed memory allocation

2016-10-09 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 9 Oct 2016 21:30:18 +0200 The script "checkpatch.pl" pointed information out like the following. WARNING: Possible unnecessary 'out of memory' message Thus remove such a statement here. Link:

[PATCH 1/2] [media] blackfin-capture: Use kcalloc() in bcap_init_sensor_formats()

2016-10-09 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 9 Oct 2016 21:12:13 +0200 A multiplication for the size determination of a memory allocation indicated that an array data structure should be processed. Thus reuse the corresponding function "kcalloc". This issue was detected by

[PATCH 0/2] [media] blackfin-capture: Fine-tuning for two function implementations

2016-10-09 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 9 Oct 2016 21:44:33 +0200 A few update suggestions were taken into account from static source code analysis. Markus Elfring (2): Use kcalloc() in bcap_init_sensor_formats() Delete an error message for a failed memory allocation

[PATCH 0/2] [media] cx88-dsp: Fine-tuning for five function implementations

2016-10-08 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 8 Oct 2016 13:41:12 +0200 A few update suggestions were taken into account from static source code analysis. Markus Elfring (2): Use kmalloc_array() Add some spaces for better code readability drivers/media/pci/cx88/cx88-dsp.c

[PATCH 2/2] [media] cx88-dsp: Add some spaces for better code readability

2016-10-08 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 7 Oct 2016 22:30:40 +0200 Use space characters at some source code places according to the Linux coding style convention. Signed-off-by: Markus Elfring --- drivers/media/pci/cx88/cx88-dsp.c | 40

[PATCH 1/2] [media] cx88-dsp: Use kmalloc_array() in read_rds_samples()

2016-10-08 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 7 Oct 2016 22:07:27 +0200 * A multiplication for the size determination of a memory allocation indicated that an array data structure should be processed. Thus use the corresponding function "kmalloc_array". This issue was

[PATCH 2/2] [media] dvb-tc90522: Rename a jump label in tc90522_probe()

2016-10-07 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 7 Oct 2016 21:13:57 +0200 Adjust a jump label according to the Linux coding style convention. Signed-off-by: Markus Elfring --- drivers/media/dvb-frontends/tc90522.c | 5 ++--- 1 file changed, 2

[PATCH 1/2] [media] dvb-tc90522: Use kmalloc_array() in tc90522_master_xfer()

2016-10-07 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 7 Oct 2016 21:07:43 +0200 A multiplication for the size determination of a memory allocation indicated that an array data structure should be processed. Thus use the corresponding function "kmalloc_array". This issue was detected by

[PATCH 0/2] [media] dvb-tc90522: Fine-tuning for two function implementations

2016-10-07 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 7 Oct 2016 21:38:12 +0200 A few update suggestions were taken into account from static source code analysis. Markus Elfring (2): Use kmalloc_array() Rename a jump label drivers/media/dvb-frontends/tc90522.c | 7 +++ 1 file

[PATCH 2/2] uvc_v4l2: One function call less in uvc_ioctl_ctrl_map() after error detection

2016-08-19 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 19 Aug 2016 11:00:38 +0200 The kfree() function was called in two cases by the uvc_ioctl_ctrl_map() function during error handling even if the passed data structure element contained a null pointer. Adjust jump targets according to

[PATCH 1/2] uvc_v4l2: Use memdup_user() rather than duplicating its implementation

2016-08-19 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 19 Aug 2016 10:50:05 +0200 Reuse existing functionality from memdup_user() instead of keeping duplicate source code. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring

[PATCH 0/2] uvc_v4l2: Fine-tuning for uvc_ioctl_ctrl_map()

2016-08-19 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 19 Aug 2016 11:11:01 +0200 A few update suggestions were taken into account from static source code analysis. Markus Elfring (2): Use memdup_user() rather than duplicating its implementation One function call less after error

[PATCH] [media] dvb_frontend: Use memdup_user() rather than duplicating its implementation

2016-08-19 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 19 Aug 2016 10:04:54 +0200 * Reuse existing functionality from memdup_user() instead of keeping duplicate source code. This issue was detected by using the Coccinelle software. * Return directly if this copy operation failed.

[PATCH] [media] radio-si470x-i2c: Delete owner assignment

2016-08-14 Thread SF Markus Elfring
From: Markus Elfring Date: Mon, 15 Aug 2016 07:01:56 +0200 The field "owner" is set by core. Thus delete an extra initialisation. Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci Signed-off-by: Markus Elfring ---

[PATCH] media/i2c: Delete owner assignment

2016-08-14 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 14 Aug 2016 22:20:26 +0200 The field "owner" is set by core. Thus delete an extra initialisation. Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci Signed-off-by: Markus Elfring ---

[PATCH] [media] tw686x: Delete an unnecessary check before the function call "video_unregister_device"

2016-07-19 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 19 Jul 2016 21:24:26 +0200 The video_unregister_device() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle

[PATCH] [media] v4l2-common: Delete an unnecessary check before the function call "spi_unregister_device"

2016-07-19 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 19 Jul 2016 19:54:16 +0200 The spi_unregister_device() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software.

[PATCH] [media] cec: Delete an unnecessary check before the function call "rc_free_device"

2016-07-17 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 17 Jul 2016 22:52:49 +0200 The rc_free_device() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software.

[PATCH] [media] tw686x-kh: Delete an unnecessary check before the function call "video_unregister_device"

2016-07-17 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 17 Jul 2016 22:00:35 +0200 The video_unregister_device() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle

[media] anysee: Checking failure reporting

2015-12-29 Thread SF Markus Elfring
Hello, I have looked at the implementation of the function "anysee_del_i2c_dev" once more. https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/tree/drivers/media/usb/dvb-usb-v2/anysee.c?id=80c75a0f1d81922bf322c0634d1e1a15825a89e6#n685 Is it really appropriate to end this one with

[PATCH] [media] msi2500: Delete an unnecessary check in msi2500_set_usb_adc()

2015-12-29 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 29 Dec 2015 12:32:41 +0100 This issue was detected by using the Coccinelle software. Return the value from a call of the msi2500_ctrl_msg() function without using an extra check for the variable "ret" at the end. Signed-off-by:

[PATCH] [media] hdpvr: Refactoring for hdpvr_read()

2015-12-29 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 29 Dec 2015 11:02:43 +0100 Let us return directly if the element "status" of the variable "buf" indicates "BUFSTAT_READY". A check repetition can be excluded for the variable "ret" at the end then. Signed-off-by: Markus Elfring

[PATCH] [media] au0828: Refactoring for start_urb_transfer()

2015-12-28 Thread SF Markus Elfring
From: Markus Elfring Date: Mon, 28 Dec 2015 22:52:48 +0100 This issue was detected by using the Coccinelle software. 1. Let us return directly if a buffer allocation failed. 2. Delete the jump label "err" then. 3. Drop the explicit initialisation for the

Re: [media] tuners: One check less in m88rs6000t_get_rf_strength() after error detection

2015-12-28 Thread SF Markus Elfring
>> Move the jump label directly before the desired log statement >> so that the variable "ret" will not be checked once more >> after it was determined that a function call failed. > > Why not avoid both unnecessary ifs I would find such a fine-tuning also nice in principle at more source code

[PATCH] [media] tuners: One check less in m88rs6000t_get_rf_strength() after error detection

2015-12-28 Thread SF Markus Elfring
From: Markus Elfring Date: Mon, 28 Dec 2015 10:10:34 +0100 This issue was detected by using the Coccinelle software. Move the jump label directly before the desired log statement so that the variable "ret" will not be checked once more after it was determined that

[PATCH 1/2] [media] m88rs6000t: Better exception handling in five functions

2015-12-28 Thread SF Markus Elfring
From: Markus Elfring Date: Mon, 28 Dec 2015 15:10:30 +0100 This issue was detected by using the Coccinelle software. Move the jump label directly before the desired log statement so that the variable "ret" will not be checked once more after a function call. Use

[media] r820t: Checking lock scopes around i2c_gate_ctrl() calls?

2015-12-28 Thread SF Markus Elfring
Hello, I have looked at the implementation of the function "r820t_signal" once more. https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/tree/drivers/media/tuners/r820t.c?id=80c75a0f1d81922bf322c0634d1e1a15825a89e6#n2242 The function which was assigned to the pointer "i2c_gate_ctrl"

[PATCH 2/2] [media] tuners: Refactoring for m88rs6000t_sleep()

2015-12-28 Thread SF Markus Elfring
From: Markus Elfring Date: Mon, 28 Dec 2015 15:20:45 +0100 This issue was detected by using the Coccinelle software. 1. Let us return directly if a call of the regmap_write() function failed. 2. Delete the jump label "err" then. 3. Return zero as a constant at

[PATCH 0/2] [media] m88rs6000t: Fine-tuning for some function implementations

2015-12-28 Thread SF Markus Elfring
From: Markus Elfring Date: Mon, 28 Dec 2015 15:32:20 +0100 A few update suggestions were taken into account from static source code analysis. Markus Elfring (2): Better exception handling in five functions Refactoring for m88rs6000t_sleep()

Re: [media] m88rs6000t: Better exception handling in five functions

2015-12-28 Thread SF Markus Elfring
>> Move the jump label directly before the desired log statement >> so that the variable "ret" will not be checked once more >> after a function call. > > This commit message fits with the previous change. Do you prefer an other wording? > It could be nice to put a blank line before the error

[PATCH 1/2] [media] r820t: Delete an unnecessary variable initialisation in generic_set_freq()

2015-12-28 Thread SF Markus Elfring
From: Markus Elfring Date: Mon, 28 Dec 2015 16:36:44 +0100 The variable "rc" will be set to an appropriate value from a call of the r820t_set_tv_standard() function. Thus let us omit the explicit initialisation at the beginning. Signed-off-by: Markus Elfring

[PATCH 2/2] [media] r820t: Better exception handling in generic_set_freq()

2015-12-28 Thread SF Markus Elfring
From: Markus Elfring Date: Mon, 28 Dec 2015 17:13:02 +0100 This issue was detected by using the Coccinelle software. Move the jump label directly before the desired log statement so that the variable "rc" will not be checked once more after a function call. Use

[PATCH 0/2] [media] r820t: Fine-tuning for generic_set_freq()

2015-12-28 Thread SF Markus Elfring
From: Markus Elfring Date: Mon, 28 Dec 2015 17:18:34 +0100 A few update suggestions were taken into account from static source code analysis. Markus Elfring (2): Delete an unnecessary variable initialisation Better exception handling

[PATCH] [media] airspy: Better exception handling in two functions

2015-12-28 Thread SF Markus Elfring
From: Markus Elfring Date: Mon, 28 Dec 2015 22:10:28 +0100 This issue was detected by using the Coccinelle software. Move the jump label directly before the desired log statement so that the variable "ret" will not be checked once more after a function call. Use

[PATCH] [media] xc5000: Faster result reporting in xc_load_fw_and_init_tuner()

2015-12-28 Thread SF Markus Elfring
From: Markus Elfring Date: Mon, 28 Dec 2015 20:10:30 +0100 This issue was detected by using the Coccinelle software. Split the previous if statement at the end so that each final log statement will eventually be performed by a direct jump to these labels. *

Re: [Cocci] [PATCH v2] coccinelle: api: check for propagation of error from platform_get_irq

2015-12-27 Thread SF Markus Elfring
>> https://cwe.mitre.org/data/definitions/252.html > > The value is not unchecked. Would you like to express any stronger relationship between the function call example and the occurrence of an if statement by the discussed SmPL script? > I made a specific rule because the specific problem is

[media] af9013: Checking for register accesses?

2015-12-27 Thread SF Markus Elfring
Hello, I have looked at the implementations of functions like the following once more. https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/tree/drivers/media/dvb-frontends/af9013.c?id=80c75a0f1d81922bf322c0634d1e1a15825a89e6#n124 * af9013_rd_regs * af9013_wr_regs Both functions will

[PATCH] [media] bttv: Returning only value constants in two functions

2015-12-27 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 27 Dec 2015 22:02:21 +0100 Return constant integer values without storing them in the local variable "err" or "rc". Signed-off-by: Markus Elfring --- drivers/media/pci/bt8xx/bttv-driver.c | 25

[PATCH] [media] si2165: Refactoring for si2165_writereg_mask8()

2015-12-27 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 27 Dec 2015 18:23:57 +0100 This issue was detected by using the Coccinelle software. 1. Let us return directly if a call of the si2165_readreg8() function failed. 2. Reduce the scope for the local variables "ret" and "tmp" to

Re: [Cocci] [PATCH v2] coccinelle: api: check for propagation of error from platform_get_irq

2015-12-27 Thread SF Markus Elfring
> The error return value of platform_get_irq seems to often get dropped. How do you think about any more fine-tuning here? Commit message: * … of the platform_get_irq() function seems to get dropped too often. * Why do you concentrate on a single function name? Do you plan to extend this

[PATCH] [media] gsc-m2m: Use an unsigned data type for a variable

2015-12-19 Thread SF Markus Elfring
From: Markus Elfring Date: Sat, 19 Dec 2015 15:28:37 +0100 The data type "int" was used by the variable "ret" in the gsc_m2m_poll() function despite of the aspect that the type "unsigned int" will usually be needed for the return value from a call of the

[PATCH 0/2] [media] c8sectpfe: Deletion of a few unnecessary checks

2015-11-05 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 5 Nov 2015 19:39:32 +0100 Another update suggestion was taken into account after a patch was applied from static source code analysis. Markus Elfring (2): Delete unnecessary checks before two function calls Combine three checks

[PATCH 1/2] [media] c8sectpfe: Delete unnecessary checks before two function calls

2015-11-05 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 5 Nov 2015 18:55:19 +0100 The functions i2c_put_adapter() and module_put() test whether their argument is NULL and then return immediately. Thus the tests around their calls are not needed. This issue was detected by using the

[PATCH 2/2] [media] c8sectpfe: Combine three checks into a single if block

2015-11-05 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 5 Nov 2015 19:23:50 +0100 The variable "tsin" was checked three times in a loop iteration of the c8sectpfe_tuner_unregister_frontend() function. This implementation detail could be improved by the combination of the involved

[PATCH] [media] V4L2: Delete an unnecessary check before the function call media_entity_put

2015-02-03 Thread SF Markus Elfring
From: Markus Elfring elfr...@users.sourceforge.net Date: Tue, 3 Feb 2015 15:27:38 +0100 The media_entity_put() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software.

[PATCH 0/2] DVB: Deletion of a few unnecessary checks

2015-02-03 Thread SF Markus Elfring
From: Markus Elfring elfr...@users.sourceforge.net Date: Tue, 3 Feb 2015 16:50:07 +0100 Another update suggestion was taken into account after a patch was applied from static source code analysis. Markus Elfring (2): Delete an unnecessary check before the function call dvb_unregister_device

[PATCH 2/2] [media] DVB: Less function calls in dvb_ca_en50221_init() after error detection

2015-02-03 Thread SF Markus Elfring
From: Markus Elfring elfr...@users.sourceforge.net Date: Tue, 3 Feb 2015 16:47:48 +0100 The functions dvb_unregister_device and kfree could still be called by the dvb_ca_en50221_init() function in the case that a previous resource allocation failed. * Corresponding details could be improved by

[PATCH 1/2] [media] DVB: Delete an unnecessary check before the function call dvb_unregister_device

2015-02-03 Thread SF Markus Elfring
From: Markus Elfring elfr...@users.sourceforge.net Date: Tue, 3 Feb 2015 16:01:40 +0100 The dvb_unregister_device() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software.

[PATCH] [media] sp2: Delete an unnecessary check before the function call kfree

2015-02-03 Thread SF Markus Elfring
From: Markus Elfring elfr...@users.sourceforge.net Date: Tue, 3 Feb 2015 15:05:26 +0100 The kfree() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by:

[PATCH] [media] stk-webcam: Delete an unnecessary check before the function call vfree

2015-02-03 Thread SF Markus Elfring
From: Markus Elfring elfr...@users.sourceforge.net Date: Tue, 3 Feb 2015 18:36:35 +0100 The vfree() function performs also input parameter validation. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring

[PATCH] [media] au0828: Delete unnecessary checks before the function call video_unregister_device

2015-02-03 Thread SF Markus Elfring
From: Markus Elfring elfr...@users.sourceforge.net Date: Tue, 3 Feb 2015 19:00:25 +0100 The video_unregister_device() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software.

[media] staging: bcm2048: Delete an unnecessary check before the function call video_unregister_device

2015-02-02 Thread SF Markus Elfring
From: Markus Elfring elfr...@users.sourceforge.net Date: Mon, 2 Feb 2015 13:20:23 +0100 The video_unregister_device() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software.

[PATCH 2/2] [media] mn88472: One function call less in mn88472_init() after error detection

2015-02-01 Thread SF Markus Elfring
From: Markus Elfring elfr...@users.sourceforge.net Date: Sun, 1 Feb 2015 19:34:37 +0100 The release_firmware() function was called in three cases by the mn88472_init() function during error handling even if the passed variable fw contained still a null pointer. This implementation detail could

[PATCH 1/2] [media] mn88472: Deletion of an unnecessary check before the function call release_firmware

2015-02-01 Thread SF Markus Elfring
From: Markus Elfring elfr...@users.sourceforge.net Date: Sun, 1 Feb 2015 19:12:56 +0100 The release_firmware() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software.

[PATCH 0/2] [media] mn88472: Delete an unnecessary check

2015-02-01 Thread SF Markus Elfring
From: Markus Elfring elfr...@users.sourceforge.net Date: Sun, 1 Feb 2015 20:00:17 +0100 Another update suggestion was taken into account after a patch was applied from static source code analysis. Markus Elfring (2): Deletion of an unnecessary check before the function call release_firmware

Re: [git:media_tree/master] [media] tuners: remove unneeded checks before release_firmware()

2014-12-04 Thread SF Markus Elfring
This is an automatic generated email to let you know that the following patch were queued at the http://git.linuxtv.org/media_tree.git tree: Subject: [media] tuners: remove uneeded checks before release_firmware() Would you like to amend a typo in the commit title? Regards, Markus -- To

[PATCH 1/1] [media] lirc_zilog: Deletion of unnecessary checks before the function call vfree

2014-12-01 Thread SF Markus Elfring
From: Markus Elfring elfr...@users.sourceforge.net Date: Mon, 1 Dec 2014 19:49:39 +0100 The vfree() function performs also input parameter validation. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring

[PATCH 0/2] [media] mn88473: Delete an unnecessary check

2014-12-01 Thread SF Markus Elfring
From: Markus Elfring elfr...@users.sourceforge.net Date: Mon, 1 Dec 2014 23:16:34 +0100 Another update suggestion was taken into account after a patch was applied from static source code analysis. Markus Elfring (2): Deletion of an unnecessary check before the function call release_firmware

[PATCH 1/2] [media] mn88473: Deletion of an unnecessary check before the function call release_firmware

2014-12-01 Thread SF Markus Elfring
From: Markus Elfring elfr...@users.sourceforge.net Date: Mon, 1 Dec 2014 22:55:29 +0100 The release_firmware() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software.

<    1   2   3   4   5   6   >