Re: [v3] Coccinelle: suggest replacing strncpy+truncation by strscpy

2018-07-20 Thread SF Markus Elfring
> The problem is that I don't know if the script is correct Will the clarification of such a concern evolve into another interesting software development adventure? > - I'm not familiar with these string functions. How are the chances to improve the understanding of affected programming interfa

[PATCH 4/6] Coccinelle: atomic_as_refcounter: Replace disjunction by a constraint in two SmPL rules

2018-07-03 Thread SF Markus Elfring
From: Markus Elfring Date: Mon, 2 Jul 2018 18:45:15 +0200 Three function names were specified for a search of function calls by the means of a disjunction in two rules of a script for the semantic patch language. Use a regular expression as a constraint for this source code search pattern instead

[PATCH 3/6] Coccinelle: atomic_as_refcounter: Use type “expression” for another metavariable

2018-07-03 Thread SF Markus Elfring
From: Markus Elfring Date: Mon, 2 Jul 2018 17:55:27 +0200 The metavariable “a” is enclosed by parentheses in three rules of a script for the semantic patch language. Replace its type by “expression” so that the corresponding source code search becomes more powerful. Signed-off-by: Markus Elfring

[PATCH 0/6] Coccinelle: atomic_as_refcounter: Improvements for source code search specifications

2018-07-03 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 3 Jul 2018 09:15:26 +0200 This source code search pattern was programmed in the way that some implementation details could be improved further. I suggest to avoid unnecessary code repetition also in this script for the semantic patch language. Markus Elfring (6):

Re: [PATCH v3 12/16] treewide: Use array_size() for kmalloc()-family

2018-07-01 Thread SF Markus Elfring
>> * The repetition of such a constraint in subsequent SmPL rules could be >> avoided >> if inheritance will be used for this metavariable. > > This is quite incorrect. I suggest to consider additional software design options. > Inheritance is only possible when a match of the previous rule

Re: [PATCH v3 12/16] treewide: Use array_size() for kmalloc()-family

2018-07-01 Thread SF Markus Elfring
> For kmalloc()-family allocations, instead of A * B, use array_size(). > Similarly, instead of A * B *C, use array3_size(). It took a while until my software development attention was caught also by this update suggestion. > Note that: > kmalloc(array_size(a, b), ...); > could be written

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: [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: [0/9] UML vector network driver: Adjustments for three function implementations

2018-03-29 Thread SF Markus Elfring
> Date: Sun, 11 Mar 2018 16:06:16 +0100 > > Some update suggestions were taken into account > from static source code analysis. … > Delete unnecessary code in user_init_raw_fds() > Less checks in user_init_raw_fds() after error detection > Adjust an error message in user_init_socket_fds() >

Re: iio/gyro/bmg160_core: Improve unlocking of a mutex in five functions

2018-03-24 Thread SF Markus Elfring
>> The mutex was (and is still only) locked within case branches, isn't it? >> > You are correct, this does however reflect the issue with the resulting > lack of balance here. Do you find changes for the other function implementations easier to integrate? Regards, Markus

Re: [2/4] scsi: hpsa: Less function calls in hpsa_big_passthru_ioctl() after error detection

2018-03-24 Thread SF Markus Elfring
>> @@ -6501,14 +6501,16 @@ static int hpsa_big_passthru_ioctl(struct ctlr_info >> *h, void __user *argp) >> cleanup0: >> cmd_free(h, c); >> cleanup1: >> - if (buff) { >> + { >> int i; >> >> for (i = 0; i < sg_used; i++) >>

Re: iio/gyro/bmg160_core: Improve unlocking of a mutex in five functions

2018-03-19 Thread SF Markus Elfring
>> The mutex was (and is still only) locked within case branches, isn't it? >> > You are correct, this does however reflect the issue with the resulting > lack of balance here. I suggest to reconsider affected software aspects a bit more. > I saw the mutex was getting unlocked outside the local

Re: iio/gyro/bmg160_core: Improve unlocking of a mutex in five functions

2018-03-18 Thread SF Markus Elfring
Am 17.03.2018 um 20:54 schrieb Jonathan Cameron: > On Wed, 14 Mar 2018 16:15:32 +0100 > SF Markus Elfring wrote: > >> From: Markus Elfring >> Date: Wed, 14 Mar 2018 16:06:49 +0100 >> >> * Add jump targets so that a call of the function "mutex_unlock"

[PATCH] cxgb4/cudbg_lib: Use common error handling code in cudbg_collect_tid()

2018-03-15 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 15 Mar 2018 14:56:10 +0100 Add a jump target so that a bit of exception handling can be better reused at the end of this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/net/ethernet/chelsio/cxgb4/cud

Re: [media] ov5645: Move an error code assignment in ov5645_probe()

2018-03-15 Thread SF Markus Elfring
>> Move an assignment for a specific error code so that it is stored only once >> in this function implementation. >> >> This issue was detected by using the Coccinelle software. > > How? Would you like to experiment a bit more with the following approach for the semantic patch language? show_sa

[PATCH] [media] ov5645: Move an error code assignment in ov5645_probe()

2018-03-14 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 14 Mar 2018 22:02:52 +0100 Move an assignment for a specific error code so that it is stored only once in this function implementation. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/media/i2c/ov5645.c | 6 +-

[PATCH] iio/gyro/bmg160_core: Improve unlocking of a mutex in five functions

2018-03-14 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 14 Mar 2018 16:06:49 +0100 * Add jump targets so that a call of the function "mutex_unlock" is stored only once in these function implementations. * Replace 19 calls by goto statements. This issue was detected by using the Coccinelle software. Signed-off-by: M

[PATCH] iio/adc/nau7802: Improve unlocking of a mutex in nau7802_read_raw()

2018-03-13 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 13 Mar 2018 20:52:26 +0100 * Add a jump target so that a call of the function "mutex_unlock" is stored only once in this function implementation. * Replace two calls by goto statements. This issue was detected by using the Coccinelle software. Signed-off-by: M

[PATCH] iio/adc/ad7291: Improve unlocking of a mutex in ad7291_read_raw()

2018-03-13 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 13 Mar 2018 20:08:40 +0100 * Add a jump target so that a call of the function "mutex_unlock" is stored only once in this function implementation. * Replace three calls by goto statements. This issue was detected by using the Coccinelle software. Signed-off-by:

[PATCH] iio/accel/kxcjk-1013: Improve unlocking of a mutex in three functions

2018-03-13 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 13 Mar 2018 13:40:12 +0100 * Add jump targets so that a call of the function "mutex_unlock" is stored less often in these function implementations. * Replace eight calls by goto statements. This issue was detected by using the Coccinelle software. Signed-off-b

Re: hwmon/sch5627: Use common error handling code in sch5627_probe()

2018-03-13 Thread SF Markus Elfring
>  1 file changed, 29 insertions(+), 31 deletions(-) > > So you are asking people to review 60 changed lines to save 2, A bit of object code reduction might become useful also in this case. > that alone should be the point where you stop yourself from > *even* sending this patch. I proposed ju

Re: hwmon/sch5627: Use common error handling code in sch5627_probe()

2018-03-13 Thread SF Markus Elfring
>> Adjust jump targets so that a bit of exception handling can be better >> reused at the end of this function. … > goto-s going to a label calling another goto is completely unreadable. I got an other software development view. > I really do not see any reason for the proposed changes, I sugge

Re: [PATCH 5/5] Bluetooth: btmrvl: Use common error handling code in btmrvl_sdio_download_fw_w_helper()

2018-03-13 Thread SF Markus Elfring
>> Add a jump target so that the setting of a specific error code is stored >> only once at the end of this function. >> >> Signed-off-by: Markus Elfring >> --- >> drivers/bluetooth/btmrvl_sdio.c | 13 +++-- >> 1 file changed, 7 insertions(+), 6 deletions(-) >> >> diff --git a/drivers/bluet

Re: [3/5] Bluetooth: btmrvl: One check less in btmrvl_sdio_card_to_host()

2018-03-13 Thread SF Markus Elfring
>> @@ -797,12 +792,18 @@ static int btmrvl_sdio_card_to_host(struct >> btmrvl_private *priv) >> break; >> } >> >> -exit: >> -if (ret) { >> -hdev->stat.err_rx++; >> -kfree_skb(skb); >> -} >> +return 0; >> + >> +free_skb: >> +kfree_skb(skb);

Re: [2/2] net/usb/ax88179_178a: Delete three unnecessary variables in ax88179_chk_eee()

2018-03-13 Thread SF Markus Elfring
>> Use three values directly for a condition check without assigning them >> to intermediate variables. > > Hi, > > what is the benefit of this? I proposed a small source code reduction. Other software design directions might become more interesting for this use case. Regards, Markus

Re: [v2 14/17 4/4] mfd: tps65910: Checking patch structures

2018-03-13 Thread SF Markus Elfring
> How have you managed to insert 4 patches into the x/17 thread? I dared to group the desired patch series into dedicated mail threads. Regards, Markus

Re: [2/9] um/drivers/vector_user: Less checks in user_init_raw_fds() after error detection

2018-03-13 Thread SF Markus Elfring
> +set_error_code: > + err = -errno; > + os_close_file(rxfd); I have taken another look at this change idea. Now I notice that I should have preserved a sanity check there. if (rxfd >= 0) os_close_file(rxfd); Regards, Markus

[PATCH] hwmon/sch5627: Use common error handling code in sch5627_probe()

2018-03-12 Thread SF Markus Elfring
From: Markus Elfring Date: Mon, 12 Mar 2018 22:15:59 +0100 Adjust jump targets so that a bit of exception handling can be better reused at the end of this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/hwmon/sch5627.c | 60 +++

[PATCH] altera_edac: Use common error handling code in altr_sdram_probe()

2018-03-12 Thread SF Markus Elfring
From: Markus Elfring Date: Mon, 12 Mar 2018 16:23:53 +0100 Add a jump target so that a specific error code is assigned to the local variable "res" at the end of this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/edac/altera_edac.

Re: dmaengine: edma: Use common error handling code in three functions

2018-03-12 Thread SF Markus Elfring
> Date: Sun, 22 Oct 2017 16:46:34 +0200 > > Add a jump target so that a bit of exception handling can be better reused > at the end of these functions. How are the chances to integrate such a change into another Linux repository? https://lkml.org/lkml/2017/10/22/78 https://patchwork.kernel.org/pa

[PATCH 2/2] crypto: talitos: Delete an error message for a failed memory allocation in talitos_edesc_alloc()

2018-03-12 Thread SF Markus Elfring
From: Markus Elfring Date: Mon, 12 Mar 2018 14:18:23 +0100 Omit an extra message for a memory allocation failure in this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/crypto/talitos.c | 1 - 1 file changed, 1 deletion(-) diff --

[PATCH 1/2] crypto: talitos: Use common error handling code in talitos_edesc_alloc()

2018-03-12 Thread SF Markus Elfring
From: Markus Elfring Date: Mon, 12 Mar 2018 14:08:55 +0100 Add jump targets so that an error message and the setting of a specific error code is stored only once at the end of this function. Signed-off-by: Markus Elfring --- drivers/crypto/talitos.c | 24 1 file change

[PATCH 0/2] crypto/talitos: Adjustments for talitos_edesc_alloc()

2018-03-12 Thread SF Markus Elfring
From: Markus Elfring Date: Mon, 12 Mar 2018 14:24:34 +0100 Two update suggestions were taken into account from static source code analysis. Markus Elfring (2): Use common error handling code Delete an error message for a failed memory allocation drivers/crypto/talitos.c | 25 --

[PATCH 5/5] Bluetooth: btmrvl: Use common error handling code in btmrvl_sdio_download_fw_w_helper()

2018-03-12 Thread SF Markus Elfring
From: Markus Elfring Date: Mon, 12 Mar 2018 11:30:28 +0100 Add a jump target so that the setting of a specific error code is stored only once at the end of this function. Signed-off-by: Markus Elfring --- drivers/bluetooth/btmrvl_sdio.c | 13 +++-- 1 file changed, 7 insertions(+), 6 de

[PATCH 4/5] Bluetooth: btmrvl: Delete an unnecessary variable initialisation in btmrvl_sdio_card_to_host()

2018-03-12 Thread SF Markus Elfring
From: Markus Elfring Date: Mon, 12 Mar 2018 11:15:59 +0100 The variable "payload" will eventually be set to an appropriate pointer a bit later. Thus omit the explicit initialisation at the beginning. Signed-off-by: Markus Elfring --- drivers/bluetooth/btmrvl_sdio.c | 2 +- 1 file changed, 1 in

[PATCH 3/5] Bluetooth: btmrvl: One check less in btmrvl_sdio_card_to_host() after error detection

2018-03-12 Thread SF Markus Elfring
From: Markus Elfring Date: Mon, 12 Mar 2018 11:13:00 +0100 One check could be repeated by the btmrvl_sdio_card_to_host() function during error handling even if the relevant properties can be determined for the involved variables before by source code analysis. * Adjust jump targets so that an ex

[PATCH 2/5] Bluetooth: btmrvl: Delete an unnecessary variable initialisation in btmrvl_sdio_register_dev()

2018-03-12 Thread SF Markus Elfring
From: Markus Elfring Date: Mon, 12 Mar 2018 10:20:04 +0100 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/bluetooth/btmrvl_sdio.c | 2 +- 1 file changed, 1 insertion(+),

[PATCH 1/5] Bluetooth: btmrvl: Use common error handling code in btmrvl_sdio_register_dev()

2018-03-12 Thread SF Markus Elfring
From: Markus Elfring Date: Mon, 12 Mar 2018 10:15:17 +0100 Adjust a jump target so that a bit of exception handling can be better reused at the end of this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/bluetooth/btmrvl_sdio.c | 5

[PATCH 0/5] Bluetooth/btmrvl_sdio: Adjustments for three function implementations

2018-03-12 Thread SF Markus Elfring
From: Markus Elfring Date: Mon, 12 Mar 2018 12:10:24 +0100 A few update suggestions were taken into account from static source code analysis. Markus Elfring (5): Use common error handling code in btmrvl_sdio_register_dev() Delete an unnecessary variable initialisation in btmrvl_sdio_register

[PATCH 9/9] um/drivers/vector_user: Delete an unnecessary variable initialisation in user_init_tap_fds()

2018-03-11 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 11 Mar 2018 15:50:29 +0100 The local variable "fd" will eventually be set to an appropriate value a bit later. Thus omit the explicit initialisation at the beginning. Signed-off-by: Markus Elfring --- arch/um/drivers/vector_user.c | 3 +-- 1 file changed, 1 inse

[PATCH 8/9] um/drivers/vector_user: Less checks in user_init_tap_fds() after error detection

2018-03-11 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 11 Mar 2018 15:43:31 +0100 Three checks could be repeated by the user_init_tap_fds() function during error handling even if the relevant properties can be determined for the involved variables before by source code analysis. * Adjust jump targets. * Delete three

[PATCH 7/9] um/drivers/vector_user: Adjust an error message in user_init_tap_fds()

2018-03-11 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 11 Mar 2018 15:10:05 +0100 Adjust an error message at the end of this function so that its name will be automatically determined as a parameter. Signed-off-by: Markus Elfring --- arch/um/drivers/vector_user.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(

[PATCH 6/9] um/drivers/vector_user: Less checks in user_init_socket_fds() after error detection

2018-03-11 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 11 Mar 2018 14:56:38 +0100 Two checks could be repeated by the user_init_socket_fds() function during error handling even if the relevant properties can be determined for the involved variables before by source code analysis. * Adjust jump targets. * Delete two s

[PATCH 5/9] um/drivers/vector_user: Delete two unnecessary checks before freeaddrinfo() in user_init_socket_fds()

2018-03-11 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 11 Mar 2018 14:20:46 +0100 The implementation returns from this function if a null pointer was detected in the local variable "gairesult". Thus the check before two calls of the function "freeaddrinfo" is not needed. Signed-off-by: Markus Elfring --- arch/um/dri

[PATCH 4/9] um/drivers/vector_user: Delete an unnecessary check before kfree() in user_init_socket_fds()

2018-03-11 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 11 Mar 2018 14:00:09 +0100 The kfree() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. Signed-off-by: Markus Elfring --- arch/um/drivers/vector_user.c | 3 +-- 1 file changed, 1 insertion(+),

[PATCH 3/9] um/drivers/vector_user: Adjust an error message in user_init_socket_fds()

2018-03-11 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 11 Mar 2018 13:53:08 +0100 * Adjust an error message at the end of this function. * Delete the local variable "err" which became unnecessary with this refactoring. Signed-off-by: Markus Elfring --- arch/um/drivers/vector_user.c | 5 +++-- 1 file changed, 3 in

[PATCH 2/9] um/drivers/vector_user: Less checks in user_init_raw_fds() after error detection

2018-03-11 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 11 Mar 2018 11:40:14 +0100 Up to two checks could be repeated by the user_init_raw_fds() function during error handling even if the relevant properties can be determined for the involved variables before by source code analysis. * Adjust jump targets so that an ex

[PATCH 1/9] um/drivers/vector_user: Delete unnecessary code in user_init_raw_fds()

2018-03-11 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 11 Mar 2018 11:36:18 +0100 * One condition check could never be reached with a non-null pointer at the end of this function. Thus remove the corresponding statement. * Delete an initialisation for the local variable "result" which became unnecessary with this

[PATCH 0/9] UML vector network driver: Adjustments for three function implementations

2018-03-11 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 11 Mar 2018 16:06:16 +0100 Some update suggestions were taken into account from static source code analysis. Markus Elfring (9): Delete unnecessary code in user_init_raw_fds() Less checks in user_init_raw_fds() after error detection Adjust an error message i

[PATCH] powerpc: Use common error handling code in setup_new_fdt()

2018-03-11 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 11 Mar 2018 09:03:42 +0100 Add a jump target so that a bit of exception handling can be better reused at the end of this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- arch/powerpc/kernel/machine_kexec_file

[PATCH 3/3] wlcore: Use common error handling code in wl1271_acx_sta_rate_policies()

2018-03-10 Thread SF Markus Elfring
From: Markus Elfring Date: Sat, 10 Mar 2018 22:18:45 +0100 Add a jump target so that a bit of exception handling can be better reused at the end of this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/net/wireless/ti/wlcore/acx.c |

[PATCH 2/3] wlcore: Return directly after a failed kzalloc() in wl1271_acx_sta_rate_policies()

2018-03-10 Thread SF Markus Elfring
From: Markus Elfring Date: Sat, 10 Mar 2018 22:00:31 +0100 Return directly after a call of the function "kzalloc" failed at the beginning. Signed-off-by: Markus Elfring --- drivers/net/wireless/ti/wlcore/acx.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/n

[PATCH 1/3] wlcore: Delete an unnecessary variable initialisation in wl1271_acx_sta_rate_policies()

2018-03-10 Thread SF Markus Elfring
From: Markus Elfring Date: Sat, 10 Mar 2018 21:51:17 +0100 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/net/wireless/ti/wlcore/acx.c | 2 +- 1 file changed, 1 insertio

[PATCH 0/3] wlcore: Adjustments for wl1271_acx_sta_rate_policies()

2018-03-10 Thread SF Markus Elfring
From: Markus Elfring Date: Sat, 10 Mar 2018 22:25:45 +0100 Three update suggestions were taken into account from static source code analysis. Markus Elfring (3): Delete an unnecessary variable initialisation Return directly after a failed kzalloc() Use common error handling code drivers/

[PATCH 2/2] net/usb/ax88179_178a: Delete three unnecessary variables in ax88179_chk_eee()

2018-03-10 Thread SF Markus Elfring
From: Markus Elfring Date: Sat, 10 Mar 2018 18:53:28 +0100 Use three values directly for a condition check without assigning them to intermediate variables. Signed-off-by: Markus Elfring --- drivers/net/usb/ax88179_178a.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) dif

[PATCH 1/2] net/usb/ax88179_178a: Use common code in ax88179_chk_eee()

2018-03-10 Thread SF Markus Elfring
From: Markus Elfring Date: Sat, 10 Mar 2018 18:22:43 +0100 Adjust a jump target so that a bit of common code can be better reused at the end of this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/net/usb/ax88179_178a.c | 34 ++

[PATCH 0/2] net/usb/ax88179_178a: Adjustments for ax88179_chk_eee()

2018-03-10 Thread SF Markus Elfring
From: Markus Elfring Date: Sat, 10 Mar 2018 19:05:45 +0100 Two update suggestions were taken into account from static source code analysis. Markus Elfring (2): Use common code Delete three unnecessary variables drivers/net/usb/ax88179_178a.c | 45 +++---

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

2018-03-09 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 9 Mar 2018 21:00:12 +0100 Adjust jump targets so that a bit of exception handling can be better reused at the end of these functions. This issue was partly detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- v3: Laurent Pinchart and Tod

[PATCH v2 17/17] mfd: viperboard: Delete an error message for a failed memory allocation in vprbrd_probe()

2018-03-09 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 9 Mar 2018 09:56:31 +0100 Omit an extra message for a memory allocation failure in this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- v2: Lee Jones requested a resend for this patch. The change was rebased

[PATCH v2 16/17] mfd: twl6030-irq: Delete an error message for a failed memory allocation in twl6030_init_irq()

2018-03-09 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 9 Mar 2018 09:49:32 +0100 Omit an extra message for a memory allocation failure in this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- v2: Lee Jones requested a resend for this patch. The change was rebased

[PATCH v2 15/17] mfd: tps80031: Delete an error message for a failed memory allocation in tps80031_probe()

2018-03-09 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 9 Mar 2018 09:45:13 +0100 Omit an extra message for a memory allocation failure in this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- v2: Lee Jones requested a resend for this patch. The change was rebased

[PATCH v2 14/17 4/4] mfd: tps65910: Move an assignment in tps65910_sleepinit()

2018-03-09 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 9 Mar 2018 09:19:42 +0100 Move the assignment for the local variable "dev" so that its setting will be performed after a configuration check by this function. Signed-off-by: Markus Elfring --- v2: Lee Jones requested a resend for this patch. The change was rebas

[PATCH v2 13/17 3/4] mfd: tps65910: Delete an unnecessary variable initialisation in tps65910_sleepinit()

2018-03-09 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 9 Mar 2018 09:10:09 +0100 The local variable "dev" will be reassigned by a following statement. Thus omit the explicit initialisation at the beginning. Signed-off-by: Markus Elfring --- v2: Lee Jones requested a resend for this patch. The change was rebased on s

[PATCH v2 12/17 2/4] mfd: tps65910: Delete an unnecessary variable initialisation in four functions

2018-03-09 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 9 Mar 2018 09:06:14 +0100 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 --- v2: Lee Jones requested a resend for this patch. The change was rebased

[PATCH v2 11/17] mfd: tps65910: Delete an error message for a failed memory allocation in tps65910_parse_dt()

2018-03-09 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 9 Mar 2018 09:00:59 +0100 Omit an extra message for a memory allocation failure in this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- v2: Lee Jones requested a resend for this patch. The change was rebased

[PATCH v2 0/4] mfd/tps65910: Adjustments for four function implementations

2018-03-09 Thread SF Markus Elfring
From: Markus Elfring A few update suggestions were taken into account from static source code analysis. Markus Elfring (4): Delete an error message for a failed memory allocation in tps65910_parse_dt() Delete an unnecessary variable initialisation in four functions Delete an unnecessary va

[PATCH v2 10/17] mfd: tps6586x: Delete an error message for a failed memory allocation in tps6586x_parse_dt()

2018-03-09 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 8 Mar 2018 15:30:54 +0100 Omit an extra message for a memory allocation failure in this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- v2: Lee Jones requested a resend for this patch. The change was rebased

[PATCH v2 09/17] mfd: tps65090: Delete an error message for a failed memory allocation in tps65090_i2c_probe()

2018-03-09 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 8 Mar 2018 15:25:58 +0100 Omit an extra message for a memory allocation failure in this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- v2: Lee Jones requested a resend for this patch. The change was rebased

[PATCH v2 08/17] mfd: ti_am335x_tscadc: Delete an error message for a failed memory allocation in ti_tscadc_probe()

2018-03-09 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 8 Mar 2018 15:15:51 +0100 Omit an extra message for a memory allocation failure in this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- v2: Lee Jones requested a resend for this patch. The change was rebased

[PATCH v2 07/17] mfd: smsc-ece1099: Improve a size determination in smsc_i2c_probe()

2018-03-09 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 8 Mar 2018 15:05:16 +0100 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 according to the Linux coding style convention. This issue was dete

[PATCH v2 06/17 2/2] mfd: sm501: Adjust 12 checks for null pointers

2018-03-09 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 8 Mar 2018 14:20:06 +0100 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 --- v2: Lee Jones requested a resend for this patch.

[PATCH v2 05/17 1/2] mfd: sm501: Improve a size determination in two functions

2018-03-09 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 8 Mar 2018 14:05:41 +0100 Replace the specification of data structures by pointer dereferences as the parameter for the operator "sizeof" to make the corresponding size determination a bit safer according to the Linux coding style convention. This issue was detect

[PATCH v2 0/2] mfd/sm501: Adjustments for five function implementations

2018-03-09 Thread SF Markus Elfring
From: Markus Elfring A few update suggestions were taken into account from static source code analysis. Markus Elfring (2): Improve a size determination in two functions Adjust 12 checks for null pointers --- v2: Lee Jones requested a resend for these patches. The changes were rebased on so

[PATCH v2 04/17] mfd: si476x-i2c: Delete an error message for a failed memory allocation in si476x_core_probe()

2018-03-09 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 8 Mar 2018 13:45:31 +0100 Omit an extra message for a memory allocation failure in this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- v2: Lee Jones requested a resend for this patch. The change was rebased

[PATCH v2 03/17 3/3] mfd: abx500-core: Adjust 14 checks for null pointers

2018-03-09 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 8 Mar 2018 12:50:12 +0100 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 Reviewed-by: Linus Walleij --- v2: Lee Jones request

[PATCH v2 02/17 2/3] mfd: abx500-core: Improve two size determinations in abx500_register_ops()

2018-03-09 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 8 Mar 2018 12:46:47 +0100 Replace the specification of two data structures by pointer dereferences as the parameter for the operator "sizeof" to make the corresponding size determination a bit safer according to the Linux coding style convention. This issue was de

[PATCH v2 01/17 1/3] mfd: abx500-core: Delete an error message for a failed memory allocation in abx500_register_ops()

2018-03-09 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 8 Mar 2018 11:44:33 +0100 Omit an extra message for a memory allocation failure in this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Reviewed-by: Linus Walleij --- v2: Lee Jones requested a resend for this p

[PATCH v2 0/3] mfd/abx500-core: Adjustments for eight function implementations

2018-03-09 Thread SF Markus Elfring
From: Markus Elfring Three update suggestions were taken into account from static source code analysis. Markus Elfring (3): Delete an error message for a failed memory allocation in abx500_register_ops() Improve two size determinations in abx500_register_ops() Adjust 14 checks for null

[PATCH v2 00/17] MFD: Adjustments for several function implementations

2018-03-09 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 9 Mar 2018 10:24:42 +0100 Several update suggestions were taken into account from static source code analysis. Markus Elfring (17): abx500-core: Adjustments for eight function implementations si476x-i2c: Delete an error message for a failed memory allocation

[PATCH 2/2] VMCI: Improve a size determination in two functions

2018-03-05 Thread SF Markus Elfring
From: Markus Elfring Date: Mon, 5 Mar 2018 17:00:19 +0100 Replace the specification of data structures by pointer dereferences as the parameter for the operator "sizeof" to make the corresponding size determination a bit safer according to the Linux coding style convention. This issue was detect

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

2018-03-05 Thread SF Markus Elfring
From: Markus Elfring Date: Mon, 5 Mar 2018 16:40:29 +0100 * Reuse existing functionality from memdup_user() instead of keeping duplicate source code. This issue was detected by using the Coccinelle software. * Return directly after this function call failed at the beginning. * Delete the l

[PATCH 0/2] VMCI: Adjustments for three function implementations

2018-03-05 Thread SF Markus Elfring
From: Markus Elfring Date: Mon, 5 Mar 2018 17:12:34 +0100 Two update suggestions were taken into account from static source code analysis. Markus Elfring (2): Use memdup_user() rather than duplicating its implementation Improve a size determination in two functions drivers/misc/vmw_vmci/vm

[PATCH] crypto: ccp: Use memdup_user() rather than duplicating its implementation

2018-03-05 Thread SF Markus Elfring
From: Markus Elfring Date: Mon, 5 Mar 2018 13:50:13 +0100 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 --- drivers/crypto/ccp/psp-dev.c | 15 +-- 1

[PATCH] mmc/core/block: Use memdup_user() rather than duplicating its implementation

2018-03-05 Thread SF Markus Elfring
From: Markus Elfring Date: Mon, 5 Mar 2018 11:33:21 +0100 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 --- drivers/mmc/core/block.c | 15 --- 1 file

[PATCH 4/4] scsi: hpsa: Move a variable assignment in hpsa_big_passthru_ioctl()

2018-03-05 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 4 Mar 2018 22:16:05 +0100 Move an assignment for the local variable "sg_used" so that its setting will only be performed after corresponding memory allocations succeeded by this function. Signed-off-by: Markus Elfring --- drivers/scsi/hpsa.c | 3 ++- 1 file chan

[PATCH 3/4] scsi: hpsa: Delete an unnecessary initialisation in hpsa_big_passthru_ioctl()

2018-03-05 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 4 Mar 2018 22:02:10 +0100 The variable "status" will be set to an appropriate value a bit later. Thus omit the explicit initialisation at the beginning. Signed-off-by: Markus Elfring --- drivers/scsi/hpsa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[PATCH 2/4] scsi: hpsa: Less function calls in hpsa_big_passthru_ioctl() after error detection

2018-03-05 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 4 Mar 2018 22:00:19 +0100 The function "kfree" was called in a few cases by the hpsa_big_passthru_ioctl() function during error handling even if the passed variable contained a null pointer. * Adjust jump targets. * Delete two initialisations and a check (for the

[PATCH 1/4] scsi: hpsa: Use memdup_user() rather than duplicating its implementation

2018-03-05 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 4 Mar 2018 21:19:52 +0100 * Reuse existing functionality from memdup_user() instead of keeping duplicate source code. This issue was detected by using the Coccinelle software. * Return directly after this function call failed at the beginning. Signed-off-by:

[PATCH 0/4] SCSI-HPSA: Adjustments for hpsa_big_passthru_ioctl()

2018-03-05 Thread SF Markus Elfring
From: Markus Elfring Date: Mon, 5 Mar 2018 09:14:32 +0100 A few update suggestions were taken into account from static source code analysis. Markus Elfring (4): Use memdup_user() rather than duplicating its implementation Less function calls in hpsa_big_passthru_ioctl() after error detection

Re: [v2] [media] Use common error handling code in 20 functions

2018-02-28 Thread SF Markus Elfring
>> +put_isp: >> +omap3isp_put(video->isp); >> +delete_fh: >> +v4l2_fh_del(&handle->vfh); >> +v4l2_fh_exit(&handle->vfh); >> +kfree(handle); > > Please prefix the error labels with error_. How often do you really need such an extra prefix? >> +++ b/drivers/media/usb/uvc/uvc_v4l2.

Re: [0/8] target-iSCSI: Adjustments for several function implementations

2018-02-23 Thread SF Markus Elfring
>> Can a passed null pointer really work in this function? >> >> https://elixir.bootlin.com/linux/v4.16-rc2/source/include/crypto/hash.h#L684 >> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/crypto/hash.h?id=0f9da844d87796ac31b04e81ee95e155e9043132#n751 >> >> stati

Re: [0/8] target-iSCSI: Adjustments for several function implementations

2018-02-23 Thread SF Markus Elfring
> Calling crypto_free_shash(NULL) is actually fine. Really? > It doesn't dereference the parameter, it just does pointer math on it in > crypto_shash_tfm() and returns if it's NULL in crypto_destroy_tfm(). Can a passed null pointer really work in this function? https://elixir.bootlin.com/linux

Re: [2/2] crypto: bcm: One function call less in do_shash() after error detection

2018-02-23 Thread SF Markus Elfring
> This patch is pointless as kfree on NULL is a no-op. I prefer to avoid unnecessary function calls generally. Regards, Markus

Re: [0/8] target-iSCSI: Adjustments for several function implementations

2018-02-23 Thread SF Markus Elfring
> You're 1/8 patch had an actual bug fix hidden amongst the style churn. It showed the general possibility to adjust the source code structure for the function “chap_server_compute_md5” also because of the usage of the single jump label “out” before. > I don't see any such fixes in the other pat

Re: [PATCH 2/2] crypto: omap: Improve a size determination in three functions

2018-02-22 Thread SF Markus Elfring
>> @@ -1032,14 +1032,13 @@ static int omap_aes_get_res_pdev(struct omap_aes_dev >> *dd, >> static int omap_aes_probe(struct platform_device *pdev) >> { >> struct device *dev = &pdev->dev; >> -struct omap_aes_dev *dd; >> struct crypto_alg *algp; >> struct aead_alg *aalg; >>

[PATCH v2] [media] Delete unnecessary variable initialisations in seven functions

2018-02-22 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 22 Feb 2018 21:45:47 +0100 Some local variables will be set to an appropriate value before usage. Thus omit explicit initialisations at the beginning of these functions. Signed-off-by: Markus Elfring --- v2: Hans Verkuil insisted on patch squashing. Thus some ch

Re: [PATCH 0/8] target-iSCSI: Adjustments for several function implementations

2018-02-21 Thread SF Markus Elfring
> Date: Tue, 12 Dec 2017 22:22:11 +0100 > > Some update suggestions were taken into account > from static source code analysis. > > Markus Elfring (8): > Less function calls in chap_server_compute_md5() after error detection > Move resetting of seven variables in chap_server_compute_md5() >

[PATCH v2] [media] Use common error handling code in 20 functions

2018-02-19 Thread SF Markus Elfring
From: Markus Elfring Date: Mon, 19 Feb 2018 18:50:40 +0100 Adjust jump targets so that a bit of exception handling can be better reused at the end of these functions. This issue was partly detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- v2: Hans Verkuil insisted o

[PATCH] libata-scsi: Delete an unnecessary variable in ata_scsi_slave_config()

2018-02-16 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 16 Feb 2018 18:19:13 +0100 * Return a result code without storing it in an intermediate variable. * Reduce the needed source code. Signed-off-by: Markus Elfring --- drivers/ata/libata-scsi.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --gi

[PATCH 3/3] pata_arasan_cf: Move two variable assignments in arasan_cf_probe()

2018-02-16 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 16 Feb 2018 16:42:26 +0100 Move assignments for the local variables "irq_handler" and "pdata" so that their setting will only be performed after a call of the function "devm_kzalloc" succeeded by this function. Thus adjust a corresponding if statement. Signed-off-

  1   2   3   4   5   6   7   8   9   10   >