[PATCH 1/1] tty-hvsi_lib: Deletion of an unnecessary check before the function call "tty_kref_put"

2014-11-21 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 21 Nov 2014 12:40:32 +0100 The tty_kref_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 --- driv

[PATCH 1/1] PowerPC-83xx: Deletion of an unnecessary check before the function call "of_node_put"

2014-11-22 Thread SF Markus Elfring
From: Markus Elfring Date: Sat, 22 Nov 2014 16:18:20 +0100 The of_node_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 --- arch/

[PATCH] ALSA: i2sbus: Deletion of unnecessary checks before the function call "release_and_free_resource"

2014-12-02 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 2 Dec 2014 22:50:24 +0100 The release_and_free_resource() 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 Elfrin

[PATCH 9/13] ALSA: i2sbus: Delete an unnecessary check before the function call "snd_pcm_suspend_all"

2015-01-04 Thread SF Markus Elfring
From: Markus Elfring Date: Sat, 3 Jan 2015 20:43:01 +0100 The snd_pcm_suspend_all() 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 11/13] ALSA: Deletion of checks before the function call "iounmap"

2015-01-04 Thread SF Markus Elfring
From: Markus Elfring Date: Sat, 3 Jan 2015 22:55:54 +0100 The iounmap() 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 --- sound/aoa/soundbus/i2sbus/core.c

Re: [PATCH] macintosh: Delete an unnecessary check before the function call "of_node_put"

2015-06-30 Thread SF Markus Elfring
Am 04.02.2015 um 21:36 schrieb SF Markus Elfring: > From: Markus Elfring > Date: Wed, 4 Feb 2015 21:32:27 +0100 > > The of_node_put() function tests whether its argument is NULL and then > returns immediately. Thus the test around the call is not needed. > > This issue was

[PATCH] PowerPC-PCI: Delete unnecessary checks before the function call "kfree"

2015-02-03 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 3 Feb 2015 13:55:53 +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 --- arch/powerpc

[PATCH] PowerPC-rheap: Delete an unnecessary check before the function call "kfree"

2015-02-03 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 3 Feb 2015 14:34:10 +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 --- arch/powerpc

[PATCH] macintosh: Delete an unnecessary check before the function call "of_node_put"

2015-02-04 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 4 Feb 2015 21:32:27 +0100 The of_node_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 --- driver

[PATCH] cxl: Delete an unnecessary check before the function call "kfree"

2015-11-06 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 6 Nov 2015 11:00:23 +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/misc

[POWERPC] bootwrapper: One check less in fsl_get_immr() after error detection

2015-12-14 Thread SF Markus Elfring
From: Markus Elfring Date: Mon, 14 Dec 2015 23:01:32 +0100 A status check was performed by the fsl_get_immr() function even if it was known already that a system setting did not fit to the expectations. This implementation detail could be improved by an adjustment for a jump label according to t

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 (b

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 =~ > "^(__pte_allo

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 -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. https://patchwork.kernel.org/patch/10637703/#22265203

[PATCH] powerpc/mm: Use seq_putc() in two functions

2017-05-07 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 7 May 2017 16:32:04 +0200 Two 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 --- arch/powerpc/mm/dump_hashpag

[PATCH] KVM: PPC: Book3S HV: Delete an error message for a failed memory allocation in kvmppc_allocate_hpt()

2017-10-05 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 5 Oct 2017 13:16:51 +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 --- arch/powerpc/kvm/book3s_64_mmu_hv.c | 1 - 1 file changed, 1 deletion(-

[PATCH 0/2] PowerPC-Cell OProfile: Adjustments for three function implementations

2017-10-05 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 5 Oct 2017 17:32:10 +0200 Two update suggestions were taken into account from static source code analysis. Markus Elfring (2): Delete an error message for a failed memory allocation in three functions Improve a size determination in two functions arch/powerp

[PATCH 1/2] powerpc/oprofile/cell: Delete an error message for a failed memory allocation in three functions

2017-10-05 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 5 Oct 2017 17:10:11 +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 --- arch/powerpc/oprofile/cell/spu_task_sync.c | 8 arch/powerpc/o

[PATCH 2/2] powerpc/oprofile/cell: Improve a size determination in two functions

2017-10-05 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 5 Oct 2017 17:18:33 +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 issue was detect

[PATCH] powerpc/perf/hv-24x7: Delete an error message for a failed memory allocation in create_events_from_catalog()

2017-10-05 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 5 Oct 2017 18:02:05 +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 --- arch/powerpc/perf/hv-24x7.c | 1 - 1 file changed, 1 deletion(-) diff

[PATCH 0/2] PowerPC-Cell platform: Adjustments for four function implementations

2017-10-05 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 5 Oct 2017 21:25:43 +0200 Two update suggestions were taken into account from static source code analysis. Markus Elfring (2): Delete an error message for a failed memory allocation in three functions Improve a size determination in three functions arch/powe

[PATCH 1/2] powerpc/platforms/cell: Delete an error message for a failed memory allocation in three functions

2017-10-05 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 5 Oct 2017 21:04:30 +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 --- arch/powerpc/platforms/cell/axon_msi.c | 5 + arch/powerpc/platfo

[PATCH 2/2] powerpc/platforms/cell: Improve a size determination in three functions

2017-10-05 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 5 Oct 2017 21:12:41 +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 issue was detect

[PATCH 0/2] Power Mac: Adjustments for five function implementations

2017-10-05 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 5 Oct 2017 22:48:22 +0200 Two update suggestions were taken into account from static source code analysis. Markus Elfring (2): Delete an error message for a failed memory allocation in kw_i2c_host_init() Improve a size determination in five functions arch/po

[PATCH 1/2] powermac: Delete an error message for a failed memory allocation in kw_i2c_host_init()

2017-10-05 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 5 Oct 2017 22:30:29 +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 --- arch/powerpc/platforms/powermac/low_i2c.c | 5 + 1 file changed, 1

[PATCH 2/2] powermac: Improve a size determination in five functions

2017-10-05 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 5 Oct 2017 22:40:39 +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 issue was detect

[PATCH 0/4] char-TPM: Adjustments for ten function implementations

2017-10-16 Thread SF Markus Elfring
From: Markus Elfring Date: Mon, 16 Oct 2017 19:12:34 +0200 A few update suggestions were taken into account from static source code analysis. Markus Elfring (4): Delete an error message for a failed memory allocation in tpm_ascii_bios_measurements_show() Delete an error message for a fai

[PATCH 1/4] char/tpm: Delete an error message for a failed memory allocation in tpm_ascii_bios_measurements_show()

2017-10-16 Thread SF Markus Elfring
From: Markus Elfring Date: Mon, 16 Oct 2017 17:43:55 +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/char/tpm/tpm1_eventlog.c | 5 + 1 file changed, 1 insertio

[PATCH 2/4] char/tpm: Delete an error message for a failed memory allocation in tpm_ibmvtpm_probe()

2017-10-16 Thread SF Markus Elfring
From: Markus Elfring Date: Mon, 16 Oct 2017 18:08:23 +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/char/tpm/tpm_ibmvtpm.c | 4 +--- 1 file changed, 1 insertion(+

[PATCH 3/4] char/tpm: Improve a size determination in nine functions

2017-10-16 Thread SF Markus Elfring
From: Markus Elfring Date: Mon, 16 Oct 2017 18:28:17 +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 issue was detec

[PATCH 4/4] char/tpm: Less checks in tpm_ibmvtpm_probe() after error detection

2017-10-16 Thread SF Markus Elfring
From: Markus Elfring Date: Mon, 16 Oct 2017 19:00:34 +0200 Two pointer checks could be repeated by the tpm_ibmvtpm_probe() function during error handling even if the relevant properties can be determined for the involved variables before by source code analysis. * Return directly after a call of

Re: [PATCH 0/4] char-TPM: Adjustments for ten function implementations

2017-10-16 Thread SF Markus Elfring
> A minor complaint: all commits are missing "Fixes:" tag. * Do you require it to be added to the commit messages? * Would you like to get a finer patch granularity then? * Do you find any more information missing? Regards, Markus

Re: [PATCH 0/4] char-TPM: Adjustments for ten function implementations

2017-10-17 Thread SF Markus Elfring
>> A minor complaint: all commits are missing "Fixes:" tag. > > None of these patches fix anything. It depends on the view which you prefer. > All are trivial changes without much of any impact. I find that they improve the affected software another bit. Other adjustments can be more noticeabl

Re: [PATCH 0/4] char-TPM: Adjustments for ten function implementations

2017-10-17 Thread SF Markus Elfring
> Fixes is only for bug fixes. These don't fix any bugs. How do you distinguish these in questionable source code from other error categories or software weaknesses? Regards, Markus

[PATCH 0/3] PowerPC-OPAL: Adjustments for some function implementations

2017-10-17 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 17 Oct 2017 13:45:54 +0200 Three update suggestions were taken into account from static source code analysis. Markus Elfring (3): Delete ten error messages for a failed memory allocation Improve 12 size determinations Fix a typo in a comment line of two file

[PATCH 1/3] powerpc-opal: Delete ten error messages for a failed memory allocation

2017-10-17 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 17 Oct 2017 12:21:40 +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 --- arch/powerpc/platforms/powernv/opal-async.c| 2 -- arch/power

[PATCH 2/3] powerpc-opal: Improve 12 size determinations

2017-10-17 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 17 Oct 2017 13:20:19 +0200 Replace the specification of data types 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. Signed-off-by: Markus Elfr

[PATCH 3/3] powerpc-opal: Fix a typo in a comment line of two file headers

2017-10-17 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 17 Oct 2017 13:31:42 +0200 Fix a word in these descriptions. Signed-off-by: Markus Elfring --- arch/powerpc/platforms/powernv/opal-hmi.c | 2 +- arch/powerpc/platforms/powernv/opal-memory-errors.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-

[PATCH 0/3] PowerNV-PCI: Adjustments for two function implementations

2017-10-17 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 17 Oct 2017 17:27:37 +0200 Three update suggestions were taken into account from static source code analysis. Markus Elfring (3): Delete an error message for a failed memory allocation in pnv_ioda_pick_m64_pe() Use common code in pnv_ioda_pick_m64_pe() Impr

[PATCH 1/3] powernv/pci: Delete an error message for a failed memory allocation in pnv_ioda_pick_m64_pe()

2017-10-17 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 17 Oct 2017 16:52:43 +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 --- arch/powerpc/platforms/powernv/pci-ioda.c | 5 + 1 file changed, 1

[PATCH 2/3] powernv/pci: Use common code in pnv_ioda_pick_m64_pe()

2017-10-17 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 17 Oct 2017 17:07:54 +0200 Add a jump target so that a bit of code can be better reused at the end of this function. Signed-off-by: Markus Elfring --- arch/powerpc/platforms/powernv/pci-ioda.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) dif

[PATCH 3/3] powernv/pci: Improve a size determination in pnv_pci_init_ioda_phb()

2017-10-17 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 17 Oct 2017 17:18:10 +0200 Replace the specification of a data structure by a pointer dereference as the parameter for the operator "sizeof" to make the corresponding size determination a bit safer according to the Linux coding style convention. This issue was det

Re: [PATCH 0/4] char-TPM: Adjustments for ten function implementations

2017-10-17 Thread SF Markus Elfring
>>> Fixes is only for bug fixes.  These don't fix any bugs. >> >> How do you distinguish these in questionable source code >> from other error categories or software weaknesses? > > A style change is one that doesn't change the effect of the execution. This can occasionally be fine, can't it? >

Re: char/tpm: Improve a size determination in nine functions

2017-10-17 Thread SF Markus Elfring
>> p = kmalloc(sizeof(*p), ...); >> >> The alternative form where struct name is spelled out hurts readability and >> introduces an opportunity for a bug when the pointer variable type is changed >> but the corresponding sizeof that is passed to a memory allocator is not. > > True, thanks for

[PATCH 0/2] PowerPC-PS3: Adjustments for three function implementations

2017-10-17 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 17 Oct 2017 20:22:44 +0200 Two update suggestions were taken into account from static source code analysis. Markus Elfring (2): Delete an error message for a failed memory allocation in update_flash_db() Improve a size determination in two functions arch/pow

[PATCH 1/2] powerpc-ps3: Delete an error message for a failed memory allocation in update_flash_db()

2017-10-17 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 17 Oct 2017 20:00:31 +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 --- arch/powerpc/platforms/ps3/os-area.c | 4 +--- 1 file changed, 1 inser

[PATCH 2/2] powerpc-ps3: Improve a size determination in two functions

2017-10-17 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 17 Oct 2017 20:15:17 +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 issue was detec

Re: char/tpm: Improve a size determination in nine functions

2017-10-17 Thread SF Markus Elfring
>> Do you find my wording “This issue was detected by using the >> Coccinelle software.” insufficient? > > The question is not whether it is insufficient, but whether it is appropriate. I am curious on how our corresponding discussion will evolve further. > Detecting Coccinelle issues is one st

Re: char/tpm: Improve a size determination in nine functions

2017-10-17 Thread SF Markus Elfring
>> I imagine that a corresponding source code analysis variant could be applied >> in more cases if sufficient acceptance could be achieved. > > So, then instead of still keeping people busy with this noise you better > start doing something like CI integration with that for *new* code? There are

Re: char-TPM: Adjustments for ten function implementations

2017-10-18 Thread SF Markus Elfring
> The printk removals do change the objects. > > The value of that type of change is only for resource limited systems. I imagine that such small code adjustments are also useful for other systems. > Markus' changelogs leave much to be desired. Would you like to help more to improve the provid

Re: char-TPM: Adjustments for ten function implementations

2017-10-18 Thread SF Markus Elfring
>> I imagine that such small code adjustments are also useful for other systems. > > Your imagination and mine differ. This can generally be. > Where do you _think_ it matters? It seems that this discussion branch referred still to my cover letter for possible changes in the TPM software area.

Re: Adjusting further size determinations?

2017-10-18 Thread SF Markus Elfring
> Ugly grep follows: > > $ grep -rohP --include=*.[ch] "\w+\s*=\s*[kv].alloc\s*\(\s*sizeof.*," * | \ > sed -r -e 's/(\w+)\s*=\s*[kv].alloc\s*\(\s*sizeof\s*\(\s*\*\s*\1\s*\)/foo = > k.alloc(sizeof(*foo))/' \ > -e > 's/(\w+)\s*=\s*[kv].alloc\s*\(\s*sizeof\s*\(\s*struct\s+\w+\s*\)/foo =

Re: Adjusting further size determinations?

2017-10-18 Thread SF Markus Elfring
Unpleasant consequences are possible in both cases. >> How much do you care to reduce the failure probability further? > > Zero. I am interested to improve the software situation a bit more here. Regards, Markus

Re: Adjusting further size determinations?

2017-10-18 Thread SF Markus Elfring
>> If you want 'security' for kmalloc() then: >> >> #define KMALLOC_TYPE(flags) (type *)kmalloc(sizeof (type), flags) >> #define KMALLOC(ptr, flags) *(ptr) = KMALLOC_TYPE(typeof *(ptr), flags) Such an approach might help. >> and change: >> ptr = kmalloc(sizeof *ptr, flags); >> to: >> K

Re: char/tpm: Improve a size determination in nine functions

2017-10-18 Thread SF Markus Elfring
>> Do you find my wording “This issue was detected by using the >> Coccinelle software.” insufficient? > > This is fine for cover letter, not for the commits. I guess that there are more opinions available by other contributors for this aspect. > After your analysis software finds an issue you

Re: char-TPM: Adjustments for ten function implementations

2017-10-18 Thread SF Markus Elfring
>>> A minor complaint: all commits are missing "Fixes:" tag. >> >> * Do you require it to be added to the commit messages? > > I don't require it. It's part of the development process: > > https://www.kernel.org/doc/html/v4.12/process/submitting-patches.html Yes. - But other contributors pointed

Re: char/tpm: Improve a size determination in nine functions

2017-10-18 Thread SF Markus Elfring
> Commit message should just describe in plain text what you are doing Did other contributors find the wording “Replace …” > and why. and “… a bit safer according to the Linux coding style convention.” sufficient often enough already? Which description would you find more appropriate for this

Re: char/tpm: Improve a size determination in nine functions

2017-10-18 Thread SF Markus Elfring
> For 1/4 and 2/4: explain why the message can be omitted. Why did you not reply directly with this request for the update steps with the subject “Delete an error message for a failed memory allocation in tpm_…()”? https://patchwork.kernel.org/patch/10009405/ https://patchwork.kernel.org/patch/10

Re: char/tpm: Improve a size determination in nine functions

2017-10-18 Thread SF Markus Elfring
> One more word of advice: send the three as separate patches. I do not see a need for an immediate resend at the moment. > My guess is that it takes a factor longer time to apply 4/4 > than other patches because there's more limited crowd who can test it. This is fine for me if somebody would

Re: char/tpm: Delete an error message for a failed memory allocation in tpm_…()

2017-10-18 Thread SF Markus Elfring
>> Why did you not reply directly with this request for the update steps >> with the subject “Delete an error message for a failed memory allocation >> in tpm_…()”? >> >> https://patchwork.kernel.org/patch/10009405/ >> https://patchwork.kernel.org/patch/10009415/ >> >> I find that there can be diff

[PATCH 0/5] PowerPC-pSeries: Adjustments for seven function implementations

2017-10-18 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 18 Oct 2017 21:11:23 +0200 A few update suggestions were taken into account from static source code analysis. Markus Elfring (5): Delete five error messages for a failed memory allocation Improve nine size determinations Delete an unnecessary variable initia

[PATCH 1/5] powerpc-pseries: Delete five error messages for a failed memory allocation

2017-10-18 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 18 Oct 2017 16:39:01 +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 --- arch/powerpc/platforms/pseries/dtl.c | 5 + arch/powerpc/pl

[PATCH 2/5] powerpc-pseries: Improve nine size determinations

2017-10-18 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 18 Oct 2017 18:18:11 +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 issue was detec

[PATCH 3/5] powerpc-pseries: Delete an unnecessary variable initialisation in iommu_pseries_alloc_group()

2017-10-18 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 18 Oct 2017 19:14:39 +0200 The variable "table_group" will be set to an appropriate pointer. Thus omit the explicit initialisation at the beginning. Signed-off-by: Markus Elfring --- arch/powerpc/platforms/pseries/iommu.c | 2 +- 1 file changed, 1 insertion(+),

[PATCH 4/5] powerpc-pseries: Return directly after a failed kzalloc_node() in iommu_pseries_alloc_group()

2017-10-18 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 18 Oct 2017 20:15:32 +0200 Return directly after a call of the function "kzalloc_node" failed at the beginning. Signed-off-by: Markus Elfring --- arch/powerpc/platforms/pseries/iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powe

[PATCH 5/5] powerpc-pseries: Less function calls in iommu_pseries_alloc_group() after error detection

2017-10-18 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 18 Oct 2017 20:48:52 +0200 The kfree() function was called in up to two cases by the iommu_pseries_alloc_group() function during error handling even if the passed variable contained a null pointer. * Adjust jump targets according to the Linux coding style conventi

Re: [PATCH 3/5] powerpc-pseries: Delete an unnecessary variable initialisation in iommu_pseries_alloc_group()

2017-10-19 Thread SF Markus Elfring
>> static struct iommu_table_group *iommu_pseries_alloc_group(int node) >> { >> -struct iommu_table_group *table_group = NULL; >> +struct iommu_table_group *table_group; >> struct iommu_table *tbl = NULL; >> struct iommu_table_group_link *tgl = NULL; >> > > I think initializi

Re: [PATCH 4/5] powerpc-pseries: Return directly after a failed kzalloc_node() in iommu_pseries_alloc_group()

2017-10-19 Thread SF Markus Elfring
>> @@ -61,7 +61,7 @@ static struct iommu_table_group >> *iommu_pseries_alloc_group(int node) >> table_group = kzalloc_node(sizeof(*table_group), GFP_KERNEL, >> node); if (!table_group) >> -goto fail_exit; >> +return NULL; >> >> tbl = kzalloc_node(sizeof(*tbl),

Re: [PATCH 4/4] char/tpm: Less checks in tpm_ibmvtpm_probe() after error detection

2017-10-19 Thread SF Markus Elfring
>> @@ -683,13 +683,10 @@ static int tpm_ibmvtpm_probe(struct vio_dev *vio_dev, >> reg_crq_cleanup: >> dma_unmap_single(dev, ibmvtpm->crq_dma_handle, >> CRQ_RES_BUF_SIZE, DMA_BIDIRECTIONAL); >> -cleanup: >> -if (ibmvtpm) { >> -if (crq_q->crq_addr) >> -free_pa

Re: Circumstances for using the tag “Fixes” (or not)

2017-10-19 Thread SF Markus Elfring
>>> The "Fixes" tag is an indication that the patch should be backported. >> >> No it's not that strong. It's an indication that the patch fixes another >> commit, which may or may not mean it should be backported depending on >> the preferences of the backporter. If it *does* need backporting then

Re: char/tpm: Less checks in tpm_ibmvtpm_probe() after error detection

2017-10-19 Thread SF Markus Elfring
>> If the code doing the allocation is changed in the future the single >> cleanup can stay whereas multiple labels have to be rewritten again. > > No, they don't unless you choose bad label names. Perhaps numbered > labels? We don't get a lot of those in the kernel any more. Label > name shoul

[PATCH 0/3] tty/serial/ucc_uart: Adjustments for two functions

2017-12-06 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 6 Dec 2017 22:06:44 +0100 Three update suggestions were taken into account from static source code analysis. Markus Elfring (3): Delete an error message for a failed memory allocation in ucc_uart_probe() Improve a size determination in ucc_uart_probe() Fix a

[PATCH 1/3] tty/serial/ucc_uart: Delete an error message for a failed memory allocation in ucc_uart_probe()

2017-12-06 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 6 Dec 2017 21:41:14 +0100 Omit an extra message for a memory allocation failure in this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/tty/serial/ucc_uart.c | 4 +--- 1 file changed, 1 insertion(+),

[PATCH 2/3] tty/serial/ucc_uart: Improve a size determination in ucc_uart_probe()

2017-12-06 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 6 Dec 2017 21:45:32 +0100 Replace the specification of a data structure by a pointer dereference as the parameter for the operator "sizeof" to make the corresponding size determination a bit safer according to the Linux coding style convention. This issue was dete

[PATCH 3/3] tty/serial/ucc_uart: Fix a typo in a comment line

2017-12-06 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 6 Dec 2017 21:56:28 +0100 Add a missing character in a function name of this description. Signed-off-by: Markus Elfring --- drivers/tty/serial/ucc_uart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/ucc_uart.c b/drivers/

[PATCH 0/3] SoC/FSL/QE: Adjustments for three function implementations

2017-12-13 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 13 Dec 2017 18:28:38 +0100 Three update suggestions were taken into account from static source code analysis. Markus Elfring (3): Delete an error message for a failed memory allocation in three functions Improve a size determination in two functions Use comm

[PATCH 1/3] soc/fsl/qe: Delete an error message for a failed memory allocation in three functions

2017-12-13 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 13 Dec 2017 17:45:23 +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 --- drivers/soc/fsl/qe/gpio.c | 4 +--- drivers/soc/fsl/qe/ucc_fast.

[PATCH 2/3] soc/fsl/qe: Improve a size determination in two functions

2017-12-13 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 13 Dec 2017 17:51:21 +0100 Replace the specification of data structures by pointer dereferences as the parameter for the operator "sizeof" to make the corresponding size determination a bit safer according to the Linux coding style convention. This issue was detec

[PATCH 3/3] soc/fsl/qe: Use common error handling code in ucc_fast_init()

2017-12-13 Thread SF Markus Elfring
From: Markus Elfring Date: Wed, 13 Dec 2017 18:18:56 +0100 Add jump targets so that a bit of exception handling can be better reused at the end of this function. Signed-off-by: Markus Elfring --- drivers/soc/fsl/qe/ucc_fast.c | 32 1 file changed, 16 insertions

[PATCH 2/2] ps3: Improve a size determination in five functions

2017-12-16 Thread SF Markus Elfring
From: Markus Elfring Date: Sat, 16 Dec 2017 14:21:04 +0100 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. Signed-off-by: Markus

[PATCH 0/2] PS3: Adjustments for six function implementations

2017-12-16 Thread SF Markus Elfring
From: Markus Elfring Date: Sat, 16 Dec 2017 14:42:24 +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 in two functions Improve a size determination in five functions drivers/ps3

[PATCH 1/2] ps3: Delete an error message for a failed memory allocation in two functions

2017-12-16 Thread SF Markus Elfring
From: Markus Elfring Date: Sat, 16 Dec 2017 12:32:42 +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 --- drivers/ps3/ps3-lpm.c | 2 -- drivers/ps3/ps3-vuart.c | 1 - 2 fil

Re: ps3: Improve a size determination in five functions

2017-12-18 Thread SF Markus Elfring
>> 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. > > This would be OK, Thanks. > but you are also removing empty lines

[PATCH 0/8] PowerPC-NVRAM: Fine-tuning for some function implementations

2017-01-19 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 19 Jan 2017 17:41:23 +0100 Some update suggestions were taken into account from static source code analysis. Markus Elfring (8): Return directly after a failed parameter validation in dev_nvram_write() Return directly after a failed kmalloc() in dev_nvram_writ

[PATCH 6/8] powerpc/nvram: Delete three error messages for a failed memory allocation

2017-01-19 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 19 Jan 2017 16:56:46 +0100 The script "checkpatch.pl" pointed information out like the following. WARNING: Possible unnecessary 'out of memory' message Thus fix affected source code places. Signed-off-by: Markus Elfring --- arch/powerpc/kernel/nvram_64.c | 12

[PATCH 2/8] powerpc/nvram: Return directly after a failed kmalloc() in dev_nvram_write()

2017-01-19 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 19 Jan 2017 15:44:03 +0100 Return directly after a call of the function "kmalloc" failed here. Signed-off-by: Markus Elfring --- arch/powerpc/kernel/nvram_64.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/powerpc/kernel/nvram_64.c

[PATCH 4/8] powerpc/nvram: Return directly after a failed parameter validation in dev_nvram_read()

2017-01-19 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 19 Jan 2017 16:12:48 +0100 * Return directly after an inappropriate input parameter was detected. * Delete an initialisation for the variable "tmp" at the beginning which became unnecessary with this refactoring. Signed-off-by: Markus Elfring --- arch/powerpc

[PATCH 3/8] powerpc/nvram: Move an assignment for the variable "ret" in dev_nvram_write()

2017-01-19 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 19 Jan 2017 15:55:36 +0100 A local variable was set to an error code before a concrete error situation was detected. Thus move the corresponding assignment into an if branch to indicate a software failure there. This issue was detected by using the Coccinelle soft

[PATCH 7/8] powerpc/nvram: Improve size determinations in three functions

2017-01-19 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 19 Jan 2017 17:15:30 +0100 Replace the specification of data structures by references for local variables as the parameter for the operator "sizeof" to make the corresponding size determination a bit safer. Signed-off-by: Markus Elfring --- arch/powerpc/kernel/n

[PATCH 8/8] powerpc/nvram: Move an assignment for the variable "err" in nvram_scan_partitions()

2017-01-19 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 19 Jan 2017 17:27:37 +0100 A local variable was set to an error code before a concrete error situation was detected. Thus move the corresponding assignment into an if branch to indicate a software failure there. Signed-off-by: Markus Elfring --- arch/powerpc/ker

[PATCH 5/8] powerpc/nvram: Return directly after a failed kmalloc() in dev_nvram_read()

2017-01-19 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 19 Jan 2017 16:50:31 +0100 Return directly after a call of the function "kmalloc" failed here. Signed-off-by: Markus Elfring --- arch/powerpc/kernel/nvram_64.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/kernel/nvram_64

[PATCH 1/8] powerpc/nvram: Return directly after a failed parameter validation in dev_nvram_write()

2017-01-19 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 19 Jan 2017 15:22:56 +0100 * Return directly after an inappropriate input parameter was detected. * Delete an initialisation for the variable "tmp" at the beginning and an assignment for the variable "ret" which became unnecessary with this refactoring. Signe

[PATCH] powerpc/rtas_flash: Move an assignment for the variable "rc" in manage_flash_write()

2017-01-19 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 19 Jan 2017 21:20:09 +0100 A local variable was set to an error code before a concrete error situation was detected. Thus move the corresponding assignment into an if branch to indicate a software failure there. This issue was detected by using the Coccinelle soft

Re: powerpc/nvram: Move an assignment for the variable "ret" in dev_nvram_write()

2017-01-19 Thread SF Markus Elfring
> I think you really could have squashed patches 1-3 into a single patch > that returns directly after any failure. Thanks for your constructive feedback. I have got software development concerns around such patch squashing. > At this point you might as well remove that label and move the kfree

[PATCH 00/11] PowerPC-KVM: Fine-tuning for some function implementations

2017-01-20 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 20 Jan 2017 19:07:21 +0100 Some update suggestions were taken into account from static source code analysis. Markus Elfring (11): Move assignments for the variable "err" in kvm_htab_write() Improve a size determination in kvmppc_alloc_hpt() Move error code a

[PATCH 01/11] KVM: PPC: Book3S HV: Move assignments for the variable "err" in kvm_htab_write()

2017-01-20 Thread SF Markus Elfring
From: Markus Elfring Date: Thu, 19 Jan 2017 22:45:56 +0100 * A local variable was set to an error code in five cases before a concrete error situation was detected. Thus move the corresponding assignments into if branches to indicate a software failure there. This issue was detected by u

[PATCH 02/11] KVM: PPC: Book3S HV: Improve a size determination in kvmppc_alloc_hpt()

2017-01-20 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 20 Jan 2017 10:00:13 +0100 Replace the specification of a data structure by a pointer dereference as the parameter for the operator "sizeof" to make the corresponding size determination a bit safer according to the Linux coding style convention. Signed-off-by: Mar

[PATCH 03/11] KVM: PPC: Book3S HV: Move error code assignments in two functions

2017-01-20 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 20 Jan 2017 10:30:26 +0100 A local variable was set to an error code in a few cases before a concrete error situation was detected. Thus move the corresponding assignments into if branches to indicate a software failure there. This issue was detected by using the

[PATCH 04/11] KVM: PPC: Book3S HV: Use common error handling code in kvmppc_clr_passthru_irq()

2017-01-20 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 20 Jan 2017 11:00:08 +0100 Add a jump target so that a bit of exception handling can be better reused at the end of this function. Signed-off-by: Markus Elfring --- arch/powerpc/kvm/book3s_hv.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff

  1   2   >