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
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.
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
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
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
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 +++---
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/
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
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
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
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
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
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 +
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 +--
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
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 +-
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
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
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
---
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
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
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
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
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
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
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
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 +++-
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/
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(-)
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
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
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
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
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
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
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
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
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
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,
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
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
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
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
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
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.
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
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/
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
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 +-
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 +-
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
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
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
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
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
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
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
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
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
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
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 +++-
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
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
> 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, …);
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
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
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
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
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.
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(-)
> 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,
> 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
> #
>> +/* 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
>> 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
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
>> 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
>> * 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
>> 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
>> 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
+ /* 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
> ??? 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
> ??? 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?
> 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
> 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>
> @@ -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
> 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
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
>> 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
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.
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
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
>> 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
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"
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 +
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
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
>> 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
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
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 |
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 - 100 of 517 matches
Mail list logo