>> 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
>> 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
>
>> 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.
>
>> 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
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
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
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
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
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
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
>> 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
___
> 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
> 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
> 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
> 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
>> 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
> 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
> 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
> 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
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
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
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
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
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
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 ++-
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
> 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
> 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
>> * 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
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
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
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.
*
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
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
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
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
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
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
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
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
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
-
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
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:
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
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
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
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
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
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
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
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
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
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
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
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
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/
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
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
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 +++--
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
>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
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(
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 -
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
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
>> 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
>>> @@ -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
>>> @@ -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
> > 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
> 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
> 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,
> +
>> @@ -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
>> * 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
___
> 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
>> 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
>> 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
>> 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
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
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
---
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
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
>> 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
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
>> -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
> 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
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"
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
---
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
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
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
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
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
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
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(
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
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(+)
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
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
> 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
> 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);
>
101 - 200 of 255 matches
Mail list logo