[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 changed, 3 insertions(+), 4 del

[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 using the Coccinelle software.

[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 insertions(+), 3 deletions(-) diff --git a/drivers/media/dvb-front

[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 detected by using the Coccinelle so

[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 +++ 1 file changed, 20 inserti

[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 | 43 +++---

[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 in bcap_probe() drivers/media/

[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 using the Coccinelle software. Sig

[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: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Ref

[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 allocation Adjust 16 checks for null p

[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 detected by using the Coccinelle s

[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: http://events.linuxfoundation.org/sites/events/f

[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 --- drivers/media/platform/davinci/vpbe.c | 18 +

[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 --- drivers/media/platform/davinci/vpbe.c | 3 +--

[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 --- drivers/media/platform/davinci/vpbe.c | 2 +- 1 file changed, 1 inserti

[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 --- drivers/media/platform/davinci/vpbe.c | 4 +-

[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: 66715cdc3224a4e241c1a92856b9a4af3b70

[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 checked with the next statemen

[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. 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 initialisation at the beginning. Sig

[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 --- drivers/media/platform/davinc

[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 insertions(+), 4 deletions(-) diff --git a/drivers/media/platfo

[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 --- drivers/media/platform/davinc

[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 detected by using the Coccinelle s

[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 --- drivers/media/platform/davinci/vpbe.c | 2 +- 1 file changed, 1 inserti

[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: http://events.linuxfoundation.org/sites/events/f

[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 --- drivers/media/platform/davinci/vpfe_capture.c | 22 +++-

[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 --- drivers/media/platform/davinci/

[PATCH 23/34] [media] DaVinci-VPFE-Capture: Delete unnecessary braces in vpfe_isr()

2016-10-12 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 12 Oct 2016 14:54:21 +0200 Do not use curly brackets at one source code place where a single statement should be sufficient. Signed-off-by: Markus Elfring --- drivers/media/platform/davinci/vpfe_capture.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)

[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 --- drivers/media/platform/davinci/vpfe_capture.c

[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 +++-- 1 file changed, 11 insertions(+), 1

[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 --- drivers/media/platform/davi

[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 --- drivers/media/platform/davinc

[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 --- drivers/media/platform/davi

[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 by using the Coccinelle softwar

[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 --- drivers/media/platform/davinci/vpif_capture.c | 2 +- 1 file changed, 1

[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 --- drivers/media/platform/davinci/vpif_capture.c | 2 +- 1 file cha

[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 --- drivers/media/platform/davi

[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 --- drivers/media/platform/davinci/vpif_display.c | 2 +- 1 file changed,

[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 --- drivers/media/platform/davinci/vpif_display.c | 2 +- 1 file cha

[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 by using the Coccinelle softwar

[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 fix the affected source code pla

[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 --- Another send try because of the following noti

[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 --- Another send try because of the following noti

[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 using the Coccinelle software.

[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 --- drivers/media/rc/redrat3.c | 8

[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: http://events.linuxfoundation.org/sites/events/

[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 coding style convention. * Move t

[PATCH 08/18] [media] RedRat3: Improve another size determination in redrat3_send_cmd()

2016-10-13 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 13 Oct 2016 13:31:17 +0200 Replace the specification of a data type 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 --- drivers/media/rc/redrat3.c | 2 +-

[PATCH 07/18] [media] RedRat3: Improve another size determination in redrat3_reset()

2016-10-13 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 13 Oct 2016 13:23:22 +0200 Replace the specification of a data type 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 --- drivers/media/rc/redrat3.c | 2 +-

[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. * Adjust a jump label accordin

[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 --- drivers/media/rc/redrat3.c | 8 +++- 1 file changed, 3

[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 --- drivers/media/rc/redrat3.c | 2 +- 1 file changed, 1 insertion(+), 1 del

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

2016-10-13 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 13 Oct 2016 14:17:43 +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 --- drivers/media/rc/redrat3.c | 2 +- 1 file changed, 1 insertion(+), 1 de

[PATCH 14/18] [media] RedRat3: Rename a jump label in redrat3_init_rc_dev()

2016-10-13 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 13 Oct 2016 15:00:12 +0200 Adjust a jump label according to the Linux coding style convention. Signed-off-by: Markus Elfring --- drivers/media/rc/redrat3.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/media/rc/redrat3.c b/driv

[PATCH 15/18] [media] RedRat3: Delete two variables in redrat3_set_timeout()

2016-10-13 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 13 Oct 2016 15:40:33 +0200 * Use the data structure members "dev" and "udev" directly without assigning them to intermediate variables. Thus delete the extra variable definitions at the beginning. * Fix indentation for the parameters of two function calls. Si

[PATCH 16/18] [media] RedRat3: Move a variable assignment in redrat3_set_timeout()

2016-10-13 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 13 Oct 2016 17:13:41 +0200 Move the assignment for the local variable "rr3" behind the source code for a memory allocation by this function. Signed-off-by: Markus Elfring --- drivers/media/rc/redrat3.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) dif

[PATCH 12/18] [media] RedRat3: Move a variable assignment in redrat3_init_rc_dev()

2016-10-13 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 13 Oct 2016 14:50:05 +0200 Move the assignment for the local variable "prod" behind the source code for a memory allocation by this function. Signed-off-by: Markus Elfring --- drivers/media/rc/redrat3.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) di

[PATCH 17/18] [media] RedRat3: Adjust two checks for null pointers in redrat3_dev_probe()

2016-10-13 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 13 Oct 2016 17:40:34 +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 fix the affected source code pl

[PATCH 00/18] [media] RedRat3: Fine-tuning for several function implementations

2016-10-13 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 13 Oct 2016 18:06:18 +0200 Several update suggestions were taken into account from static source code analysis. Markus Elfring (18): Use kcalloc() in two functions Move two assignments in redrat3_transmit_ir() Return directly after a failed kcalloc() in redr

[PATCH 18/18] [media] RedRat3: Combine substrings for six messages

2016-10-13 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 13 Oct 2016 17:50:11 +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 --- drivers/media/rc/redrat3.c | 19 +++-

[PATCH 13/18] [media] RedRat3: Return directly after a failed rc_allocate_device() in redrat3_init_rc_dev()

2016-10-13 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 13 Oct 2016 14:54:46 +0200 Return directly after a call of the function "rc_allocate_device" failed at the beginning. Signed-off-by: Markus Elfring --- drivers/media/rc/redrat3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/r

[PATCH 11/18] [media] RedRat3: Delete the variable "dev" in redrat3_init_rc_dev()

2016-10-13 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 13 Oct 2016 14:40:11 +0200 Use the data structure member "dev" directly without assigning it to an intermediate variable. Thus delete the extra variable definition at the beginning. Signed-off-by: Markus Elfring --- drivers/media/rc/redrat3.c | 5 ++--- 1 file c

Re: [media] RedRat3: Use kcalloc() in two functions?

2016-10-13 Thread SF Markus Elfring
> Markus, please stop being _so_ mechanical and use your > brain a little too. By definition, sizeof(char) == 1. > > This _really_ should be kzalloc(RR3_FW_VERSION_LEN + 1,...) Do you expect that function call examples like the following will be equivalent? zbuffer = kzalloc(123, …);

[PATCH 0/5] [media] winbond-cir: Fine-tuning for four function implementations

2016-10-14 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 14 Oct 2016 13:24:35 +0200 A few update suggestions were taken into account from static source code analysis. Markus Elfring (5): Use kmalloc_array() in wbcir_tx() Move a variable assignment in wbcir_tx() Move assignments for three variables in wbcir_shutdow

[PATCH 3/5] [media] winbond-cir: Move assignments for three variables in wbcir_shutdown()

2016-10-14 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 14 Oct 2016 10:40:12 +0200 Move the setting for the local variables "mask", "match" and "rc6_csl" behind the source code for a condition check by this function at the beginning. Signed-off-by: Markus Elfring --- drivers/media/rc/winbond-cir.c | 8 1 fil

[PATCH 4/5] [media] winbond-cir: One variable and its check less in wbcir_shutdown() after error detection

2016-10-14 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 14 Oct 2016 12:48:41 +0200 The local variable "do_wake" was set to "false" after an invalid system setting was detected so that a bit of error handling was triggered. * Replace these assignments by direct jumps to the source code with the desired exception handlin

[PATCH 5/5] [media] winbond-cir: Move a variable assignment in two functions

2016-10-14 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 14 Oct 2016 13:13:11 +0200 Move the assignment for the local variable "data" behind the source code for condition checks by these functions. Signed-off-by: Markus Elfring --- drivers/media/rc/winbond-cir.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions

[PATCH 1/5] [media] winbond-cir: Use kmalloc_array() in wbcir_tx()

2016-10-14 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 14 Oct 2016 07:19:00 +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 using the Coccinelle software.

[PATCH 2/5] [media] winbond-cir: Move a variable assignment in wbcir_tx()

2016-10-14 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 14 Oct 2016 07:34:46 +0200 Move the assignment for the local variable "data" behind the source code for a memory allocation by this function. Signed-off-by: Markus Elfring --- drivers/media/rc/winbond-cir.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)

Re: [media] RedRat3: Move two assignments in redrat3_transmit_ir()?

2016-10-14 Thread SF Markus Elfring
> The original code was correct. Your view can be appropriate for this function implementation to some degree. I got the impression that it contains the specification of assignments which will happen a bit too early here. Is this a weakness for which software developers can care about? Regards,

Re: [PATCH 11/25] [media] dvb-core: use pr_foo() instead of printk()

2016-10-14 Thread SF Markus Elfring
> diff --git a/drivers/media/dvb-core/dmxdev.c b/drivers/media/dvb-core/dmxdev.c > index 7b67e1dd97fd..1e96a6f1b6f0 100644 > --- a/drivers/media/dvb-core/dmxdev.c > +++ b/drivers/media/dvb-core/dmxdev.c > @@ -20,6 +20,8 @@ > * > */ > > +#define pr_fmt(fmt) "dmxdev: " fmt > + > #include > #

Re: [PATCH 4/5] [media] winbond-cir: One variable and its check less in wbcir_shutdown() after error detection

2016-10-15 Thread SF Markus Elfring
>> +/* Set CEIR_EN */ >> +wbcir_set_bits(data->wbase + WBCIR_REG_WCEIR_CTL, 0x01, 0x01); >> +set_irqmask: >> /* >> * ACPI will set the HW disable bit for SP3 which means that the >> * output signals are left in an undefined state which may cause >> @@ -876,6 +858,14 @@ wbci

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

2016-10-15 Thread SF Markus Elfring
>> diff --git a/drivers/media/rc/redrat3.c b/drivers/media/rc/redrat3.c >> index 7ae2ced..71e901d 100644 >> --- a/drivers/media/rc/redrat3.c >> +++ b/drivers/media/rc/redrat3.c >> @@ -723,10 +723,10 @@ static int redrat3_transmit_ir(struct rc_dev *rcdev, >> unsigned *txbuf, >> { >> struct re

Re: [media] winbond-cir: Move assignments for three variables in wbcir_shutdown()

2016-10-19 Thread SF Markus Elfring
Move the setting for the local variables "mask", "match" and "rc6_csl" behind the source code for a condition check by this function at the beginning. >>> >>> Again, I can't see what the point is? >> >> * How do you think about to set these variables only after the initial >> check s

Re: [media] winbond-cir: Move a variable assignment in wbcir_tx()

2016-10-19 Thread SF Markus Elfring
>> Move the assignment for the local variable "data" behind the source code >> for a memory allocation by this function. > > Sorry, I can't see what the point is? * How do you think about to avoid a variable assignment in case that this memory allocation failed anyhow? * Do you care for data a

Re: [media] winbond-cir: Move a variable assignment in wbcir_tx()

2016-10-19 Thread SF Markus Elfring
>> * How do you think about to avoid a variable assignment in case >> that this memory allocation failed anyhow? > > There is no memory allocation that can fail at this point. Do you really know the failure probability for a call of the function "kmalloc" (within the function "wbcir_tx") under al

Re: [media] winbond-cir: Move a variable assignment in two functions

2016-10-19 Thread SF Markus Elfring
>> Move the assignment for the local variable "data" behind the source code >> for condition checks by these functions. > > Why? * Would you like to set these variables only after the initial check succeeded? * Do you care for data access locality also in these cases? Regards, Markus -- To u

Re: [media] winbond-cir: Move assignments for three variables in wbcir_shutdown()

2016-10-19 Thread SF Markus Elfring
>> Move the setting for the local variables "mask", "match" and "rc6_csl" >> behind the source code for a condition check by this function >> at the beginning. > > Again, I can't see what the point is? * How do you think about to set these variables only after the initial check succeded? * Do

Re: [PATCH 4/5] [media] winbond-cir: One variable and its check less in wbcir_shutdown() after error detection

2016-10-19 Thread SF Markus Elfring
+ /* Set CEIR_EN */ + wbcir_set_bits(data->wbase + WBCIR_REG_WCEIR_CTL, 0x01, 0x01); +set_irqmask: /* * ACPI will set the HW disable bit for SP3 which means that the * output signals are left in an undefined state which may cause @@ -876,6 +858,14 @@ wbcir_shutdow

Re: Adjustments for a lot of function implementations

2018-01-08 Thread SF Markus Elfring
> ??? I did that: either one patch per directory with the same type of change, > or one patch per driver combining all the changes for that driver. Are you going to answer any of my remaining questions in a more constructive way? Regards, Markus

Re: Adjustments for a lot of function implementations

2018-02-02 Thread SF Markus Elfring
> ??? I did that: either one patch per directory with the same type of change, > or one patch per driver combining all the changes for that driver. Do any contributors get into the mood to take another look at software updates from my selection of change possibilities in a more constructive way?

Re: Adjustments for a lot of function implementations

2018-02-02 Thread SF Markus Elfring
> One last time: either post per-driver patches with all the cleanups for a > driver > in a single patch, I preferred to offer source code adjustments according to specific transformation patterns mostly for each software module separately (also in small patch series). > or a per-directory pa

Re: [v3] [media] Use common error handling code in 19 functions

2018-05-04 Thread SF Markus Elfring
> Adjust jump targets so that a bit of exception handling can be better > reused at the end of these functions. Why was this update suggestion rejected once more a moment ago? https://patchwork.linuxtv.org/patch/47827/ lkml.kernel.org/r/<57ef3a56-2578-1d5f-1268-348b49b0c...@users.sourceforge.net>

Re: [v3] [media] Use common error handling code in 19 functions

2018-05-05 Thread SF Markus Elfring
> @@ -656,18 +656,18 @@ static int dvb_dmxdev_start_feed(struct dmxdev *dmxdev, > tsfeed->priv = filter; > > ret = tsfeed->set(tsfeed, feed->pid, ts_type, ts_pes, timeout); > - if (ret < 0) { > - dmxdev->demux->release_ts_feed(dmxdev->demux, tsfeed); > - r

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 sourc

[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

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 q

[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 one branch of an if statement.

[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 ++--- 1 file changed, 6 insertions(+), 19 deleti

[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 a function call failed. Signed

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 p

[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 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() drivers/media/tuners/m88rs6000t.c | 165 +

[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 the identifier "report_failure" i

[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 the end. Signed-off-by: Markus E

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 h

[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 drivers/media/tuners/r820t.c | 18 -- 1

[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 --- drivers/media/tuners/r820t.c |

[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 the identifier "report_failure" in

  1   2   3   4   5   6   >