Re: [PATCH] staging-slicoss: Replace variable initialisations by assignments in slic_if_init()

2016-01-03 Thread SF Markus Elfring
>> I prefer that assignments for variables like "card" and "slic_regs" >> will only be performed immediately before the corresponding content will be >> read again (after a few condition checks were executed). >> >> Another description could be this view: >> I suggest to move the variable initialis

Re: [PATCH] staging-slicoss: Replace variable initialisations by assignments in slic_if_init()

2016-01-03 Thread SF Markus Elfring
>> I am a bit surprised that you do not like such source code fine-tuning. > > It's moving stuff around for no real reason, why would I like it? Can such fine-tuning result in positive effects for the run-time behaviour? > Reading and reviewing and applying this type of stuff takes away from >

Re: staging-slicoss: Replace variable initialisations by assignments in slic_if_init()

2016-01-03 Thread SF Markus Elfring
>> Can such fine-tuning result in positive effects for the run-time behaviour? > > If you can not benchmark and show the proof, don't even start to claim > such a thing. Which measurement results would you accept for further discussion? >> My suggestions can result in measurable differences. >

Re: staging-slicoss: Replace variable initialisations by assignments in slic_if_init()

2016-01-03 Thread SF Markus Elfring
>> Which measurement results would you accept for further discussion? > > If you don't know how to show your results, then this whole discussion > is pointless. I could show test results. But it could happen that I would choose insufficient variations for execution environments. I am unsure abou

[PATCH] staging: xgifb: Delete an unnecessary check before the function call "XGIfb_search_crt2type"

2015-06-26 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 26 Jun 2015 21:50:41 +0200 The XGIfb_search_crt2type() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring

[PATCH] staging: lustre: Deletion of unnecessary checks before three function calls

2015-06-26 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 26 Jun 2015 23:10:42 +0200 The following functions test whether their argument is NULL and then return immediately. * kfree * ll_file_data_put * ptlrpc_connection_put Thus the test around such calls is not needed. This issue was detected by using the Coccinelle s

[PATCH] staging: comedi: adl_pci9118: Delete an unnecessary check before the function call "pci_dev_put"

2015-06-27 Thread SF Markus Elfring
From: Markus Elfring Date: Sat, 27 Jun 2015 13:50:43 +0200 The pci_dev_put() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drive

[PATCH 0/2] staging: wilc1000: Deletion of two unnecessary checks

2015-06-27 Thread SF Markus Elfring
From: Markus Elfring Further update suggestions were taken into account after a patch was applied from static source code analysis. Markus Elfring (2): Delete unnecessary checks before two function calls One function call less in mac_ioctl() after error detection drivers/staging/wilc1000/l

[PATCH 1/2] staging: wilc1000: Delete unnecessary checks before two function calls

2015-06-27 Thread SF Markus Elfring
From: Markus Elfring Date: Sat, 27 Jun 2015 15:56:57 +0200 The functions kfree() and release_firmware() test whether their argument is NULL and then return immediately. Thus the test around the calls is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus

[PATCH 2/2] staging: wilc1000: One function call less in mac_ioctl() after error detection

2015-06-27 Thread SF Markus Elfring
From: Markus Elfring Date: Sat, 27 Jun 2015 16:00:59 +0200 The kfree() function was called in two cases by the mac_ioctl() function during error handling even if the passed variable did not contain a pointer for a valid data item. * This implementation detail could be improved by the introductio

Re: Clarification for the use of additional fields in the message body

2015-07-06 Thread SF Markus Elfring
>> From: Markus Elfring >> Date: Sat, 27 Jun 2015 15:56:57 +0200 > > Why is this in the body of the email? Does the canonical patch format support to preserve specific details about a shown commit by specification of fields like "Date" and "From" in the message body? Regards, Markus ___

Re: Clarification for the use of additional fields in the message body

2015-07-07 Thread SF Markus Elfring
> The date, as far as I know, is ignored. It is the commit date, > not the authoring date, and once your patch is applied by a maintainer > (i.e. committed), the date gets reset anyway. Thanks for your feedback. > No need to try and preserve it. I find that it might occasionally help to share a

Re: Clarification for the use of additional fields in the message body

2015-07-07 Thread SF Markus Elfring
> I think that as far as these kernel mailing lists are concerned, > the date of the update suggestion is the date on which you submitted the > patch, > rather than the date you originally committed it to your local tree. I imagine that there are committers who would like to keep corresponding so

Re: Clarification for the use of additional fields in the message body

2015-07-07 Thread SF Markus Elfring
> I can't remember ever changing or explicitly preserving the commit date. > I don't think I care enough. Would any more software developers and maintainers like to share their experiences around such details? When do commit timestamps become relevant as a documentation item for contribution auth

Re: Clarification for the use of additional fields in the message body

2015-07-08 Thread SF Markus Elfring
> There's a file in the documentation directory of the kernel > tree describing submitting patches and email client setup. > Read them both, I read this information several times. > do what they say without anything extra. Do you see any special consequences if a bit of "extra" functionality is

Re: staging: wilc1000: One function call less in mac_ioctl() after error detection

2015-07-08 Thread SF Markus Elfring
>> The kfree() function was called in two cases by the mac_ioctl() function >> during error handling even if the passed variable did not contain a pointer >> for a valid data item. >> >> * This implementation detail could be improved by the introduction >> of another jump label. >> >> * Drop an u

Re: Clarification for the use of additional fields in the message body

2015-07-08 Thread SF Markus Elfring
> If it's harmless, then no, but in this case, people are questioning > why you're adding it as it adds no value Some Git software developers care to keep the information complete for the author commit. > to anyone and makes it look like you don't know what you're doing. I specify message field

Re: Clarification for the use of additional fields in the message body

2015-07-08 Thread SF Markus Elfring
> Is there truly no way to simplify that process? I see some software development possibilities which could improve the communication with high volume mailing lists. > You should be sending the patches directly with SMTP using git-send-email, This tool is also fine for the publishing of a lot o

Re: Clarification for the use of additional fields in the message body

2015-07-08 Thread SF Markus Elfring
> Note also that some maintainers have work flow that deliberately smash > the date (i.e., because they are using a system such as guilt), > so if you are depending on the submitted timestamp, it's going to > break on you. Thanks for your hint. I am just trying to offer the possibility for the re

[PATCH resent] staging: lustre: Deletion of unnecessary checks before three function calls

2015-07-14 Thread SF Markus Elfring
From: Markus Elfring The following functions test whether their argument is NULL and then return immediately. * kfree * ll_file_data_put * ptlrpc_connection_put Thus the test around such calls is not needed. This issue was detected by using the Coccinelle software. See also a previous update

[PATCH 0/5] staging-COMEDI: Fine-tuning for three functions

2016-12-08 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 8 Dec 2016 11:37:37 +0100 Some update suggestions were taken into account from static source code analysis. Markus Elfring (5): Combine four kcalloc() calls into one in serial2002_setup_subdevs() Split a condition check in usbdux_alloc_usb_buffers() Move an

[PATCH 2/5] staging: comedi: usbdux: Split a condition check in usbdux_alloc_usb_buffers()

2016-12-08 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 8 Dec 2016 10:01:54 +0100 The functions "kcalloc" and "kzalloc" were called in four cases by the function "usbdux_alloc_usb_buffers" without checking immediately if they succeded. This issue was detected by using the Coccinelle software. Allocated memory was also

[PATCH 3/5] staging: comedi: usbdux: Move an assignment in usbdux_alloc_usb_buffers()

2016-12-08 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 8 Dec 2016 10:13:56 +0100 Move one assignment for the local variable "usb" so that its setting will only be performed after some memory allocations succeeded by this function. Signed-off-by: Markus Elfring --- drivers/staging/comedi/drivers/usbdux.c | 3 ++- 1 f

[PATCH 4/5] staging: comedi: usbduxsigma: Split a condition check in usbduxsigma_alloc_usb_buffers()

2016-12-08 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 8 Dec 2016 11:15:40 +0100 The functions "kcalloc" and "kzalloc" were called in four cases by the function "usbduxsigma_alloc_usb_buffers" without checking immediately if they succeded. This issue was detected by using the Coccinelle software. Allocated memory was

[PATCH 5/5] staging: comedi: usbduxsigma: Move an assignment in usbduxsigma_alloc_usb_buffers()

2016-12-08 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 8 Dec 2016 11:20:38 +0100 Move one assignment for the local variable "usb" so that its setting will only be performed after some memory allocations succeeded by this function. Signed-off-by: Markus Elfring --- drivers/staging/comedi/drivers/usbduxsigma.c | 3 ++-

[PATCH 1/5] staging: comedi: serial2002: Combine four kcalloc() calls into one in serial2002_setup_subdevs()

2016-12-08 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 8 Dec 2016 07:37:29 +0100 The function "kcalloc" was called in three cases by the function "serial2002_setup_subdevs" without checking immediately if it failed. This issue was detected by using the Coccinelle software. * Perform the desired memory allocation (and

Re: staging-COMEDI: Fine-tuning for three functions

2016-12-08 Thread SF Markus Elfring
> You do realize that I no longer take patches from you for any of the > subsystems I maintain, right? Not so far. It seems that you would like to present new information for our challenging collaboration. > This patch series is one reason why... I hope that corresponding disagreements around

Re: staging: comedi: usbdux: Split a condition check in usbdux_alloc_usb_buffers()

2016-12-08 Thread SF Markus Elfring
> Actually, the original code worked fine, I got my doubts when some memory allocations are attempted without checking the desired success immediately. > and these changes will result in an Oops if the allocations fail. I'll > explain why, > since it isn't obvious without some knowledge of the

Re: staging: comedi: usbduxsigma: Split a condition check in usbduxsigma_alloc_usb_buffers()

2016-12-08 Thread SF Markus Elfring
>> * Reduce memory allocation sizes for two function calls. Is this implementation detail worth for further considerations? Regards, Markus ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driv

[PATCH 0/4] staging-greybus: Fine-tuning for four functions

2016-12-09 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 9 Dec 2016 15:25:35 +0100 A few update suggestions were taken into account from static source code analysis. Markus Elfring (4): One function call less in gb_camera_configure_streams() after error detection light: Use kcalloc() in two functions Check return

[PATCH 1/4] staging: greybus: camera: One function call less in gb_camera_configure_streams() after error detection

2016-12-09 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 8 Dec 2016 18:25:13 +0100 The kfree() function was called in one case by the gb_camera_configure_streams() function during error handling even if the passed variable contained a null pointer. This issue was detected by using the Coccinelle software. Adjust a jump

[PATCH 2/4] staging: greybus: light: Use kcalloc() in two functions

2016-12-09 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 9 Dec 2016 13:46:25 +0100 * 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 3/4] staging: greybus: light: Check return value of a kstrndup() call in gb_lights_light_config()

2016-12-09 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 9 Dec 2016 14:36:16 +0100 A return value was not checked after a call of the function "kstrndup". This issue was detected by using the Coccinelle software. Add a bit of exception handling. Fixes: 2870b52bae4c81823ffcb3ed2b0626fb39d64f48 ("greybus: lights: add lig

[PATCH 4/4] staging: greybus: power_supply: Use kcalloc() in gb_power_supplies_setup()

2016-12-09 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 9 Dec 2016 15:04:24 +0100 * 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 software

[PATCH] staging: r8192U_core: Use kmalloc_array() in rtl8192_usb_initendpoints()

2016-12-30 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 30 Dec 2016 21:43:22 +0100 * 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 0/6] staging: vchiq_arm: Fine-tuning for some function implementations

2016-12-31 Thread SF Markus Elfring
From: Markus Elfring Date: Sat, 31 Dec 2016 22:42:34 +0100 Some update suggestions were taken into account from static source code analysis. Markus Elfring (6): Use kmalloc_array() in dump_phys_mem() Adjust 13 checks for null pointers One check less in dump_phys_mem() after error detection

[PATCH 1/6] staging: vchiq_arm: Use kmalloc_array() in dump_phys_mem()

2016-12-31 Thread SF Markus Elfring
From: Markus Elfring Date: Sat, 31 Dec 2016 17:50:25 +0100 * 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 2/6] staging: vchiq_arm: Adjust 13 checks for null pointers

2016-12-31 Thread SF Markus Elfring
From: Markus Elfring Date: Sat, 31 Dec 2016 21:23:24 +0100 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 3/6] staging: vchiq_arm: One check less in dump_phys_mem() after error detection

2016-12-31 Thread SF Markus Elfring
From: Markus Elfring Date: Sat, 31 Dec 2016 21:26:09 +0100 Adjust a jump target according to the Linux coding style convention so that a redundant check for a null pointer can be avoided in this function. Signed-off-by: Markus Elfring --- drivers/staging/vc04_services/interface/vchiq_arm/vchiq

[PATCH 4/6] staging: vchiq_arm: Delete an error message for a failed memory allocation in dump_phys_mem()

2016-12-31 Thread SF Markus Elfring
From: Markus Elfring Date: Sat, 31 Dec 2016 21:30:31 +0100 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/staging/vc04_servic

[PATCH 5/6] staging: vchiq_arm: Combine substrings for 24 messages

2016-12-31 Thread SF Markus Elfring
From: Markus Elfring Date: Sat, 31 Dec 2016 22:00:28 +0100 The script "checkpatch.pl" pointed information out like the following. WARNING: quoted string split across lines * Thus fix the affected source code places. * Improve indentation for passed parameters. Signed-off-by: Markus Elfring -

[PATCH 6/6] staging: vchiq_arm: Delete an unnecessary return statement in two functions

2016-12-31 Thread SF Markus Elfring
From: Markus Elfring Date: Sat, 31 Dec 2016 22:05:19 +0100 The script "checkpatch.pl" pointed information out like the following. WARNING: void function return statements are not generally useful Thus remove such a statement in affected functions. Signed-off-by: Markus Elfring --- drivers/st

[PATCH 0/5] staging-Lustre: Fine-tuning for some function implementations

2017-01-01 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 1 Jan 2017 17:10:10 +0100 A few update suggestions were taken into account from static source code analysis. Markus Elfring (5): llite: Use seq_puts() in three functions mgc: Combine two seq_printf() calls into one call in lprocfs_mgc_rd_ir_state() obdclass:

[PATCH 1/5] staging/lustre/llite: Use seq_puts() in three functions

2017-01-01 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 1 Jan 2017 15:30:45 +0100 A string which did not contain a data format specification should be put into a sequence. Thus use the corresponding function "seq_puts" so that the data output will be a bit more efficient in these functions. This issue was detected by u

[PATCH 2/5] staging/lustre/mgc: Combine two seq_printf() calls into one call in lprocfs_mgc_rd_ir_state()

2017-01-01 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 1 Jan 2017 15:40:29 +0100 Some data were printed into a sequence by two separate function calls. Print the same data by a single function call instead. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/staging/l

[PATCH 3/5] staging/lustre/obdclass: Use seq_putc() in four functions

2017-01-01 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 1 Jan 2017 16:12:23 +0100 A few single characters (line breaks) should be put into a sequence. Thus use the corresponding function "seq_putc". This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/staging/lustre/lus

[PATCH 4/5] staging/lustre/obdclass: Combine two seq_printf() calls into one call in lprocfs_rd_state()

2017-01-01 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 1 Jan 2017 16:26:36 +0100 Some data were printed into a sequence by two separate function calls. Print the same data by a single function call instead. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/staging/l

[PATCH 5/5] staging/lustre/obdclass: Use seq_puts() in three functions

2017-01-01 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 1 Jan 2017 16:45:32 +0100 A string which did not contain a data format specification should be put into a sequence. Thus use the corresponding function "seq_puts" so that the data output will be a bit more efficient in these functions. This issue was detected by u

[PATCH] staging: gdm72xx: Deletion of an unnecessary check before the function call "kfree"

2015-02-01 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 1 Feb 2015 18:28:33 +0100 The kfree() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/stag

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

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

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

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

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

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

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

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

[PATCH 2/9] staging: ks7010: Delete unnecessary assignments for buffer variables

2016-07-17 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 17 Jul 2016 13:38:46 +0200 A few variables were assigned a null pointer despite of the detail that they were immediately reassigned by the following statement. Thus remove such unnecessary assignments. Signed-off-by: Markus Elfring --- drivers/staging/ks7010/ks7

[PATCH 1/9] staging: ks7010: Delete unnecessary checks before the function call "kfree"

2016-07-17 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 17 Jul 2016 13:14:57 +0200 The kfree() function tests whether its argument is NULL and then returns immediately. Thus the test around the calls is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/st

[PATCH 3/9] staging: ks7010: Return directly after a failed kmalloc()

2016-07-17 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 17 Jul 2016 15:55:02 +0200 Return directly after a memory allocation failed at the beginning. Signed-off-by: Markus Elfring --- drivers/staging/ks7010/ks7010_sdio.c | 19 +++ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/drivers/

[PATCH 0/9] staging: ks7010: Fine-tuning for a SDIO card driver

2016-07-17 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 17 Jul 2016 19:54:32 +0200 Further update suggestions were taken into account after a patch was applied from static source code analysis. Markus Elfring (9): Delete unnecessary checks before the function call "kfree" Delete unnecessary assignments for buffer v

[PATCH 4/9] staging: ks7010: Rename jump labels

2016-07-17 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 17 Jul 2016 16:26:18 +0200 Adjust jump targets according to the Linux coding style convention. Signed-off-by: Markus Elfring --- drivers/staging/ks7010/ks7010_sdio.c | 81 +--- 1 file changed, 38 insertions(+), 43 deletions(-) di

[PATCH 5/9] staging: ks7010: Delete unnecessary uses of the variable "retval"

2016-07-17 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 17 Jul 2016 18:15:23 +0200 Some return values can also be directly used for various condition checks. Thus remove a local variable for intermediate assignments. Signed-off-by: Markus Elfring --- drivers/staging/ks7010/ks7010_sdio.c | 81 +++--

[PATCH 6/9] staging: ks7010: Delete unnecessary braces

2016-07-17 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 17 Jul 2016 18:39:03 +0200 Do not use curly brackets at some source code places where a single statement should be sufficient. Signed-off-by: Markus Elfring --- drivers/staging/ks7010/ks7010_sdio.c | 48 1 file changed, 16 in

[PATCH 8/9] staging: ks7010: Delete a variable in write_to_device()

2016-07-17 Thread SF Markus Elfring
>From 01291121668ccb54f1a784765a8d2b5811afa75a Mon Sep 17 00:00:00 2001 From: Markus Elfring Date: Sun, 17 Jul 2016 19:26:15 +0200 Subject: [PATCH 8/9] staging: ks7010: Delete a variable in write_to_device() The local variable "rc" was assigned a zero at one place. But it was not read within this

[PATCH 9/9] staging: ks7010: Delete three unnecessary variable initialisations

2016-07-17 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 17 Jul 2016 19:40:47 +0200 Three variables will be set to an appropriate value a bit later. Thus omit the explicit initialisation at the beginning. Signed-off-by: Markus Elfring --- drivers/staging/ks7010/ks7010_sdio.c | 8 1 file changed, 4 insertions(

[PATCH 7/9] staging: ks7010: Replace three printk() calls by pr_err()

2016-07-17 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 17 Jul 2016 19:12:27 +0200 Prefer usage of the macro "pr_err" over the interface "printk". Fix a typo in an error message. Signed-off-by: Markus Elfring --- drivers/staging/ks7010/ks7010_sdio.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff -

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

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

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

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

Re: staging: ks7010: Rename jump labels

2016-07-20 Thread SF Markus Elfring
>> Adjust jump targets according to the Linux coding style convention. > > Really? Is that documented somewhere? How do you think about information from the chapter "7: Centralized exiting of functions"? https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/CodingSty

Re: [PATCH 3/9] staging: ks7010: Return directly after a failed kmalloc()

2016-07-20 Thread SF Markus Elfring
>>> @@ -713,10 +713,8 @@ static int ks7010_sdio_update_index(struct >>> ks_wlan_private *priv, u32 index) >>> unsigned char *data_buf; >>> >>> data_buf = kmalloc(sizeof(u32), GFP_KERNEL); >>> - if (!data_buf) { >>> - rc = 1; >>> - goto error_out; >>> - } >>> + if

Re: [PATCH 5/9] staging: ks7010: Delete unnecessary uses of the variable "retval"

2016-07-20 Thread SF Markus Elfring
>>> @@ -90,7 +90,6 @@ static int ks7010_sdio_write(struct ks_wlan_private >>> *priv, unsigned int address, >>> void ks_wlan_hw_sleep_doze_request(struct ks_wlan_private *priv) >>> { >>> unsigned char rw_data; >>> - int retval; >>> >>> DPRINTK(4, "\n"); >>> >>> @@ -99,9 +98,10 @@ void k

Re: staging: ks7010: Rename jump labels

2016-07-21 Thread SF Markus Elfring
> > How do you think about information from the chapter "7: Centralized exiting > > of functions"? > > https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/CodingStyle?id=47ef4ad2684d380dd6d596140fb79395115c3950#n389 > > I'm not impressed by this piece of documentati

Re: staging: ks7010: Delete unnecessary uses of the variable "retval"

2016-07-21 Thread SF Markus Elfring
> I think the original code was fine. I suggest to reconsider involved implementation details once more. > x = blah(); if (x) ... is a perfectly familiar kernel coding pattern. I can agree to such a general information. > There is no benefit in terms of performance It might be possible that

Re: staging: ks7010: Delete unnecessary uses of the variable "retval"

2016-07-21 Thread SF Markus Elfring
> if (atomic_read(&priv->sleepstatus.status) == 0) { > rw_data = GCR_B_DOZE; > - retval = > - ks7010_sdio_write(priv, GCR_B, &rw_data, sizeof(rw_data)); > - if (retval) { > + if (ks7010_sdio_write(priv, > +

Re: [PATCH 9/9] staging: ks7010: Delete three unnecessary variable initialisations

2016-07-21 Thread SF Markus Elfring
>> @@ -323,14 +323,14 @@ static void tx_device_task(void *dev) >> { >> struct ks_wlan_private *priv = (struct ks_wlan_private *)dev; >> struct tx_device_buffer *sp; >> -int rc = 0; >> >> DPRINTK(4, "\n"); >> if (cnt_txqbody(priv) > 0 >> && atomic_read(&priv->psstat

Re: staging: ks7010: Delete three unnecessary variable initialisations

2016-07-21 Thread SF Markus Elfring
>> * Do you occasionally care for a refactoring like "Reduce scope of variable"? >> >> http://refactoring.com/catalog/reduceScopeOfVariable.html > > Probably not. Certainly not in this case. In which use cases would the suggested change pattern be more interesting for you? Regards, Markus ___

Re: staging: ks7010: Rename jump labels

2016-07-21 Thread SF Markus Elfring
> That being said... checkpatch does not complain about leading space > before labels. Not even with --strict. So why are you mentioning it here? I remembered a warning like "INDENTED_LABEL" instead. https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/scripts/checkpatch.pl?id=92d2

Re: staging: ks7010: Rename jump labels

2016-07-21 Thread SF Markus Elfring
>> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/scripts/checkpatch.pl?id=92d21ac74a9e3c09b0b01c764e530657e4c85c49#n4326 > > "#goto labels aren't indented, allow a single space however" > > Can't be clearer :-) Should such information from a comment in this script be also

Re: staging: ks7010: Delete unnecessary uses of the variable "retval"

2016-07-21 Thread SF Markus Elfring
>> Can you follow expectations around the proposed refactoring of any >> function implementations? > > I don't understand both questions. Maybe you need to give examples? I suggest to try the following script (semantic patch for working with the Coccinelle software) out on the discussed source fi

Re: staging: ks7010: Return directly after a failed kmalloc()

2016-07-22 Thread SF Markus Elfring
>> I guess that further clarification might be needed for affected >> implementation details. > > That's OK, too. > > Acked-by: Wolfram Sang Does this acknowledgement include also the acceptance for the suggested change around calls of the functions "sdio_claim_host" and "sdio_release_host" wit

[PATCH 0/3] staging: wilc1000: Fine-tuning for two function implementations

2016-07-24 Thread SF Markus Elfring
From: Markus Elfring Further update suggestions were taken into account after a patch was applied from static source code analysis. Markus Elfring (3): Delete an unnecessary check before the function call "release_firmware" One function call less in mac_ioctl() after error detection Reduce

[PATCH 1/3] staging: wilc1000: Delete an unnecessary check before the function call "release_firmware"

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

[PATCH 2/3] staging: wilc1000: One function call less in mac_ioctl() after error detection

2016-07-24 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 24 Jul 2016 21:15:23 +0200 The kfree() function was called in two cases by the mac_ioctl() function during error handling even if the passed variable did not contain a pointer for a valid data item. Improve this implementation detail by the introduction of another

[PATCH 3/3] staging: wilc1000: Reduce scope for a few variables in mac_ioctl()

2016-07-24 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 24 Jul 2016 21:45:37 +0200 Three local variables were used only within a single case branch. * Thus move the data type definition for "rssi" and "size" into the corresponding code block. * The variable "length" was not modified after its initialisation. Thus

Re: staging: ks7010: Rename jump labels

2016-07-25 Thread SF Markus Elfring
>> Would you like to support the renaming of a label like "error_out1" >> (in the function "ks7010_upload_firmware" for example)? > > They should be renamed too. Anything using numbers instead of explicit Interesting … > Anything using numbers instead of explicit labels should be updated. Woul

[PATCH] staging: rtl8188eu: Delete an unnecessary check before the function call "vfree"

2016-07-25 Thread SF Markus Elfring
From: Markus Elfring Date: Mon, 25 Jul 2016 22:20:24 +0200 The vfree() function performs also input parameter validation. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/staging/rtl8188eu/core/rtw

Re: staging: wilc1000: Reduce scope for a few variables in mac_ioctl()

2016-07-25 Thread SF Markus Elfring
>> -if (strncasecmp(buff, "RSSI", length) == 0) { >> +if (strncasecmp(buff, "RSSI", 0) == 0) { >> +s8 rssi; >> + > > Um, please think a second about if it makes any sense at all to compare > zero chars of two strings. Under whic

Re: staging: ks7010: Rename jump labels

2016-07-26 Thread SF Markus Elfring
> I have a lot of other things to work on, of much greater interest (to me.) This is fine. Thanks for your feedback. >>> Personally I see no value in such statistics. >> >> Do they indicate any code smells eventually? > > I have no idea what you mean, sorry. How do you think about to take ano

[PATCH 00/12] staging-Lustre: Fine-tuning for seven function implementations

2016-07-26 Thread SF Markus Elfring
From: Markus Elfring Further update suggestions were taken into account after a patch was applied from static source code analysis. Markus Elfring (12): ldlm: Delete unnecessary checks before the function call "kset_unregister" Delete unnecessary checks before the function call "kobject_put"

[PATCH 01/12] staging/lustre/ldlm: Delete unnecessary checks before the function call "kset_unregister"

2016-07-26 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 26 Jul 2016 11:33:43 +0200 The kset_unregister() function tests whether its argument is NULL and then returns immediately. Thus the test around the calls is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring ---

[PATCH 02/12] staging: lustre: Delete unnecessary checks before the function call "kobject_put"

2016-07-26 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 26 Jul 2016 13:00:32 +0200 The kobject_put() function tests whether its argument is NULL and then returns immediately. Thus the test around the calls is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- driv

[PATCH 03/12] staging: lustre: One function call less in class_register_type() after error detection

2016-07-26 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 26 Jul 2016 13:40:47 +0200 The kobject_put() function was called in a few cases by the class_register_type() function during error handling even if the passed data structure element did not contain a pointer for a valid data item. Adjust jump targets according to

[PATCH 04/12] staging: lustre: Split a condition check in class_register_type()

2016-07-26 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 26 Jul 2016 14:10:55 +0200 The kfree() function was called in up to three cases by the class_register_type() function during error handling even if the passed data structure element contained a null pointer. * Split a condition check for memory allocation failures

[PATCH 06/12] staging: lustre: Return directly after a failed kcalloc() in mgc_process_recover_log()

2016-07-26 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 26 Jul 2016 16:32:31 +0200 Return directly after a memory allocation failed at the beginning. Signed-off-by: Markus Elfring --- drivers/staging/lustre/lustre/mgc/mgc_request.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/stag

[PATCH 07/12] staging: lustre: Less checks after a failed alloc_page() in mgc_process_recover_log()

2016-07-26 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 26 Jul 2016 17:12:51 +0200 Release memory directly after a page allocation failed at the beginning. Signed-off-by: Markus Elfring --- drivers/staging/lustre/lustre/mgc/mgc_request.c | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) diff --gi

[PATCH 08/12] staging: lustre: Less checks after a failed ptlrpc_request_alloc() in mgc_process_recover_log()

2016-07-26 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 26 Jul 2016 17:54:24 +0200 Release memory directly after a call of the function "ptlrpc_request_alloc" failed. Signed-off-by: Markus Elfring --- drivers/staging/lustre/lustre/mgc/mgc_request.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/d

[PATCH 09/12] staging: lustre: Delete a check for the variable "req" in mgc_process_recover_log()

2016-07-26 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 26 Jul 2016 17:56:49 +0200 Delete a check for the local variable "req" which became unnecessary with the previous update step. Signed-off-by: Markus Elfring --- drivers/staging/lustre/lustre/mgc/mgc_request.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(

[PATCH 10/12] staging: lustre: Rename jump labels in mgc_process_recover_log()

2016-07-26 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 26 Jul 2016 19:29:11 +0200 Adjust jump targets according to the Linux coding style convention. Signed-off-by: Markus Elfring --- drivers/staging/lustre/lustre/mgc/mgc_request.c | 19 +-- 1 file changed, 9 insertions(+), 10 deletions(-) diff --gi

[PATCH 11/12] staging: lustre: Move an assignment for the variable "eof" in mgc_process_recover_log()

2016-07-26 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 26 Jul 2016 19:40:28 +0200 Move the assignment for the local variable "eof" behind the source code for memory allocations by this function. Signed-off-by: Markus Elfring --- drivers/staging/lustre/lustre/mgc/mgc_request.c | 3 ++- 1 file changed, 2 insertions(+)

[PATCH 05/12] staging: lustre: Optimize error handling in class_register_type()

2016-07-26 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 26 Jul 2016 14:23:23 +0200 Return a constant error code without storing it in the local variable "rc" after a failed memory allocation at the beginning of this function. Signed-off-by: Markus Elfring --- drivers/staging/lustre/lustre/obdclass/genops.c | 3 +-- 1

[PATCH 12/12] staging: lustre: Delete an unnecessary variable initialisation in mgc_process_recover_log()

2016-07-26 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 26 Jul 2016 19:50:40 +0200 The variable "req" will eventually be set to an appropriate pointer from a call of the ptlrpc_request_alloc() function. Thus omit the explicit initialisation which became unnecessary with a previous update step. Signed-off-by: Markus Elf

Re: staging: lustre: One function call less in class_register_type() after error detection

2016-07-26 Thread SF Markus Elfring
> But kobject_put() already checks for NULL, right? Yes. - Such an input parameter validation is performed by the function implementation. > you just submitted another batch about that in other area. I sent update suggestions because of this function property for two Linux software modules in t

Re: staging: lustre: Optimize error handling in class_register_type()

2016-07-26 Thread SF Markus Elfring
> NAK. > when you do this, the next statement below breaks: I wonder about this conclusion. >> type = kzalloc(sizeof(*type), GFP_NOFS); >> if (!type) >> -return rc; >> +return -ENOMEM; >> >> type->typ_dt_ops = kzalloc(sizeof(*type->typ_dt_ops), GFP_NOFS); >

<    1   2   3   >