[PATCH] ibmvnic: Use -EBUSY in __ibmvnic_reset()

2024-04-19 Thread Markus Elfring
From: Markus Elfring Date: Fri, 19 Apr 2024 15:46:17 +0200 Add a minus sign before the error code “EBUSY” so that a negative value will be used as in other cases. This issue was transformed by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/net/ethernet/ibm/ibmvnic.c

Re: [0/2] powerpc/powernv/vas: Adjustments for map_paste_region()?

2024-04-16 Thread Markus Elfring
> Looking at that function, I however see a missing region release when > ioremap_cache() fails. Under which circumstances will the exception handling be completed also for the implementation of the function “map_paste_region”?

Re: [0/2] powerpc/powernv/vas: Adjustments for two function implementations

2024-04-16 Thread Markus Elfring
So Coccinelle should be fixed if it reports an error for that. >>> >>> Redundant function calls can occasionally be avoided accordingly, >>> can't they? >> >> Sure they can, but is that worth it here ? > > Coccinelle does what the developer of the semantic patch tells it to do. > It doesn't

Re: [0/2] powerpc/powernv/vas: Adjustments for two function implementations

2024-04-16 Thread Markus Elfring
> This is explicit in Kernel documentation: > > /** > * kfree - free previously allocated memory > * @object: pointer returned by kmalloc() or kmem_cache_alloc() > * > * If @object is NULL, no operation is performed. > */ > > That's exactly the same behaviour as free() in libc. > > So

Re: [0/2] powerpc/powernv/vas: Adjustments for two function implementations

2024-04-16 Thread Markus Elfring
>>> One function call less in vas_window_alloc() after error detection >> >> https://patchwork.ozlabs.org/project/linuxppc-dev/patch/1f1c21cf-c34c-418c-b00c-8e6474f12...@web.de/ > > It introduced a new goto and label to avoid a kfree(NULL) call, but > kfree() explicitly accepts NULL and handles

Re: [0/2] powerpc/powernv/vas: Adjustments for two function implementations

2024-04-15 Thread Markus Elfring
> A few update suggestions were taken into account > from static source code analysis. > > Markus Elfring (2): I would appreciate a bit more information about the reasons why this patch series was rejected. > One function call less in vas_window_alloc() after error d

Re: [PATCH] KVM: PPC: code cleanup for kvmppc_book3s_irqprio_deliver

2024-01-24 Thread Markus Elfring
> If there are no plans to enable this part code in the future, Will the word combination “code part” become preferred for a subsequent change description? > we can remove this dead code. And omit another blank line accordingly? Regards, Markus

Re: [PATCH v2 0/4] powerpc/4xx: Adjustments for four function implementations

2024-01-05 Thread Markus Elfring
> Date: Sat, 25 Mar 2023 16:10:23 +0100 > > Some update suggestions were taken into account > from static source code analysis. > > Markus Elfring (4): > Fix exception handling in ppc4xx_pciex_port_setup_hose() > Fix exception handling in ppc4xx_probe_pcix_bridge() &g

Re: [PATCH resent v2 0/2] powerpc/pseries: Fixes for exception handling in pSeries_reconfig_add_node()

2024-01-05 Thread Markus Elfring
> Date: Tue, 21 Mar 2023 11:26:32 +0100 > > A few update suggestions were taken into account > from static source code analysis. > > Markus Elfring (2): > Do not pass an error pointer to of_node_put() > Fix exception handling > > arch/powerpc/pla

[PATCH 2/2] powerpc/powernv/vas: Return directly after a failed kasprintf() in map_paste_region()

2023-12-23 Thread Markus Elfring
From: Markus Elfring Date: Sat, 23 Dec 2023 19:48:09 +0100 Return directly after a call of the function “kasprintf” failed at the beginning. Signed-off-by: Markus Elfring --- arch/powerpc/platforms/powernv/vas-window.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch

[PATCH 1/2] powerpc/powernv/vas: One function call less in vas_window_alloc() after error detection

2023-12-23 Thread Markus Elfring
From: Markus Elfring Date: Sat, 23 Dec 2023 19:35:13 +0100 The kfree() function was called in one case by the vas_window_alloc() function during error handling even if the passed variable contained a null pointer. This issue was detected by using the Coccinelle software. Thus use another label

[PATCH 0/2] powerpc/powernv/vas: Adjustments for two function implementations

2023-12-23 Thread Markus Elfring
From: Markus Elfring Date: Sat, 23 Dec 2023 20:02:02 +0100 A few update suggestions were taken into account from static source code analysis. Markus Elfring (2): One function call less in vas_window_alloc() after error detection Return directly after a failed kasprintf() in map_paste_region

Re: [v3 1/2] PCI: layerscape: Add support for Link down notification

2023-07-19 Thread Markus Elfring
> Cover letter just annoise people here. How do you think about advices from another information source? See also: https://kernelnewbies.org/PatchSeries Regards, Markus

Re: [PATCH v3 1/2] PCI: layerscape: Add support for Link down notification

2023-07-19 Thread Markus Elfring
> Add support to pass … Why did you omit a cover letter for the discussed patch series once more? Do you care for consequences according to message threading? Regards, Markus

Re: [PATCH 2/2] PCI: layerscape: Add the workaround for lost link capablities during reset

2023-07-19 Thread Markus Elfring
> A workaround for the issue where … Would you like to avoid a typo in the subject for the final commit message? Will a cover letter become helpful also for the presented small patch series? Regards, Markus

[PATCH v2 4/4] powerpc/4xx: Delete unnecessary variable initialisations in four functions

2023-03-25 Thread Markus Elfring
Date: Sat, 25 Mar 2023 16:00:36 +0100 Some local variables will be set to an appropriate value before usage. Thus omit explicit initialisations at the beginning of these functions. Signed-off-by: Markus Elfring --- arch/powerpc/platforms/4xx/pci.c | 14 +++--- 1 file changed, 7

[PATCH v2 3/4] powerpc/4xx: Fix exception handling in ppc4xx_probe_pci_bridge()

2023-03-25 Thread Markus Elfring
was detected by using the Coccinelle software. Fixes: c839e0eff500af03de65e560c2e21c3831586e6e ("[POWERPC] 4xx: PLB to PCI 2.x support") Signed-off-by: Markus Elfring --- V3: A closing parenthesis (which was overlooked somehow) was preserved for an if statement. arch/powerpc/platforms

[PATCH v2 2/4] powerpc/4xx: Fix exception handling in ppc4xx_probe_pcix_bridge()

2023-03-25 Thread Markus Elfring
was detected by using the Coccinelle software. Fixes: 5738ec6d00b7abbcd4cd342af83fd18d192b0979 ("[POWERPC] 4xx: PLB to PCI-X support") Signed-off-by: Markus Elfring --- arch/powerpc/platforms/4xx/pci.c | 18 +++--- 1 file changed, 7 insertions(+), 11 deletions(-) diff --

[PATCH v2 1/4] powerpc/4xx: Fix exception handling in ppc4xx_pciex_port_setup_hose()

2023-03-25 Thread Markus Elfring
. Fixes: a2d2e1ec07a80946cbe812dc8c73291cad8214b2 ("[POWERPC] 4xx: PLB to PCI Express support") Fixes: 80daac3f86d4f5aafc9d3e79addb90fa118244e2 ("[POWERPC] 4xx: Add endpoint support to 4xx PCIe driver") Signed-off-by: Markus Elfring --- arch/powerpc/platforms/4xx/pci.c | 19 +++

[PATCH v2 0/4] powerpc/4xx: Adjustments for four function implementations

2023-03-25 Thread Markus Elfring
Date: Sat, 25 Mar 2023 16:10:23 +0100 Some update suggestions were taken into account from static source code analysis. Markus Elfring (4): Fix exception handling in ppc4xx_pciex_port_setup_hose() Fix exception handling in ppc4xx_probe_pcix_bridge() Fix exception handling

[PATCH resent v2 2/2] powerpc/pseries: Fix exception handling in pSeries_reconfig_add_node()

2023-03-25 Thread Markus Elfring
. Fixes: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 ("Linux-2.6.12-rc2") Signed-off-by: Markus Elfring --- V2: This update step was based on a previous change. arch/powerpc/platforms/pseries/reconfig.c | 23 --- 1 file changed, 12 insertions(+), 11 deletions(-) diff --

[PATCH resent v2 1/2] powerpc/pseries: Do not pass an error pointer to of_node_put() in pSeries_reconfig_add_node()

2023-03-25 Thread Markus Elfring
/ Reported-by: Nathan Lynch Fixes: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 ("Linux-2.6.12-rc2") Signed-off-by: Markus Elfring --- V2: This update step was added according to another change request. arch/powerpc/platforms/pseries/reconfig.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletio

[PATCH resent v2 0/2] powerpc/pseries: Fixes for exception handling in pSeries_reconfig_add_node()

2023-03-25 Thread Markus Elfring
Date: Tue, 21 Mar 2023 11:26:32 +0100 A few update suggestions were taken into account from static source code analysis. Markus Elfring (2): Do not pass an error pointer to of_node_put() Fix exception handling arch/powerpc/platforms/pseries/reconfig.c | 26 --- 1 file

[PATCH v2 2/2] powerpc/pseries: Fix exception handling in pSeries_reconfig_add_node()

2023-03-21 Thread Markus Elfring
. Fixes: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 ("Linux-2.6.12-rc2") Signed-off-by: Markus Elfring --- V2: This update step was based on a previous change.  arch/powerpc/platforms/pseries/reconfig.c | 23 ---  1 file changed, 12 insertions(+), 11 deletions(-) diff --

[PATCH v2 1/2] powerpc/pseries: Do not pass an error pointer to of_node_put() in pSeries_reconfig_add_node()

2023-03-21 Thread Markus Elfring
/ Reported-by: Nathan Lynch Fixes: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 ("Linux-2.6.12-rc2") Signed-off-by: Markus Elfring --- V2: This update step was added according to another change request.  arch/powerpc/platforms/pseries/reconfig.c | 3 ++-  1 file changed, 2 insertions(+), 1 deletio

[PATCH v2 0/2] powerpc/pseries: Fixes for exception handling in pSeries_reconfig_add_node()

2023-03-21 Thread Markus Elfring
Date: Tue, 21 Mar 2023 11:26:32 +0100 A few update suggestions were taken into account from static source code analysis. Markus Elfring (2):   Do not pass an error pointer to of_node_put()   Fix exception handling  arch/powerpc/platforms/pseries/reconfig.c | 26 ---  1 file

Re: powerpc/pseries: Fix exception handling in pSeries_reconfig_add_node()

2023-03-21 Thread Markus Elfring
> It's been brought to my attention that there is in fact a crash bug > in this function's error path: How do you think about to mention any other contributors for attribution according to this issue? > np->parent can be an encoded error value, we don't want to of_node_put() that. Will the

Re: powerpc/pseries: Fix exception handling in pSeries_reconfig_add_node()

2023-03-18 Thread Markus Elfring
The label “out_err” was used to jump to another pointer check despite of the detail in the implementation of the function “pSeries_reconfig_add_node” that it was determined already that the corresponding variable contained a null pointer (because of a failed function call

Re: powerpc/pseries: Fix exception handling in pSeries_reconfig_add_node()

2023-03-17 Thread Markus Elfring
>> The label “out_err” was used to jump to another pointer check despite of >> the detail in the implementation of the function “pSeries_reconfig_add_node” >> that it was determined already that the corresponding variable contained >> a null pointer (because of a failed function call in two

[PATCH] powerpc/pseries: Fix exception handling in pSeries_reconfig_add_node()

2023-03-17 Thread Markus Elfring
. Fixes: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac ("Linux-2.6.12-rc2") Signed-off-by: Markus Elfring ---  arch/powerpc/platforms/pseries/reconfig.c | 26 ---  1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/arch/powerpc/platforms/pseries/reconfig.c b/ar

[PATCH 4/4] powerpc/4xx: Delete unnecessary variable initialisations in four functions

2023-03-16 Thread Markus Elfring
Date: Thu, 16 Mar 2023 19:56:21 +0100 Some local variables will be set to an appropriate value before usage. Thus omit explicit initialisations at the beginning of these functions. Signed-off-by: Markus Elfring ---  arch/powerpc/platforms/4xx/pci.c | 14 +++---  1 file changed, 7

[PATCH 3/4] powerpc/4xx: Fix exception handling in ppc4xx_probe_pci_bridge()

2023-03-16 Thread Markus Elfring
was detected by using the Coccinelle software. Fixes: c839e0eff500af03de65e560c2e21c3831586e6e ("[POWERPC] 4xx: PLB to PCI 2.x support") Signed-off-by: Markus Elfring ---  arch/powerpc/platforms/4xx/pci.c | 18 +++---  1 file changed, 7 insertions(+), 11 deletions(-) diff --

[PATCH 2/4] powerpc/4xx: Fix exception handling in ppc4xx_probe_pcix_bridge()

2023-03-16 Thread Markus Elfring
was detected by using the Coccinelle software. Fixes: 5738ec6d00b7abbcd4cd342af83fd18d192b0979 ("[POWERPC] 4xx: PLB to PCI-X support") Signed-off-by: Markus Elfring ---  arch/powerpc/platforms/4xx/pci.c | 18 +++---  1 file changed, 7 insertions(+), 11 deletions(-) diff --

[PATCH 0/4] powerpc/4xx: Adjustments for four function implementations

2023-03-16 Thread Markus Elfring
Date: Thu, 16 Mar 2023 20:15:43 +0100 Some update suggestions were taken into account from static source code analysis. Markus Elfring (4):   Fix exception handling in ppc4xx_pciex_port_setup_hose()   Fix exception handling in ppc4xx_probe_pcix_bridge()   Fix exception handling

[PATCH 1/4] powerpc/4xx: Fix exception handling in ppc4xx_pciex_port_setup_hose()

2023-03-16 Thread Markus Elfring
: a2d2e1ec07a80946cbe812dc8c73291cad8214b2 ("[POWERPC] 4xx: PLB to PCI Express support") Fixes: 80daac3f86d4f5aafc9d3e79addb90fa118244e2 ("[POWERPC] 4xx: Add endpoint support to 4xx PCIe driver") Signed-off-by: Markus Elfring ---  arch/powerpc/platforms/4xx/pci.c | 19 +++

Re: [PATCH] cxl: Reduce scope for the variable “mm” in cxllib_get_PE_attributes()

2020-12-10 Thread Markus Elfring
>> A local variable was used only within an if branch. >> Thus move the definition for the variable “mm” into the corresponding >> code block. > > You did nothing here except add a checkpatch warning :( elfring@Sonne:~/Projekte/Linux/next-patched> scripts/checkpatch.pl

[PATCH] cxl: Reduce scope for the variable “mm” in cxllib_get_PE_attributes()

2020-12-10 Thread Markus Elfring
From: Markus Elfring Date: Thu, 10 Dec 2020 14:14:07 +0100 A local variable was used only within an if branch. Thus move the definition for the variable “mm” into the corresponding code block. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers

Re: [PATCH] fsl: imx-audmix: Use devm_kcalloc() in imx_audmix_probe()

2020-09-16 Thread Markus Elfring
> A multiplication for the size determination of a memory allocation > indicated that an array data structure should be processed. > Thus use the corresponding function "devm_kcalloc". I find the previous patch subject inappropriate. Would you like to choose an alternative? Regards, Markus

Re: [v2 1/2] ASoC: fsl_mqs: Don't check clock is NULL before calling clk API

2020-06-23 Thread Markus Elfring
>>> if the parameter >>> is NULL, clk_prepare_enable and clk_disable_unprepare will >>> return immediately. >> >> The interpretation of these function implementations seems to be reasonable. >> Would you like to achieve any improvements

Re: [PATCH v2 1/2] ASoC: fsl_mqs: Don't check clock is NULL before calling clk API

2020-06-23 Thread Markus Elfring
> clk_prepare_enable and clk_disable_unprepare check the input > clock parameter in the beginning of the function, These functions call further functions which perform null pointer checks. > if the parameter > is NULL,

Re: [PATCH v2 1/2] ASoC: fsl_mqs: Don't check clock is NULL before calling clk API

2020-06-23 Thread Markus Elfring
> In-Reply-To: I guess that it should be sufficient to specify such a field once for the header information. > Because clk_prepare_enable and clk_disable_unprepare should > check input clock parameter is NULL or not internally, I find this change description unclear. > then we don't need to

Re: [PATCH] ASoC: fsl_mqs: Fix unchecked return value for clk_prepare_enable

2020-06-22 Thread Markus Elfring
> Fix unchecked return value for clk_prepare_enable. > > And because clk_prepare_enable and clk_disable_unprepare should > check input clock parameter is NULL or not, then we don't need > to check it before calling the function. I propose to split the adjustment of two function implementations

Re: cxl: Fix kobject memory leak in cxl_sysfs_afu_new_cr()

2020-06-03 Thread Markus Elfring
> Okay, so I don’t have to send the v2 patch. It will become more interesting under which circumstances the presented software development concerns will be taken better into account. Regards, Markus

Re: [PATCH] cxl: Fix kobject memory leak in cxl_sysfs_afu_new_cr()

2020-06-03 Thread Markus Elfring
> Please note that you are responding to someone that a lot of kernel > developers and maintainers have blacklisted as being very annoying I can understand that you can occasionally become annoyed. > and not helpful at all. I got the impression that some contributors (including you) found also

Re: cxl: Fix kobject memory leak in cxl_sysfs_afu_new_cr()

2020-06-02 Thread Markus Elfring
>>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/coding-style.rst?id=f359287765c04711ff54fbd11645271d8e5ff763#n465 >> I just used the original author's label, should I replace all his labels >> like'err','err1' with reasonable one. > > No. Do you

Re: [PATCH] cxl: Fix kobject memory leak in cxl_sysfs_afu_new_cr()

2020-06-02 Thread Markus Elfring
> Fix it by adding a call to kobject_put() in the error path of > kobject_init_and_add(). Thanks for another completion of the exception handling. Would an other patch subject be a bit nicer? … > +++ b/drivers/misc/cxl/sysfs.c > @@ -624,7 +624,7 @@ static struct afu_config_record >

Re: [PATCH] powerpc/nvram: Replace kmalloc with kzalloc in the error message

2020-06-01 Thread Markus Elfring
>>> Please just remove the message instead, it's a tiny allocation that's >>> unlikely to ever fail, and the caller will print an error anyway. >> >> How do you think about to take another look at a previous update suggestion >> like the following? >> >> powerpc/nvram: Delete three error messages

Re: [PATCH] powerpc/nvram: Replace kmalloc with kzalloc in the error message

2020-05-29 Thread Markus Elfring
> Please just remove the message instead, it's a tiny allocation that's > unlikely to ever fail, and the caller will print an error anyway. How do you think about to take another look at a previous update suggestion like the following? powerpc/nvram: Delete three error messages for a failed

Re: [PATCH v2 9/9] hvc_console: Allow backends to set I/O buffer size

2020-05-10 Thread Markus Elfring
> Typical usage in the backend source file would be: Is there any information missing in this change description accidentally? Regards, Markus

Re: [PATCH v2 5/9] net/ps3_gelic_net: Remove duplicate error message

2020-05-10 Thread Markus Elfring
> Remove an extra message for a memory allocation failure in > function gelic_descr_prepare_rx(). Will another background information be relevant for the final commit message? ps3_gelic_net: Delete an error message for a failed memory allocation in gelic_descr_prepare_rx()

Re: [PATCH v2 4/9] drivers/ps3: Remove duplicate error messages

2020-05-10 Thread Markus Elfring
> Remove duplicate memory allocation failure error messages. Will another background information be relevant for the final commit message? ps3: Delete an error message for a failed memory allocation in two functions

Re: [PATCH] tty: hvc: Fix data abort due to race in hvc_open

2020-04-28 Thread Markus Elfring
> Hence, serialize hvc_open and check if tty->private_data is NULL before > proceeding ahead. How do you think about to add the tag “Fixes” because of adjustments for the data synchronisation? … > +++ b/drivers/tty/hvc/hvc_console.c … @@ -384,6 +394,8 @@ static int hvc_open(struct tty_struct

Re: [PATCH] ASoC: fsl_easrc: Check for null pointer before dereferencing “ctx” in fsl_easrc_hw_free()

2020-04-24 Thread Markus Elfring
> The patch 955ac624058f: "ASoC: fsl_easrc: Add EASRC ASoC CPU DAI > drivers" from Apr 16, 2020, leads to the following Smatch complaint: > > sound/soc/fsl/fsl_easrc.c:1529 fsl_easrc_hw_free() > warn: variable dereferenced before check 'ctx' (see line 1527) Please avoid a typo in the final commit

Re: [PATCH v3 00/50] Add log level to show_stack()

2020-04-19 Thread Markus Elfring
> Changes to v3: > - Collected more architectual Acks and Reviewed-by * I suggest to avoid a typo in this description. * Please separate the tag “PATCH” from the version descriptor in the subject.

Re: usb: gadget: fsl: Fix a wrong judgment in fsl_udc_probe()

2020-04-10 Thread Markus Elfring
> Hardware experiments show that the negative return value is not just > "-EPROBE_DEFER". How much will this specific error code influence our understanding of the discussed software situation? >>> +    ret = udc_controller->irq ? : -ENODEV; >> Will it be clearer to specify values for all

Re: [PATCH] usb: gadget: fsl: Fix a wrong judgment in fsl_udc_probe()

2020-04-10 Thread Markus Elfring
> If the function "platform_get_irq()" failed, the negative value > returned will not be detected here, including "-EPROBE_DEFER", I suggest to adjust this change description. Wording alternative: The negative return value (which could eventually be “-EPROBE_DEFER”) will not be detected here

Re: usb: gadget: fsl_udc_core: Checking for a failed platform_get_irq() call in fsl_udc_probe()

2020-04-09 Thread Markus Elfring
>> Would you like to reconsider the shown condition check? > > Thanks for the finding. This is truly a software issue that need to > be fixed. I was unsure if I noticed another programming mistake. > Would you submit a patch for it Do other contributors know the affected software module

usb: gadget: fsl_udc_core: Checking for a failed platform_get_irq() call in fsl_udc_probe()

2020-04-08 Thread Markus Elfring
Hello, I have taken another look at the implementation of the function “fsl_udc_probe”. A software analysis approach points the following source code out for further development considerations. https://elixir.bootlin.com/linux/v5.6.2/source/drivers/usb/gadget/udc/fsl_udc_core.c#L2443

Re: [PATCH v5 1/2] powerpc/powernv: Return directly after a failed of_property_read_u64_array() in opal_add_one_export()

2020-04-06 Thread Markus Elfring
> We don't need to go to the labal of out … Please avoid a typo for this change description. > fails, as there is nothing to do. Just return. I suggest to reconsider also this wording. Return directly after a call of the function “of_property_read_u64_array” failed at the beginning. >

Re: [PATCH v5 2/2] powerpc/powernv: Add NULL check after kzalloc in opal_add_one_export

2020-04-06 Thread Markus Elfring
> Here needs a NULL check, as kzalloc may fail returning NULL. > > Issue was found by coccinelle. * Do you really try to ignore (my) specific patch review comments (for a moment)? https://lore.kernel.org/linuxppc-dev/b7d64d4a-74dd-ee21-db7b-018070f12...@web.de/

Re: [PATCH v5 1/2] powerpc/powernv: Remove two unnecessary variable initialisations in opal_add_one_export()

2020-04-06 Thread Markus Elfring
> And we can remove the redundant assignments to attr and name. How do you think about a wording like the following? Two local variables will eventually be set to appropriate pointers a bit later. Thus omit their explicit initialisation at the beginning. Regards, Markus

Re: [PATCH v4] powerpc/powernv: add NULL check after kzalloc in opal_add_one_export

2020-04-06 Thread Markus Elfring
>>> Here needs a NULL check as kzalloc may fail returning NULL. I find this wording potentially confusing. * Such function calls will usually succeed to return a pointer. * The desired memory allocation can fail. * Please choose an imperative wording for the change description. >>> Issue was

Re: [PATCH v3] powerpc/powernv: add NULL check after kzalloc in opal_add_one_export

2020-04-06 Thread Markus Elfring
Here needs a NULL check. >> quite obvious? I suggest to consider another fine-tuning for the wording also around such “obvious” programming items. >>> I find this change description questionable >>> (despite of a reasonable patch subject). I got further development concerns.

Re: [PATCH] KVM: PPC: Book3S HV: Remove NULL check before kfree

2020-04-05 Thread Markus Elfring
> NULL check before kfree is unnecessary, so remove it. Would you like to take similar update suggestions into account? * 2019-09-04 KVM: PPC: Book3S HV: Delete an unnecessary check before kfree() in __kvmhv_nested_page_fault() * [-next] KVM: PPC: Book3S HV: remove redundant NULL check

Re: [PATCH v3] powerpc/powernv: add NULL check after kzalloc in opal_add_one_export

2020-04-05 Thread Markus Elfring
> Here needs a NULL check. I find this change description questionable (despite of a reasonable patch subject). > Issue found by coccinelle. Would an information like “Generated by: scripts/coccinelle/null/kmerr.cocci” be nicer? > --- Will a patch change log be helpful here? Regards,

Re: [PATCH 1/9] powerpc/ps3: Remove duplicate error messages

2020-03-28 Thread Markus Elfring
> Remove duplicate memory allocation failure error messages. A single message can be omitted here. https://lkml.org/lkml/2017/10/17/870 https://lore.kernel.org/patchwork/patch/842101/ https://lore.kernel.org/linuxppc-dev/e16c8b7d-de3a-6c96-9af4-dd0551cca...@users.sourceforge.net/ Will this

[PATCH] powerpc/papr_scm: Delete unnecessary assignment for the field “owner”

2019-11-03 Thread Markus Elfring
From: Markus Elfring Date: Sun, 3 Nov 2019 13:23:13 +0100 The field “owner” is set by the core. Thus delete an unneeded initialisation. Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci Signed-off-by: Markus Elfring --- arch/powerpc/platforms/pseries/papr_scm.c | 1 - 1 file

[PATCH] KVM: PPC: Book3S HV: Delete an unnecessary check before kfree() in __kvmhv_nested_page_fault()

2019-09-04 Thread Markus Elfring
From: Markus Elfring Date: Wed, 4 Sep 2019 11:00:20 +0200 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 --- arch

[PATCH 2/2] powerpc/pseries: Delete an error message for a failed string duplication in dlpar_store()

2019-08-27 Thread Markus Elfring
From: Markus Elfring Date: Tue, 27 Aug 2019 13:37:56 +0200 Omit an extra message for a memory allocation failure in this function. Signed-off-by: Markus Elfring --- arch/powerpc/platforms/pseries/dlpar.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/powerpc

[PATCH 1/2] powerpc/pseries: Delete an unnecessary kfree() call in dlpar_store()

2019-08-27 Thread Markus Elfring
From: Markus Elfring Date: Tue, 27 Aug 2019 13:34:02 +0200 A null pointer would be passed to a call of the function “kfree” immediately after a call of the function “kstrdup” failed at one place. Remove this superfluous function call. This issue was detected by using the Coccinelle software

[PATCH 0/2] PowerPC-pSeries: Adjustments for dlpar_store()

2019-08-27 Thread Markus Elfring
From: Markus Elfring Date: Tue, 27 Aug 2019 14:33:21 +0200 Two update suggestions were taken into account from static source code analysis. Markus Elfring (2): Delete an unnecessary kfree() call Delete an error message for a failed string duplication arch/powerpc/platforms/pseries/dlpar.c

[PATCH 2/2] powerpc/82xx: Use common error handling code in pq2ads_pci_init_irq()

2019-08-27 Thread Markus Elfring
From: Markus Elfring Date: Tue, 27 Aug 2019 09:19:32 +0200 Adjust jump targets so that a bit of exception handling can be better reused at the end of this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- arch/powerpc/platforms/82xx/pq2ads

[PATCH 0/2] powerpc/82xx: Adjustments for pq2ads_pci_init_irq()

2019-08-27 Thread Markus Elfring
From: Markus Elfring Date: Tue, 27 Aug 2019 10:16:32 +0200 Two update suggestions were taken into account from static source code analysis. Markus Elfring (2): Delete an unnecessary of_node_put() call Use common error handling code arch/powerpc/platforms/82xx/pq2ads-pci-pic.c | 13

[PATCH 1/2] powerpc/82xx: Delete an unnecessary of_node_put() call in pq2ads_pci_init_irq()

2019-08-27 Thread Markus Elfring
From: Markus Elfring Date: Tue, 27 Aug 2019 08:44:20 +0200 A null pointer would be passed to a call of the function “of_node_put” immediately after a call of the function “of_find_compatible_node” failed at one place. Remove this superfluous function call. This issue was detected by using

Re: Coccinelle: Checking of_node_put() calls with SmPL

2019-07-11 Thread Markus Elfring
> In my experience, when you start looking at these of_node_put things, > all sorts of strange things appear... How much will this situation influence the achievement of further improvements also for your software? Regards, Markus

Re: Coccinelle: Checking of_node_put() calls with SmPL

2019-07-11 Thread Markus Elfring
> 180 break; ---> Jump out of > the loop without releasing it The device node reference is released behind this for loop. > 183 if (!of_device_is_available(state_node)) { > 184 of_node_put(state_node);

Re: Coccinelle: Checking of_node_put() calls with SmPL

2019-07-10 Thread Markus Elfring
> we developed a coccinelle script to detect such problems. Would you find the implementation of the function “dt_init_idle_driver” suspicious according to discussed source code search patterns?

Re: [1/2] powerpc/83xx: fix use-after-free in mpc831x_usb_cfg()

2019-07-10 Thread Markus Elfring
> we developed a coccinelle script to detect such problems. How do you think about to give any attribution to this development software in your commit descriptions? > After a period of testing, we will send it to the LMKL mailing list later. I am also curious then on how this area will evolve

Re: [1/2] powerpc/83xx: fix use-after-free in mpc831x_usb_cfg()

2019-07-10 Thread Markus Elfring
> The immr_node variable is still being used after the of_node_put() call, > which may result in use-after-free. Was any known source code analysis tool involved to point such a questionable implementation detail out for further software development considerations? Regards, Markus

Re: [PATCH 0/2] fix use-after-free in mpc831x_usb_cfg() and do some cleanups

2019-07-09 Thread Markus Elfring
> According to Markus's suggestion, split it into two small patches: > https://lkml.org/lkml/2019/7/8/520 Thanks that you picked adjustment possibilities up from my feedback. https://lore.kernel.org/lkml/99840e11-e0e6-b3f4-e35b-56ef4ec39...@web.de/ Now I wonder why you omitted message

Re: [PATCH v3] cpufreq/pasemi: fix an use-after-free in pas_cpufreq_cpu_init()

2019-07-08 Thread Markus Elfring
> @@ -204,6 +205,7 @@ static int pas_cpufreq_cpu_init(struct cpufreq_policy > *policy) > out_unmap_sdcasr: > iounmap(sdcasr_mapbase); > out: > + of_node_put(cpu); I would find the usage of a jump label like “put_node” nicer at such a source code place. Regards, Markus

Re: powerpc/83xx: fix use-after-free on mpc831x_usb_cfg()

2019-07-08 Thread Markus Elfring
> The np variable is still being used after the of_node_put() call, > which may result in use-after-free. > We fix this issue by calling of_node_put() after the last usage. I imagine that this commit description can be improved a bit more (by mentioning the influence of “immr_node”?). How do

[PATCH] powerpc/setup: Adjust six seq_printf() calls in show_cpuinfo()

2019-07-02 Thread Markus Elfring
From: Markus Elfring Date: Tue, 2 Jul 2019 14:41:42 +0200 A bit of information should be put into a sequence. Thus improve the execution speed for this data output by better usage of corresponding functions. This issue was detected by using the Coccinelle software. Signed-off-by: Markus

Re: [PATCH 03/12] PowerPC-83xx: add missing of_node_put after of_device_is_available

2019-04-14 Thread Markus Elfring
> @@ -221,8 +221,10 @@ int mpc837x_usb_cfg(void) > int ret = 0; > > np = of_find_compatible_node(NULL, NULL, "fsl-usb2-dr"); > - if (!np || !of_device_is_available(np)) > + if (!np || !of_device_is_available(np)) { > + of_node_put(np); > return

Re: [PATCH 2/3] ASoC: fsl_utils: fix a leaked reference by adding missing of_node_put

2019-04-05 Thread Markus Elfring
> @@ -71,6 +71,7 @@ int fsl_asoc_get_dma_channel(struct device_node *ssi_np, > iprop = of_get_property(dma_np, "cell-index", NULL); > if (!iprop) { > of_node_put(dma_np); > + of_node_put(dma_channel_np); > return -EINVAL; > } >

Re: [1/5] powerpc/sparse: fix possible object reference leak

2019-04-05 Thread Markus Elfring
> @@ -131,7 +131,7 @@ static int drc_index_to_cpu(u32 drc_index) > > of_read_drc_info_cell(, , ); > if (strncmp(drc.drc_type, "CPU", 3)) > - goto err; > + goto err_of_node_put; > >

Re: [5/7] cpufreq/pasemi: Checking implementation of pas_cpufreq_cpu_init()

2019-04-03 Thread Markus Elfring
> @@ -146,6 +146,7 @@ static int pas_cpufreq_cpu_init(struct cpufreq_policy > *policy) > > cpu = of_get_cpu_node(policy->cpu, NULL); > > + of_node_put(cpu); > if (!cpu) > goto out; Can the statement “return -ENODEV” be nicer as exception handling in the if branch

Re: [PATCH -next v2 1/3] mm: treewide: remove unused address argument from pte_alloc functions

2018-11-03 Thread SF Markus Elfring
> … There is concern that … Does this wording need a small adjustment? > The changes were obtained by applying the following Coccinelle script. I would find it nicer if previous patch review comments will trigger further useful effects here.

Re: [PATCH v2 1/2] treewide: remove unused address argument from pte_alloc functions

2018-10-13 Thread SF Markus Elfring
>>> The changes were obtained by applying the following Coccinelle script. How do you think about to adjust the order of provided information in the commit description? 1. Update goals 2. Transformation implementation at the end >> "^(?:pte_alloc(?:_one(?:_kernel)?)?|__pte_alloc(?:_kernel)?)$";

Re: [PATCH v2 1/2] treewide: remove unused address argument from pte_alloc functions

2018-10-12 Thread SF Markus Elfring
> The changes were obtained by applying the following Coccinelle script. A bit of clarification happened for its implementation details. https://systeme.lip6.fr/pipermail/cocci/2018-October/005374.html I have taken also another look at the following SmPL code. > identifier fn =~ >

Re: [PATCH RFC 3/5] coccinelle: add xxxsetbitsXX converting spatch

2018-09-09 Thread SF Markus Elfring
How do you think about to add any more meta-data for this semantic patch script? * SPDX identifier * Copyright information * Confidence level https://bottest.wiki.kernel.org/coccicheck > +virtual context Further variables will be needed if you would like to use corresponding operation modes

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

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

[PATCH] crypto: nx-842: Delete an error message for a failed memory allocation in nx842_pseries_init()

2018-02-15 Thread SF Markus Elfring
From: Markus Elfring <elfr...@users.sourceforge.net> Date: Wed, 14 Feb 2018 17:05:13 +0100 Omit an extra message for a memory allocation failure in this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfr...@users.sourceforge.net>

[PATCH 2/2] macintosh/rack-meter: Improve a size determination in rackmeter_probe()

2018-01-16 Thread SF Markus Elfring
From: Markus Elfring <elfr...@users.sourceforge.net> Date: Tue, 16 Jan 2018 21:26:52 +0100 Replace the specification of a data structure by a pointer dereference as the parameter for the operator "sizeof" to make the corresponding size determination a bit safer according to the Li

[PATCH 1/2] macintosh/rack-meter: Delete an error message for a failed memory allocation in rackmeter_probe()

2018-01-16 Thread SF Markus Elfring
From: Markus Elfring <elfr...@users.sourceforge.net> Date: Tue, 16 Jan 2018 21:23:36 +0100 Omit an extra message for a memory allocation failure in this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfr...@users.sourceforge.net>

[PATCH 0/2] macintosh/rack-meter: Adjustments for rackmeter_probe()

2018-01-16 Thread SF Markus Elfring
From: Markus Elfring <elfr...@users.sourceforge.net> Date: Tue, 16 Jan 2018 21:36:56 +0100 Two update suggestions were taken into account from static source code analysis. Markus Elfring (2): Delete an error message for a failed memory allocation Improve a size determination d

[PATCH 4/5] powerpc/4xx: Improve a size determination in two functions

2018-01-11 Thread SF Markus Elfring
From: Markus Elfring <elfr...@users.sourceforge.net> Date: Thu, 11 Jan 2018 18:32:33 +0100 Replace the specification of data structures by pointer dereferences as the parameter for the operator "sizeof" to make the corresponding size determination a bit safer according to the Li

[PATCH 5/5] powerpc/4xx: Delete an unnecessary return statement in two functions

2018-01-11 Thread SF Markus Elfring
From: Markus Elfring <elfr...@users.sourceforge.net> Date: Thu, 11 Jan 2018 18:40:23 +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 the affected functi

[PATCH 3/5] powerpc/4xx: Delete an error message for a failed memory allocation in three functions

2018-01-11 Thread SF Markus Elfring
From: Markus Elfring <elfr...@users.sourceforge.net> Date: Thu, 11 Jan 2018 18:28:54 +0100 Omit an extra message for a memory allocation failure in these functions. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfr...@users.sourceforge.net&g

[PATCH 2/5] powerpc/4xx: Use seq_putc() in ocm_debugfs_show()

2018-01-11 Thread SF Markus Elfring
From: Markus Elfring <elfr...@users.sourceforge.net> Date: Thu, 11 Jan 2018 18:10:02 +0100 A single character (line break) 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: Mark

  1   2   3   >