Re: [PATCH v3 02/19] coccinelle: misc: Add secs_to_jiffies script

2024-12-17 Thread Julia Lawall
On Tue, 17 Dec 2024, Alexander Gordeev wrote: > On Tue, Dec 10, 2024 at 10:02:33PM +, Easwar Hariharan wrote: > > Hi Easwar, > > > This script finds and suggests conversions of timeout patterns that > > result in seconds-denominated timeouts to use the new secs_to_jiffies() > > API in inclu

Re: [PATCH v2 05/21] powerpc/papr_scm: Convert timeouts to secs_to_jiffies()

2024-11-16 Thread Julia Lawall
Sent from my iPhone > On 16 Nov 2024, at 05:40, Dan Carpenter wrote: > > On Sat, Nov 16, 2024 at 11:06:55AM +0100, Christophe Leroy wrote: >>> diff --git a/arch/powerpc/platforms/pseries/papr_scm.c >>> b/arch/powerpc/platforms/pseries/papr_scm.c >>> index >>> 9e297f88adc5d97d4dc7b267b0bfebd

[PATCH 13/17] KVM: PPC: replace call_rcu by kfree_rcu for simple kmem_cache_free callback

2024-10-13 Thread Julia Lawall
Since SLOB was removed and since commit 6c6c47b063b5 ("mm, slab: call kvfree_rcu_barrier() from kmem_cache_destroy()"), it is not necessary to use call_rcu when the callback only performs kmem_cache_free. Use kfree_rcu() directly. The changes were made using Coccinelle. Signed-off

[PATCH 00/17] replace call_rcu by kfree_rcu for simple kmem_cache_free callback

2024-10-13 Thread Julia Lawall
Since SLOB was removed and since commit 6c6c47b063b5 ("mm, slab: call kvfree_rcu_barrier() from kmem_cache_destroy()"), it is not necessary to use call_rcu when the callback only performs kmem_cache_free. Use kfree_rcu() directly. The changes were done using the following Coccinelle semantic patc

Re: [PATCH 00/14] replace call_rcu by kfree_rcu for simple kmem_cache_free callback

2024-10-09 Thread Julia Lawall
Hello, I have rerun the semantic patch that removes call_rcu calls in cases where the callback function just does some pointer arithmetic and calls kmem_cache_free. Let me know if this looks ok, and if so, I can make a more formal patch submission. This is against: commit 75b607fab38d149f232f01

[PATCH 00/35] Reorganize kerneldoc parameter names

2024-09-30 Thread Julia Lawall
Reorganize kerneldoc parameter names to match the parameter order in the function header. The misordered cases were identified using the following Coccinelle semantic patch: // @initialize:ocaml@ @@ let parse_doc l = let pieces = List.map String.trim (String.split_on_char '*' l) in let l =

[PATCH 11/35] powerpc/ps3: Reorganize kerneldoc parameter names

2024-09-30 Thread Julia Lawall
Reorganize kerneldoc parameter names to match the parameter order in the function header. Problems identified using Coccinelle. Signed-off-by: Julia Lawall --- arch/powerpc/platforms/ps3/interrupt.c |2 +- arch/powerpc/platforms/ps3/repository.c |2 +- 2 files changed, 2 insertions

[PATCH 03/14] KVM: PPC: replace call_rcu by kfree_rcu for simple kmem_cache_free callback

2024-06-09 Thread Julia Lawall
sition r.p; @@ - call_rcu(&e->f,cb@p) + kfree_rcu(e,f) @r1a depends on !s@ type T; identifier x,r.cb; @@ - cb(...) { ( - kmem_cache_free(...); | - T x = ...; - kmem_cache_free(...,x); | - T x; - x = ...; - kmem_cache_free(...,x); ) - } // Signed-off-by: Julia Lawall Reviewed-by: Pa

[PATCH 00/14] replace call_rcu by kfree_rcu for simple kmem_cache_free callback

2024-06-09 Thread Julia Lawall
sition r.p; @@ - call_rcu(&e->f,cb@p) + kfree_rcu(e,f) @r1a depends on !s@ type T; identifier x,r.cb; @@ - cb(...) { ( - kmem_cache_free(...); | - T x = ...; - kmem_cache_free(...,x); | - T x; - x = ...; - kmem_cache_free(...,x); ) - } // Signed-off-by: Julia Lawall Reviewed-by: Pa

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

2024-04-16 Thread Julia Lawall
On Tue, 16 Apr 2024, Christophe Leroy wrote: > > > Le 16/04/2024 à 14:14, Markus Elfring a écrit : > >> This is explicit in Kernel documentation: > >> > >> /** > >>* kfree - free previously allocated memory > >>* @object: pointer returned by kmalloc() or kmem_cache_alloc() > >>* > >>

[PATCH 06/11] powerpc/kexec_file: add missing of_node_put

2023-09-07 Thread Julia Lawall
for_each_node_with_property performs an of_node_get on each iteration, so a break out of the loop requires an of_node_put. This was done using the Coccinelle semantic patch iterators/for_each_child.cocci Signed-off-by: Julia Lawall --- arch/powerpc/kexec/file_load_64.c |8 ++-- 1 file

[PATCH 03/11] powerpc/powermac: add missing of_node_put

2023-09-07 Thread Julia Lawall
for_each_node_by_name performs an of_node_get on each iteration, so a break out of the loop requires an of_node_put. This was done using the Coccinelle semantic patch iterators/for_each_child.cocci Signed-off-by: Julia Lawall --- arch/powerpc/platforms/powermac/low_i2c.c |4 +++- arch

[PATCH 00/11] add missing of_node_put

2023-09-07 Thread Julia Lawall
Add of_node_put on a break out of an of_node loop. --- arch/powerpc/kexec/file_load_64.c|8 ++-- arch/powerpc/platforms/powermac/low_i2c.c|4 +++- arch/powerpc/platforms/powermac/smp.c|4 +++- drivers/bus/arm-cci.c

Re: [PATCH v4 2/6] treewide: use prandom_u32_max() when possible

2022-10-08 Thread Julia Lawall
> >> @minus_one@ > >> expression FULL; > >> @@ > >> > >> - (get_random_int() & ((FULL) - 1) > >> + prandom_u32_max(FULL) > > > >Ahh, well, okay, this is the example I mentioned above. Only works if > >FULL is saturated. Any clever way to get coccinelle to prove that? Can > >it look at the value of

Re: [PATCH] powerpc/kvm: fix repeated words in comments Delete the redundant word 'that'.

2022-07-25 Thread Julia Lawall
On Mon, 25 Jul 2022, Michael Ellerman wrote: > wangjianli writes: > > Signed-off-by: wangjianli > > --- > > arch/powerpc/kvm/book3s_64_mmu_hv.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/arch/powerpc/kvm/book3s_64_mmu_hv.c > > b/arch/powerpc/kvm/book3s_64

[PATCH] cxl: fix typo in comment

2022-05-21 Thread Julia Lawall
Spelling mistake (triple letters) in comment. Detected with the help of Coccinelle. Signed-off-by: Julia Lawall --- include/misc/cxl.h |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/misc/cxl.h b/include/misc/cxl.h index 0410412de16b..d8044299d654 100644 --- a

Re: [PATCH] powerpc: fix typos in comments

2022-05-05 Thread Julia Lawall
On Thu, 5 May 2022, Joel Stanley wrote: > On Sat, 30 Apr 2022 at 18:58, Julia Lawall wrote: > > > > Various spelling mistakes in comments. > > Detected with the help of Coccinelle. > > > > Signed-off-by: Julia Lawall > > I read the patch and it appea

[PATCH] powerpc: fix typos in comments

2022-04-30 Thread Julia Lawall
Various spelling mistakes in comments. Detected with the help of Coccinelle. Signed-off-by: Julia Lawall --- arch/powerpc/boot/cuboot-hotfoot.c |2 +- arch/powerpc/crypto/aes-spe-glue.c |2 +- arch/powerpc/kernel/cputable.c |2

[PATCH] powerpc/kexec: fix for_each_child.cocci warning

2021-08-03 Thread Julia Lawall
From: kernel test robot for_each_node_by_type should have of_node_put() before return. Generated by: scripts/coccinelle/iterators/for_each_child.cocci CC: Sumera Priyadarsini Reported-by: kernel test robot Signed-off-by: kernel test robot --- The code seems to have been this way since the b

[PATCH 4/4] ASoC: fsl: drop unneeded snd_soc_dai_set_drvdata

2021-02-13 Thread Julia Lawall
= e - snd_soc_dai_set_drvdata(y,x); @@ expression x,y,e; @@ x = snd_soc_dai_get_drvdata(y) ... when != x = e - snd_soc_dai_set_drvdata(y,x); // Signed-off-by: Julia Lawall --- sound/soc/fsl/fsl_micfil.c |2 -- sound/soc/fsl/fsl_sai.c|2 -- sound/soc/fsl/fsl_xcv

Documentation/powerpc: Ultravisor API

2020-07-30 Thread Julia Lawall
The file Documentation/powerpc/ultravisor.rst contains: Only valid value(s) in ``flags`` are: * H_PAGE_IN_SHARED which indicates that the page is to be shared with the Ultravisor. * H_PAGE_IN_NONSHARED indicates that the UV is not anymore interested in the

Re: [PATCH] powerpc/spufs: adjust list element pointer type

2020-05-08 Thread Julia Lawall
On Fri, 8 May 2020, Jeremy Kerr wrote: > Hi Julia, > > > Other uses of &gang->aff_list_head, eg in spufs_assert_affinity, indicate > > that the list elements have type spu_context, not spu as used here. Change > > the type of tmp accordingly. > > Looks good to me; we could even use ctx there,

[PATCH] powerpc/spufs: adjust list element pointer type

2020-05-08 Thread Julia Lawall
("[CELL] cell: add placement computation for scheduling of affinity contexts") Signed-off-by: Julia Lawall --- arch/powerpc/platforms/cell/spufs/sched.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/powerpc/platforms/cell/spufs/sched.c b/arch/powerpc/pla

Re: [PATCH 0/4] use mmgrab

2020-01-03 Thread Julia Lawall
On Fri, 3 Jan 2020, Dan Carpenter wrote: > On Sun, Dec 29, 2019 at 04:42:54PM +0100, Julia Lawall wrote: > > Mmgrab was introduced in commit f1f1007644ff ("mm: add new mmgrab() > > helper") and most of the kernel was updated to use it. Update a few > > remaining

[PATCH 10/10] powerpc/powernv: use resource_size

2020-01-01 Thread Julia Lawall
Use resource_size rather than a verbose computation on the end and start fields. The semantic patch that makes these changes is as follows: (http://coccinelle.lip6.fr/) @@ struct resource ptr; @@ - (ptr.end - ptr.start + 1) + resource_size(&ptr) Signed-off-by: Julia Lawall --- arch/pow

[PATCH 05/10] powerpc/83xx: use resource_size

2020-01-01 Thread Julia Lawall
Use resource_size rather than a verbose computation on the end and start fields. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) @@ struct resource ptr; @@ - (ptr.end - ptr.start + 1) + resource_size(&ptr) Signed-off-by: Julia Lawall --- arch/pow

[PATCH 00/10] use resource_size

2020-01-01 Thread Julia Lawall
Use resource_size rather than a verbose computation on the end and start fields. The semantic patch that makes these changes is as follows: (http://coccinelle.lip6.fr/) @@ struct resource ptr; @@ - ((ptr.end) - (ptr.start) + 1) + resource_size(&ptr) @@ struct resource *ptr; @@ - ((ptr->end) -

[PATCH 09/16] powerpc/mpic: constify copied structure

2020-01-01 Thread Julia Lawall
The mpic_ipi_chip and mpic_irq_ht_chip structures are only copied into other structures, so make them const. The opportunity for this change was found using Coccinelle. Signed-off-by: Julia Lawall --- arch/powerpc/sysdev/mpic.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions

[PATCH 00/16] constify copied structure

2020-01-01 Thread Julia Lawall
Make const static structures that are just copied into other structures. The semantic patch that detects the opportunity for this change is as follows: (http://coccinelle.lip6.fr/) @r disable optional_qualifier@ identifier i,j; position p; @@ static struct i j@p = { ... }; @upd@ position p1; id

[PATCH 1/4] misc: cxl: use mmgrab

2019-12-29 Thread Julia Lawall
ount); + mmgrab(e); Signed-off-by: Julia Lawall --- drivers/misc/cxl/context.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/misc/cxl/context.c b/drivers/misc/cxl/context.c index aed9c445d1e2..fb2eff69e449 100644 --- a/drivers/misc/cxl/context.c +++ b/drivers/m

[PATCH 0/4] use mmgrab

2019-12-29 Thread Julia Lawall
Mmgrab was introduced in commit f1f1007644ff ("mm: add new mmgrab() helper") and most of the kernel was updated to use it. Update a few remaining files. --- arch/openrisc/kernel/smp.c |2 +- drivers/misc/cxl/context.c |2 +- drivers/vfio/pci/vfio_pci_nvlink2.c |2 +-

Re: Coccinelle: Checking of_node_put() calls with SmPL

2019-07-10 Thread Julia Lawall
On Thu, 11 Jul 2019, wen.yan...@zte.com.cn wrote: > > > 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? > > https://git.kernel.org/pub/scm/

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

2019-02-23 Thread Julia Lawall
any if (<+...of_device_is_available(e)...+>) { ... when != of_node_put(e) ( return e; | + of_node_put(e); return ...; ) } // Fixes: c026c98739c7e ("powerpc/83xx: Do not configure or probe disabled FSL DR USB controllers") Signed-off-by: Julia Lawall --- arch/powerpc/plat

[PATCH 00/12] add missing of_node_put after of_device_is_available

2019-02-23 Thread Julia Lawall
Failure of of_device_is_available implies that the device node should be put, if it is not used otherwise. --- arch/arm/mach-omap2/display.c|4 +++- arch/powerpc/platforms/83xx/usb.c|4 +++- drivers/bus/arm-cci.c

Re: [PATCH -next] powerpc/pseries: Fix platform_no_drv_owner.cocci warnings

2019-02-18 Thread Julia Lawall
On Mon, 18 Feb 2019, YueHaibing wrote: > Remove .owner field if calls are used which set it automatically > Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci > > Signed-off-by: YueHaibing > --- > arch/powerpc/platforms/pseries/papr_scm.c | 2 +- > 1 file changed, 1 insertion(+)

Re: [PATCH] powerpc/ipic: Fix a bounds check in ipic_set_priority()

2018-12-06 Thread Julia Lawall
On Thu, 6 Dec 2018, Christophe LEROY wrote: > > > Le 05/12/2018 à 04:26, Michael Ellerman a écrit : > > Hi Dan, > > > > Thanks for the patch. > > > > Dan Carpenter writes: > > > The ipic_info[] array only has 95 elements so I have made the bounds > > > check smaller to prevent a read overflow.

Re: [PATCH] powerpc/ipic: Fix a bounds check in ipic_set_priority()

2018-12-05 Thread Julia Lawall
On Wed, 5 Dec 2018, Michael Ellerman wrote: > Julia Lawall writes: > > On Wed, 5 Dec 2018, Michael Ellerman wrote: > > > >> Hi Dan, > >> > >> Thanks for the patch. > >> > >> Dan Carpenter writes: > >> > The ipic_info[] a

Re: [PATCH] powerpc/ipic: Fix a bounds check in ipic_set_priority()

2018-12-05 Thread Julia Lawall
On Wed, 5 Dec 2018, Michael Ellerman wrote: > Hi Dan, > > Thanks for the patch. > > Dan Carpenter writes: > > The ipic_info[] array only has 95 elements so I have made the bounds > > check smaller to prevent a read overflow. It was Smatch that found > > this issue: > > > > arch/powerpc/sy

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

2018-10-12 Thread Julia Lawall
> I wrote something like this as below but it failed to compile, Julia any > suggestions on how to express this? > > @pte_alloc_func_proto depends on patch exists@ > type T1, T2, T3, T4; > identifier fn =~ > "^(__pte_alloc|pte_alloc_one|pte_alloc|__pte_alloc_kernel|pte_alloc_one_kernel)$"; > @@ > >

Re: [PATCH v5 2/4] resource: Use list_head to link sibling resource

2018-06-12 Thread Julia Lawall
This looks wrong. After a list iterator, the index variable points to a dummy structure. julia url: https://github.com/0day-ci/linux/commits/Baoquan-He/resource-Use-list_head-to-link-sibling-resource/20180612-113600 :: branch date: 7 hours ago :: commit date: 7 hours ago >> kernel/r

Re: [PATCH] fsl/qe: ucc: copy and paste bug in ucc_get_tdm_sync_shift()

2018-06-04 Thread Julia Lawall
On Mon, 4 Jun 2018, Dan Carpenter wrote: > On Mon, Jun 04, 2018 at 10:25:14PM +0900, Julia Lawall wrote: > > > > > > On Mon, 4 Jun 2018, Dan Carpenter wrote: > > > > > There is a copy and paste bug so we accidentally use the RX_ shift when > &

Re: [PATCH] fsl/qe: ucc: copy and paste bug in ucc_get_tdm_sync_shift()

2018-06-04 Thread Julia Lawall
On Mon, 4 Jun 2018, Dan Carpenter wrote: > There is a copy and paste bug so we accidentally use the RX_ shift when > we're in TX_ mode. > > Fixes: bb8b2062aff3 ("fsl/qe: setup clock source for TDM mode") > Signed-off-by: Dan Carpenter > --- > Static analysis work. Not tested. This affects th

[PATCH 4/5] pci/hotplug/pnv-php: add missing of_node_put

2018-05-23 Thread Julia Lawall
; @@ for_each_child_of_node(root, child) { ... when != of_node_put(child) when != e = child + of_node_put(child); ? break; ... } ... when != child // Signed-off-by: Julia Lawall --- drivers/pci/hotplug/pnv_php.c |8 ++-- 1 file changed, 6 insertions(+), 2 deletions

[PATCH 0/5] add missing of_node_put

2018-05-23 Thread Julia Lawall
The device node iterators perform an of_node_get on each iteration, so a jump out of the loop requires an of_node_put. --- drivers/gpu/drm/rockchip/rockchip_lvds.c |4 +++- drivers/pci/hotplug/pnv_php.c |8 ++-- drivers/phy/hisilicon/phy-hisi-inno-usb2.c |9 +++

Re: [PATCH] crypto/nx: fix spelling mistake: "availavle" -> "available"

2017-11-14 Thread Julia Lawall
On Tue, 14 Nov 2017, Colin King wrote: > From: Colin Ian King > > Trivial fix to spelling mistake in pr_err error message text > > Signed-off-by: Colin Ian King > --- > drivers/crypto/nx/nx-842-powernv.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/crypto/n

RE: Adjusting further size determinations?

2017-10-18 Thread Julia Lawall
On Wed, 18 Oct 2017, David Laight wrote: > From: 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. > >

RE: char-TPM: Adjustments for ten function implementations

2017-10-18 Thread Julia Lawall
On Wed, 18 Oct 2017, alexander.stef...@infineon.com wrote: > > On Wed, 2017-10-18 at 11:00 +0200, SF Markus Elfring wrote: > > > > The printk removals do change the objects. > > > > > > > > The value of that type of change is only for resource limited systems. > > > > > > I imagine that such sma

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

2017-10-17 Thread Julia Lawall
On Tue, 17 Oct 2017, Mimi Zohar wrote: > On Tue, 2017-10-17 at 14:58 +0200, Julia Lawall wrote: > > > > On Tue, 17 Oct 2017, Mimi Zohar wrote: > > > > > On Tue, 2017-10-17 at 11:50 +, alexander.stef...@infineon.com > > > wrote: > > > >

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

2017-10-17 Thread Julia Lawall
On Tue, 17 Oct 2017, Mimi Zohar wrote: > On Tue, 2017-10-17 at 11:50 +, alexander.stef...@infineon.com > wrote: > > > > Replace the specification of data structures by pointer dereferences > > > > as the parameter for the operator "sizeof" to make the corresponding > > > > size > > > > deter

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

2017-10-17 Thread Julia Lawall
On Tue, 17 Oct 2017, Dan Carpenter wrote: > On Tue, Oct 17, 2017 at 10:56:42AM +0200, Julia Lawall wrote: > > > > > > On Tue, 17 Oct 2017, Dan Carpenter wrote: > > > > > On Mon, Oct 16, 2017 at 09:35:12PM +0300, Jarkko Sakkinen wrote: > > > > &g

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

2017-10-17 Thread Julia Lawall
On Tue, 17 Oct 2017, Dan Carpenter wrote: > On Mon, Oct 16, 2017 at 09:35:12PM +0300, Jarkko Sakkinen wrote: > > > > A minor complaint: all commits are missing "Fixes:" tag. > > > > Fixes is only for bug fixes. These don't fix any bugs. 0-day seems to put Fixes for everything. Should they be

Re: [PATCH] powerpc/eeh: make eeh_ops structures _ro_after_init

2017-10-13 Thread Julia Lawall
On Fri, 13 Oct 2017, Bhumika Goyal wrote: > These structures are passed to the eeh_ops_register function during the > initialization phase. There they get stored in a structure variable > which only makes function calls through function pointers. There is no > other usage of these eeh_ops struct

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

2017-10-05 Thread Julia Lawall
On Thu, 5 Oct 2017, Michal Suchánek wrote: > Hello, > > On Thu, 5 Oct 2017 21:36:26 +0200 > SF Markus Elfring wrote: > > > From: Markus Elfring > > Date: Thu, 5 Oct 2017 21:04:30 +0200 > > > > Omit extra messages for a memory allocation failure in these > > functions. > > this is bogus. All th

Re: [PATCH] powerpc: make irq_chip const, __initdata and __initconst

2017-09-19 Thread Julia Lawall
On Wed, 20 Sep 2017, Michael Ellerman wrote: > Bhumika Goyal writes: > > > Make ehv_pic_irq_chip, mpic_ipi_chip and mpic_tm_chip const as they are > > used only as a copy operation. This usage is during init, so make them > > __initconst too. > > Make mpic_ipi_chip __initdata as it is only modi

qustion about eeh_add_virt_device

2017-08-13 Thread Julia Lawall
Hello, At the suggestion of Christoph Hellwig, I am working on inlining the functions stored in the err_handler field of a pci_driver structure into the pci_driver structure itself. A number of functions in the file arch/powerpc/kernel/eeh_driver.c have code like: if (!driver->err_handle

Re: [PATCH] powerpc: store the intended structure

2017-08-13 Thread Julia Lawall
On Sun, 13 Aug 2017, Joe Perches wrote: > On Sun, 2017-08-13 at 15:24 +0200, Julia Lawall wrote: > > Normally the values in the resource field and the argument to ARRAY_SIZE > > in the num_resources are the same. In this case, the value in the reousrce > > field is the s

[PATCH] powerpc: store the intended structure

2017-08-13 Thread Julia Lawall
field with the argument to the local call to ARRAY_SIZE. Signed-off-by: Julia Lawall --- arch/powerpc/platforms/chrp/pegasos_eth.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/platforms/chrp/pegasos_eth.c b/arch/powerpc/platforms/chrp/pegasos_eth.c index

[PATCH 05/11] serial: uuc_uart: constify uart_ops structures

2017-08-12 Thread Julia Lawall
These uart_ops structures are only stored in the ops field of a uart_port structure and this fields is const, so the uart_ops structures can also be const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall --- drivers/tty/serial/ucc_uart.c |2 +- 1 file changed, 1 insertion

[PATCH 00/11] constify uart_ops structures

2017-08-12 Thread Julia Lawall
These uart_ops structures are only stored in the ops field of a uart_port structure and this fields is const, so the uart_ops structures can also be const. Done with the help of Coccinelle. --- drivers/tty/serial/21285.c |2 +- drivers/tty/serial/apbuart.c|

[PATCH] powerpc/macintosh: constify wf_sensor_ops structures

2017-08-02 Thread Julia Lawall
disable optional_qualifier@ identifier r.i; @@ static +const struct wf_sensor_ops i = { ... }; // Signed-off-by: Julia Lawall --- drivers/macintosh/windfarm_lm75_sensor.c|2 +- drivers/macintosh/windfarm_lm87_sensor.c|2 +- drivers/macintosh/windfarm_max6690_sensor.c |2 +- drivers/m

[PATCH] usb: gadget: fsl_qe_udc: constify qe_ep0_desc

2017-08-02 Thread Julia Lawall
qe_ep0_desc is only passed as the second argument to qe_ep_init, which is const, so qe_ep0_desc can be const too. Done with the help of Coccinelle. Signed-off-by: Julia Lawall --- I got a lot of warnings when compiling this file, but none seemed to be related to the change. drivers/usb

Re: [PATCH] ALSA: declare snd_kcontrol_new structures as const

2017-05-30 Thread Julia Lawall
On Tue, 30 May 2017, Takashi Iwai wrote: > On Sat, 27 May 2017 16:46:15 +0200, > Bhumika Goyal wrote: > > > > Declare snd_kcontrol_new structures as const as they are only passed an > > argument to the function snd_ctl_new1. This argument is of type const, > > so snd_kcontrol_new structures havi

[PATCH 08/15] powerpc/iommu: use permission-specific DEVICE_ATTR variants

2016-10-29 Thread Julia Lawall
_ATTR_RW; identifier rw.x,rw.x_show,rw.x_store; @@ - DEVICE_ATTR(x, \(0644\|S_IRUGO|S_IWUSR\), x_show, x_store); + DEVICE_ATTR_RW(x); // Signed-off-by: Julia Lawall --- arch/powerpc/kernel/iommu.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/powerpc/kernel/iommu

[PATCH 00/15] use permission-specific DEVICE_ATTR variants

2016-10-29 Thread Julia Lawall
Use DEVICE_ATTR_RO etc. for read only attributes etc. This simplifies the source code, improves readbility, and reduces the chance of inconsistencies. The complete semantic patch is as follows: (http://coccinelle.lip6.fr/) // @ro@ declarer name DEVICE_ATTR; identifier x,x_show; @@ DEVICE_ATTR

[PATCH 6/7] ASoC: constify snd_soc_ops structures

2016-10-15 Thread Julia Lawall
844371155 sound/soc/fsl/imx-wm8962.o 4229 200 844371155 sound/soc/fsl/imx-wm8962.o Signed-off-by: Julia Lawall --- sound/soc/fsl/fsl-asoc-card.c |2 +- sound/soc/fsl/imx-wm8962.c|2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff -u -p a/s

[PATCH] ASoC: constify snd_pcm_ops structures

2016-09-07 Thread Julia Lawall
fier r.i; expression e1, e2; position p; @@ snd_pcm_set_ops(e1, e2, &i@p) @bad@ position p != {r.p,ok1.p,ok2.p}; identifier r.i; struct snd_pcm_ops e; @@ e@i@p @depends on !bad disable optional_qualifier@ identifier r.i; @@ static +const struct snd_pcm_ops i = { ... }; // Signed-off-by: Juli

Re: [Ksummit-discuss] [CORE TOPIC] (group) maintainership models

2016-09-02 Thread Julia Lawall
On Fri, 2 Sep 2016, Linus Torvalds wrote: > On Fri, Sep 2, 2016 at 1:06 PM, Arnd Bergmann wrote: > > > > When I once looked, I thought all drivers using NO_IRQ were specific > > to powerpc or one of the less common architectures. > > powerpc definitely does seem to be the biggest case, with abo

Re: [PATCH 6/6] KVM: PPC: e500: Rename jump labels in kvmppc_e500_tlb_init()

2016-08-28 Thread Julia Lawall
On Sun, 28 Aug 2016, SF Markus Elfring wrote: > From: Markus Elfring > Date: Sun, 28 Aug 2016 18:45:26 +0200 > > Adjust jump labels according to the current Linux coding style convention. > > Signed-off-by: Markus Elfring > --- > arch/powerpc/kvm/e500_mmu.c | 9 - > 1 file changed, 4

Re: [PATCH 5/6] KVM: PPC: e500: Use kmalloc_array() in kvmppc_e500_tlb_init()

2016-08-28 Thread Julia Lawall
On Sun, 28 Aug 2016, SF Markus Elfring wrote: > From: Markus Elfring > Date: Sun, 28 Aug 2016 18:40:08 +0200 > > * 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_

Re: [PATCH 10/11] soc: ti: knav_qmss_queue: use of_property_read_bool

2016-08-05 Thread Julia Lawall
On Fri, 5 Aug 2016, Robin Murphy wrote: > Hi Julia, > > On 05/08/16 09:56, Julia Lawall wrote: > > Use of_property_read_bool to check for the existence of a property. > > This caught my eye since Rob told me off for doing the same recently[1]. > > > The semantic p

[PATCH 09/11] powerpc/mpic: use of_property_read_bool

2016-08-05 Thread Julia Lawall
else S2 // Signed-off-by: Julia Lawall --- arch/powerpc/sysdev/mpic.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c index 7de45b2..26d9c3f 100644 --- a/arch/powerpc/sysdev/mpic.c +++ b/arch/powerpc/sysdev/mpic.c

[PATCH 01/11] fsl/qe: use of_property_read_bool

2016-08-05 Thread Julia Lawall
else S2 // Signed-off-by: Julia Lawall --- drivers/soc/fsl/qe/qe_tdm.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/soc/fsl/qe/qe_tdm.c b/drivers/soc/fsl/qe/qe_tdm.c index 5e48b14..0ac98e6 100644 --- a/drivers/soc/fsl/qe/qe_tdm.c +++ b/drivers/soc/fsl/qe/qe_tdm.c

[PATCH 00/11] use of_property_read_bool

2016-08-05 Thread Julia Lawall
Use of_property_read_bool to check for the existence of a property. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // @@ expression e1,e2; statement S2,S1; @@ - if (of_get_property(e1,e2,NULL)) + if (of_property_read_bool(e1,e2)) S1 else

Re: [PATCH] cxl: replace loop with for_each_child_of_node(), remove unneeded of_node_put()

2016-07-29 Thread Julia Lawall
e_put(afu_np) call after the loop, where it's > > guaranteed that afu_np == NULL. > > > > Reported-by: SF Markus Elfring > > Reported-by: Julia Lawall > > Signed-off-by: Andrew Donnellan > > > > --- > > > > Checked the of_node_put() with Fr

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

2016-07-20 Thread Julia Lawall
On Wed, 20 Jul 2016, SF Markus Elfring wrote: > From: Markus Elfring > Date: Wed, 20 Jul 2016 15:10:32 +0200 > > 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

[PATCH 0/5] Use dma_pool_zalloc

2016-04-29 Thread Julia Lawall
Dma_pool_zalloc combines dma_pool_alloc and memset 0. The semantic patch that makes this transformation is as follows: (http://coccinelle.lip6.fr/) // @@ type T; T *d; expression e; statement S; @@ d = -dma_pool_alloc +dma_pool_zalloc (...);

[PATCH 5/5] dmaengine: fsldma: Use dma_pool_zalloc

2016-04-29 Thread Julia Lawall
- memset(d, 0, sizeof(*d)); // Signed-off-by: Julia Lawall --- drivers/dma/fsldma.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/dma/fsldma.c b/drivers/dma/fsldma.c index aac85c3..a8828ed 100644 --- a/drivers/dma/fsldma.c +++ b/drivers/dma/fsldma.c

[PATCH] xen/hvc: constify hv_ops structures

2015-12-30 Thread Julia Lawall
These hv_ops structures are never modified, so declare them as const. Most were const already. Done with the help of Coccinelle. Signed-off-by: Julia Lawall --- drivers/tty/hvc/hvc_xen.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/tty/hvc/hvc_xen.c b

[PATCH 1/4] ASoC: imx-pcm-dma: add NULL test

2015-12-20 Thread Julia Lawall
Add NULL test on call to devm_kzalloc. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @@ expression x; @@ * x = devm_kzalloc(...); ... when != x == NULL *x // Signed-off-by: Julia Lawall --- sound/soc/fsl/imx-pcm-dma.c |2 ++ 1 file

[PATCH 0/4] add NULL test

2015-12-20 Thread Julia Lawall
Add NULL tests on various calls to kzalloc and devm_kzalloc. The semantic match that finds these problems is as follows: (http://coccinelle.lip6.fr/) // @@ expression x,y; identifier fld; @@ ( x = \(vmalloc\|kmalloc\|kzalloc\|kcalloc\|kmem_cache_alloc\|krealloc\| kmemdup\|kstrdup\|

[PATCH 6/6] powerpc/cell: add missing of_node_put

2015-11-20 Thread Julia Lawall
; @@ for_each_node_by_name(n, e1) { ... when != of_node_put(n) when != e = n ( return n; | + of_node_put(n); ? return ...; ) ... } // Signed-off-by: Julia Lawall --- arch/powerpc/platforms/cell/iommu.c |1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/platforms/cell/iommu.c b

[PATCH 4/6] powerpc/kexec: add missing of_node_put

2015-11-20 Thread Julia Lawall
; @@ for_each_node_by_type(n, e1) { ... when != of_node_put(n) when != e = n ( return n; | + of_node_put(n); ? return ...; ) ... } // Signed-off-by: Julia Lawall --- arch/powerpc/kernel/machine_kexec_64.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kernel

[PATCH 5/6] powerpc/btext: add missing of_node_put

2015-11-20 Thread Julia Lawall
(n,...) { ... ( of_node_put(n); | e = n | + of_node_put(n); ? break; ) ... } ... when != n // Signed-off-by: Julia Lawall --- arch/powerpc/kernel/btext.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/btext.c b/arch/powerpc/kernel

[PATCH 3/6] powerpc/powernv: add missing of_node_put

2015-11-20 Thread Julia Lawall
; @@ for_each_compatible_node(n,...) { ... ( of_node_put(n); | e = n | + of_node_put(n); ? break; ) ... } ... when != n // Signed-off-by: Julia Lawall --- arch/powerpc/platforms/powernv/opal-lpc.c |1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/platforms/powernv/opal-lpc.c b/arch

[PATCH 2/6] powerpc/pseries: add missing of_node_put

2015-11-20 Thread Julia Lawall
://coccinelle.lip6.fr): // @@ expression e,e1; local idexpression n; @@ for_each_node_by_type(n, e1) { ... when != of_node_put(n) when != e = n ( return n; | + of_node_put(n); ? return ...; ) ... } // Signed-off-by: Julia Lawall --- arch/powerpc/platforms/pseries/setup.c |3

[PATCH 1/6] powerpc/6xx: add missing of_node_put

2015-11-20 Thread Julia Lawall
idexpression n; expression e; @@ for_each_compatible_node(n,...) { ... ( of_node_put(n); | e = n | + of_node_put(n); ? break; ) ... } ... when != n // Signed-off-by: Julia Lawall --- arch/powerpc/platforms/embedded6xx/hlwd-pic.c |1 + 1 file changed, 1 insertion(+) diff --git a/arch

[PATCH 0/6] add missing of_node_put

2015-11-20 Thread Julia Lawall
The various for_each device_node iterators performs an of_node_get on each iteration, so a break out of the loop requires an of_node_put. The complete semantic patch that fixes this problem is (http://coccinelle.lip6.fr): // @r@ local idexpression n; expression e1,e2; iterator name for_each_node

Re: [PATCH] powerpc/mpc5xxx: Use of_get_next_parent to simplify code

2015-10-11 Thread Julia Lawall
On Sun, 11 Oct 2015, Christophe JAILLET wrote: > of_get_next_parent can be used to simplify the while() loop and > avoid the need of a temp variable. Can you do something with the loop in __of_translate_address, in drivers/of/address.c? Is there not an iterator for this? julia > > Signed-of

Re: [PATCH 9/9] sound/ppc/snd_ps3.c: fix error return code

2015-04-05 Thread Julia Lawall
Please ignore. Wrong patch set. On Sun, 5 Apr 2015, Julia Lawall wrote: > From: Julia Lawall > > Initialize ret before returning on failure, as done elsewhere in the > function. > > A simplified version of the semantic match that finds this problem is as > follows: (http

[PATCH 9/9] sound/ppc/snd_ps3.c: fix error return code

2015-04-05 Thread Julia Lawall
From: Julia Lawall Initialize ret before returning on failure, as done elsewhere in the function. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // ( if@p1 (\(ret < 0\|ret != 0\)) { ... return ret; } | ret@p1 = 0 ) ... w

[PATCH 2/15] powerpc: don't export static symbol

2015-03-11 Thread Julia Lawall
From: Julia Lawall The semantic patch that fixes this problem is as follows: (http://coccinelle.lip6.fr/) // @r@ type T; identifier f; @@ static T f (...) { ... } @@ identifier r.f; declarer name EXPORT_SYMBOL; @@ -EXPORT_SYMBOL(f); // Furthermore, the function is never used, so its

[PATCH 0/15] don't export static symbol

2015-03-11 Thread Julia Lawall
These patches remove EXPORT_SYMBOL or EXPORT_SYMBOL_GPL declarations on static functions. This was done using the following semantic patch: (http://coccinelle.lip6.fr/) // @r@ type T; identifier f; @@ static T f (...) { ... } @@ identifier r.f; declarer name EXPORT_SYMBOL; @@ -EXPORT_SYMBOL(f

[PATCH 6/8 v2] crypto: replace memset by memzero_explicit

2014-11-30 Thread Julia Lawall
From: Julia Lawall Memset on a local variable may be removed when it is called just before the variable goes out of scope. Using memzero_explicit defeats this optimization. A simplified version of the semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr

[PATCH 0/8] replace memset by memzero_explicit

2014-11-30 Thread Julia Lawall
Memset on a local variable may be removed when it is called just before the variable goes out of scope. Using memzero_explicit defeats this optimization. The complete semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // @@ identifier x; local idexpression e; type

[PATCH 6/8] crypto: replace memset by memzero_explicit

2014-11-30 Thread Julia Lawall
From: Julia Lawall Memset on a local variable may be removed when it is called just before the variable goes out of scope. Using memzero_explicit defeats this optimization. A simplified version of the semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr

[PATCH 0/8] replace memset by memzero_explicit

2014-11-30 Thread Julia Lawall
Memset on a local variable may be removed when it is called just before the variable goes out of scope. Using memzero_explicit defeats this optimization. The complete semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // @@ identifier x; local idexpression e; type

Re: [PATCH 9/9] sound/ppc/snd_ps3.c: fix error return code

2014-11-23 Thread Julia Lawall
Wrong patch, please ignore. julia On Sun, 23 Nov 2014, Julia Lawall wrote: > From: Julia Lawall > > Initialize ret before returning on failure, as done elsewhere in the > function. > > A simplified version of the semantic match that finds this problem is as > follows: (h

[PATCH 9/9] sound/ppc/snd_ps3.c: fix error return code

2014-11-23 Thread Julia Lawall
From: Julia Lawall Initialize ret before returning on failure, as done elsewhere in the function. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // ( if@p1 (\(ret < 0\|ret != 0\)) { ... return ret; } | ret@p1 = 0 ) ... w

[PATCH 7/14 v2] powerpc/4xx/cpm: delete unneeded test before of_node_put

2014-08-11 Thread Julia Lawall
From: Julia Lawall Simplify the error path to avoid calling of_node_put when it is not needed. The semantic patch that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @@ expression e; @@ -if (e) of_node_put(e); // Signed-off-by: Julia Lawall --- v2: new subject

[PATCH 3/14] powerpc: gamecube/wii: delete unneeded test before of_node_put

2014-08-08 Thread Julia Lawall
From: Julia Lawall Simplify the error path to avoid calling of_node_put when it is not needed. The semantic patch that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @@ expression e; @@ -if (e) of_node_put(e); // Signed-off-by: Julia Lawall --- arch/powerpc

  1   2   >