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

[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

[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 af

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

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 &q

[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

[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

[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

[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

[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(-) di

[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

[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

[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

[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/ge

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

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); >

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

2016-07-27 Thread SF Markus Elfring
> This function is called several times during lustre module insert. > Namely it's called 5 times for 5 types: > osc, mdc, lov, lmv, mgc. Will any extra memory accesses matter for the successful execution in this use case? > It's not called any more than that, so it's not exactly a super hot-pat

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

2016-07-28 Thread SF Markus Elfring
> Which circumstances do "not any sense at all" imply? Should the expression 'strlen("RSSI")' be passed for the parameter 'length' instead? > I suggest to fix this since it is indeed a bug, We can agree that this function implementation was broken for a while there. > instead of doing "micr

Re: [lustre-devel] staging: lustre: One function call less in class_register_type() after error detection

2016-07-29 Thread SF Markus Elfring
> In typical deployments outside of testing environment, this function is > called 5 times every system boot and never again. Does this information mean that a bit more fine-tuning is insignificant at such a source code place? >> Did the assignment for the local variable "rc" with a well-known e

Re: staging: ks7010: Replace three printk() calls by pr_err()

2016-08-10 Thread SF Markus Elfring
>> Please and and use pr_fmt > > Can't we use dev_* on the SDIO device? How should a connection be constructed from the data structure "sdio_device_id" to the corresponding device information for such an use case? Regards, Markus ___ devel mailing list

[PATCH v2 00/10] staging: ks7010: Fine-tuning for a SDIO card driver

2016-08-10 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 (10): Delete unnecessary checks before the function call "kfree" Delete unnecessary assignments for buffer variables Return direct

[PATCH v2 01/10] staging: ks7010: Delete unnecessary checks before the function call "kfree"

2016-08-10 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 10 Aug 2016 17:15:15 +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

[PATCH v2 02/10] staging: ks7010: Delete unnecessary assignments for buffer variables

2016-08-10 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 10 Aug 2016 17:26:01 +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 --- v2: Rebased on the source

[PATCH v2 03/10] staging: ks7010: Return directly after a failed kmalloc()

2016-08-10 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 10 Aug 2016 17:34:12 +0200 Return directly after a memory allocation failed at the beginning. Signed-off-by: Markus Elfring --- v2: Rebased on the source files from Linux next-20160809. drivers/staging/ks7010/ks7010_sdio.c | 19 +++ 1 file

[PATCH v2 04/10] staging: ks7010: Rename jump labels

2016-08-10 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 10 Aug 2016 17:57:50 +0200 Adjust jump targets according to the Linux coding style convention. Signed-off-by: Markus Elfring --- v2: Rebased on the source files from Linux next-20160809. Touched four source code places less. drivers/staging/ks7010

[PATCH v2 05/10] staging: ks7010: Delete unnecessary uses of the variable "retval"

2016-08-10 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 10 Aug 2016 18:56:31 +0200 A few return values can also be directly used for condition checks. Thus remove a local variable for intermediate assignments. Signed-off-by: Markus Elfring --- v2: Rebased on the source files from Linux next-20160809. Touched

[PATCH v2 06/10] staging: ks7010: Delete unnecessary braces

2016-08-10 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 10 Aug 2016 19:57:01 +0200 Do not use curly brackets at some source code places where a single statement should be sufficient. Signed-off-by: Markus Elfring --- v2: Rebased on the source files from Linux next-20160809. Touched less source code places

[PATCH v2 07/10] staging: ks7010: Add the macro "pr_fmt"

2016-08-10 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 10 Aug 2016 20:45:11 +0200 Add a definition for the macro "pr_fmt" so that its information can be used for consistent message output. Suggested-by: Joe Perches Signed-off-by: Markus Elfring --- v2: Addition from source code review drivers/stag

[PATCH v2 08/10] staging: ks7010: Replace three printk() calls by pr_err()

2016-08-10 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 10 Aug 2016 21:56:15 +0200 Prefer usage of the macro "pr_err" over the interface "printk". Fix a typo in an error message. Signed-off-by: Markus Elfring --- v2: Rebased on the source files from Linux next-20160809. drivers/staging/ks70

[PATCH v2 09/10] staging: ks7010: Delete a variable in write_to_device()

2016-08-10 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 10 Aug 2016 22:10:20 +0200 The local variable "rc" was assigned a zero at one place. But it was not read within this function. Thus delete it. Signed-off-by: Markus Elfring Reviewed-by: Wolfram Sang --- v2: Rebased on the source files from Linux nex

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

2016-08-10 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 10 Aug 2016 22:33:52 +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 --- v2: Rebased on the source files from Linux next-20160809. It was omitted to

Re: staging: ks7010: Replace three printk() calls by pr_err()

2016-08-12 Thread SF Markus Elfring
>>> Can't we use dev_* on the SDIO device? >> >> How should a connection be constructed from the data structure >> "sdio_device_id" >> to the corresponding device information for such an use case? > > What did you try so far? Nothing what I would find noteworthy for increasing the usage of a fun

Re: staging: ks7010: Replace three printk() calls by pr_err()

2016-08-13 Thread SF Markus Elfring
>> Prefer usage of the macro "pr_err" over the interface "printk". > Not correct A checkpatch warning like "PREFER_PR_LEVEL" can point additional possibilities out for this use case. Would you like to introduce any of the higher level logging functions instead? >> diff --git a/drivers/staging/k

Re: staging: ks7010: Replace three printk() calls by pr_err()

2016-08-13 Thread SF Markus Elfring
> I think pr_ is OK if reworking the code > to support dev_ is not easy. Thanks for this explanation. - It sounds more constructive than the previous short feedback "Not correct". >> Would you accept that another update will be appended to the discussed patch >> series? > > No. Patches shoul

Re: staging: ks7010: Replace three printk() calls by pr_err()

2016-08-13 Thread SF Markus Elfring
> You might have noticed I also wrote in the same reply: > > "All of these pr_fmt uses are redundant as pr_err already does pr_fmt" I admit that I made another software development mistake there. - It might not matter much when a final fix could be to get rid of the three affected logging calls

Re: [PATCH v2 00/10] staging: ks7010: Fine-tuning for a SDIO card driver

2016-08-13 Thread SF Markus Elfring
> I added some Acked- and Reviewed-by tags last time. I noticed this of course. > Did the patches change Yes. - The amount of source code which I touched in this software module is different for the second series. > or why didn't you add them? I imagined that your acknowledgements to the pre

Re: staging: ks7010: Replace three printk() calls by pr_err()

2016-08-13 Thread SF Markus Elfring
> Really now, this is basic fixes and cleanups, I agree to this view to some degree. > you have been asked many times in the past to move on beyond these, It is more useful when more severe bugs or bigger software improvements can be found. Which source code clean-ups are picked better up by o

[PATCH] staging/lustre/llite: Use memdup_user() rather than duplicating its implementation

2016-08-21 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 21 Aug 2016 11:30:57 +0200 Reuse existing functionality from memdup_user() instead of keeping duplicate source code. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/staging/lustre/lustre/llite/dir.c | 12

[PATCH 00/14] VME: Adjustments for several function implementations

2017-08-25 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 25 Aug 2017 13:15:43 +0200 Several update suggestions were taken into account from static source code analysis. Markus Elfring (14): Delete 11 error messages for a failed memory allocation Improve 11 size determinations Move an assignment in

[PATCH 01/14] vme: Delete 11 error messages for a failed memory allocation

2017-08-25 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 24 Aug 2017 21:38:20 +0200 Omit extra messages for a memory allocation failure in these functions. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/vme/vme.c | 51

[PATCH 03/14] vme: Move an assignment in vme_new_dma_list()

2017-08-25 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 24 Aug 2017 22:04:45 +0200 Assign a pointer to a data structure member without using an intermediate local variable. Signed-off-by: Markus Elfring --- drivers/vme/vme.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/vme/vme.c

[PATCH 02/14] vme: Improve 11 size determinations

2017-08-25 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 24 Aug 2017 21:52:00 +0200 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

[PATCH 04/14] vme: Adjust 48 checks for null pointers

2017-08-25 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 24 Aug 2017 22:24:38 +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

[PATCH 05/14] vme: Return directly in two functions

2017-08-25 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 24 Aug 2017 22:32:14 +0200 Return directly without using an intermediate local variable in these functions. Signed-off-by: Markus Elfring --- drivers/vme/vme.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/vme/vme.c b

[PATCH 06/14] vme: fake: Delete an error message for a failed memory allocation in fake_init()

2017-08-25 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 25 Aug 2017 09:31:46 +0200 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/vme/bridges/vme_fake.c | 1 - 1 file changed, 1 deletion

[PATCH 07/14] vme: fake: Improve five size determinations in fake_init()

2017-08-25 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 25 Aug 2017 09:46:13 +0200 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

[PATCH 08/14] vme: fake: Adjust 11 checks for null pointers

2017-08-25 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 25 Aug 2017 10:01:16 +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

[PATCH 09/14] vme: ca91cx42: Delete eight error messages for a failed memory allocation

2017-08-25 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 25 Aug 2017 10:20:03 +0200 Omit extra messages for a memory allocation failure in these functions. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/vme/bridges/vme_ca91cx42.c | 16 1 file

[PATCH 10/14] vme: ca91cx42: Improve 12 size determinations

2017-08-25 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 25 Aug 2017 10:56:41 +0200 Replace the specification of data structures by variable references as the parameter for the operator "sizeof" to make the corresponding size determination a bit safer according to the Linux coding style convention. Sig

[PATCH 11/14] vme: ca91cx42: Adjust 14 checks for null pointers

2017-08-25 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 25 Aug 2017 11:01:29 +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

[PATCH 12/14] vme: tsi148: Delete nine error messages for a failed memory allocation

2017-08-25 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 25 Aug 2017 11:10:07 +0200 Omit extra messages for a memory allocation failure in these functions. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/vme/bridges/vme_tsi148.c | 18 -- 1 file

[PATCH 13/14] vme: tsi148: Improve 17 size determinations

2017-08-25 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 25 Aug 2017 11:55:03 +0200 Replace the specification of data structures by variable references as the parameter for the operator "sizeof" to make the corresponding size determination a bit safer according to the Linux coding style convention. Sig

[PATCH 14/14] vme: tsi148: Adjust 14 checks for null pointers

2017-08-25 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 25 Aug 2017 12:00:17 +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

Re: [PATCH 13/14] vme: tsi148: Improve 17 size determinations

2017-08-26 Thread SF Markus Elfring
>> @@ -2363,5 +2364,5 @@ static int tsi148_probe(struct pci_dev *pdev, const >> struct pci_device_id *id) >> master_num--; >> >> tsi148_device->flush_image = >> -kmalloc(sizeof(struct vme_master_resource), GFP_KERNEL); >> +kmalloc

[PATCH] staging: fsl-mc: Delete an error message for a failed memory allocation in fsl_mc_resource_pool_add_device()

2017-08-26 Thread SF Markus Elfring
From: Markus Elfring Date: Sat, 26 Aug 2017 18:23:52 +0200 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/staging/fsl-mc/bus/fsl-mc-allocator.c | 2 -- 1 file changed

[PATCH] staging: netlogic: Delete an error message for a failed memory allocation in xlr_config_spill()

2017-08-26 Thread SF Markus Elfring
From: Markus Elfring Date: Sat, 26 Aug 2017 18:44:12 +0200 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/staging/netlogic/xlr_net.c | 4 +--- 1 file changed, 1

Re: [PATCH 13/14] vme: tsi148: Improve 17 size determinations

2017-08-30 Thread SF Markus Elfring
@@ -2363,5 +2364,5 @@ static int tsi148_probe(struct pci_dev *pdev, const struct pci_device_id *id) master_num--; tsi148_device->flush_image = -kmalloc(sizeof(struct vme_master_resource), GFP_KERNEL); +

[PATCH] staging/rdma/hfi1: Delete unnecessary checks before two function calls

2015-11-05 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 5 Nov 2015 08:41:00 +0100 The functions "sc_return_credits" and "vfree" perform also input parameter validation. Thus the tests around their calls are not needed. This issue was detected by using the Coccinelle software. Signed-of

[PATCH 1/3] staging: lustre: Delete unnecessary checks before two function calls

2015-11-05 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 5 Nov 2015 10:18:45 +0100 The functions kobject_put() and kset_unregister() test whether their argument is NULL and then return immediately. Thus the tests around their calls are not needed. This issue was detected by using the Coccinelle software. Signed-off-by

[PATCH 2/3] staging: lustre: Delete an unnecessary variable initialisation in class_register_type()

2015-11-05 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 5 Nov 2015 10:55:16 +0100 The variable "rc" will be eventually set to an error return code in the class_register_type() function. Thus let us omit the explicit initialisation at the beginning. Signed-off-by: Markus Elfring --- drivers/staging/lus

[PATCH 3/3] staging: lustre: Less function calls in class_register_type() after error detection

2015-11-05 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 5 Nov 2015 12:48:58 +0100 The functions "kfree" and "kobject_put" were called in a few cases by the function "class_register_type" during error handling even if the passed variable contained a null pointer. This implementation d

[PATCH 0/3] staging: lustre: Deletion of some unnecessary checks

2015-11-05 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 5 Nov 2015 13:03:33 +0100 Further update suggestions were taken into account after a patch was applied from static source code analysis. Markus Elfring (3): Delete unnecessary checks before two function calls Delete an unnecessary variable initialisation in

[PATCH] staging: most: Delete an unnecessary check before the function call "module_put"

2015-11-05 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 5 Nov 2015 14:34:43 +0100 The module_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

Re: staging: most: Delete an unnecessary check before the function call "module_put"

2015-11-05 Thread SF Markus Elfring
> Please stop sending these patches for drivers/staging. Will further contributors take another look at similar update suggestions? > You are welcome to send them for other subsystems Thanks for this suggestion. > which I don't care about. I am curious if other software developers will give

Re: [PATCH 1/1] staging - rtl8188eu: Deletion of unnecessary checks before three function calls

2014-10-23 Thread SF Markus Elfring
>From 45970693cad6c12da2d5ac7da3d2bd7a566170d7 Mon Sep 17 00:00:00 2001 From: Markus Elfring Date: Thu, 23 Oct 2014 20:55:13 +0200 Subject: [PATCH] staging - rtl8188eu: Deletion of unnecessary checks before three function calls The functions kfree(), rtw_free_netdev() and vfree() test whet

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

2014-10-31 Thread SF Markus Elfring
The functions kfree(), rtw_free_netdev() and vfree() test whether their argument is NULL and then return 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/staging/rtl8188eu/core

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

2014-10-31 Thread SF Markus Elfring
>> The functions kfree(), rtw_free_netdev() and vfree() test whether their >> argument is NULL and then return immediately. Thus the test around the call >> is not needed. >> >> This issue was detected by using the Coccinelle software. >> >> Signed-

Re: [PATCH 00/39] drop null test before destroy functions

2015-09-14 Thread SF Markus Elfring
> Recent commits to kernel/git/torvalds/linux.git have made the following > functions able to tolerate NULL arguments: > > kmem_cache_destroy (commit 3942d29918522) > mempool_destroy (commit 4e3ca3e033d1) > dma_pool_destroy (commit 44d7175da6ea) How do you think about to extend an other SmPL scrip

[PATCH] hyperv/netvsc: Delete two error messages for a failed memory allocation in netvsc_init_buf()

2018-01-07 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 7 Jan 2018 21:03:26 +0100 Omit extra messages for a memory allocation failure in this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/net/hyperv/netvsc.c | 5 - 1 file changed, 5 deletions

Re: hyperv/netvsc: Delete two error messages for a failed memory allocation in netvsc_init_buf()

2018-01-08 Thread SF Markus Elfring
> These messages are not displayed anywhere else: > "unable to allocate receive buffer of size %u\n" > "unable to allocate send buffer of size %u\n", > > After set ret = -ENOMEM; and cleanup, we won't know which buffer allocation > failed without the error message. Do you notice a Linux allocati

Re: hyperv/netvsc: Delete two error messages for a failed memory allocation in netvsc_init_buf()

2018-01-15 Thread SF Markus Elfring
> These messages are not displayed anywhere else: > "unable to allocate receive buffer of size %u\n" > "unable to allocate send buffer of size %u\n", > > After set ret = -ENOMEM; and cleanup, we won't know which buffer allocation > failed without the error message. How do you think about to achi

<    1   2   3