[PATCH] VSOCK: fix returnvar.cocci warnings

2015-12-05 Thread Julia Lawall
Remove unneeded variable used to store return value. Generated by: scripts/coccinelle/misc/returnvar.cocci CC: Asias He Signed-off-by: Fengguang Wu Signed-off-by: Julia Lawall --- vsock.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/drivers/vhost/vsock.c +++ b/drivers

[PATCH 0/9] constify pci_error_handlers structures

2015-11-14 Thread Julia Lawall
Constify never-modified pci_error_handlers structures. --- drivers/crypto/qat/qat_common/adf_aer.c |2 +- drivers/misc/genwqe/card_base.c |2 +- drivers/net/ethernet/cavium/liquidio/lio_main.c |2 +- drivers/net/ethernet/sfc/efx.c |2 +- d

[PATCH 9/9] vfio-pci: constify pci_error_handlers structures

2015-11-14 Thread Julia Lawall
This pci_error_handlers structure is never modified, like all the other pci_error_handlers structures, so declare it as const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall --- There are no dependencies between these patches. drivers/vfio/pci/vfio_pci.c |2 +- 1 file

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

2015-09-13 Thread Julia Lawall
Recent commits to kernel/git/torvalds/linux.git have made the following functions able to tolerate NULL arguments: kmem_cache_destroy (commit 3942d29918522) mempool_destroy (commit 4e3ca3e033d1) dma_pool_destroy (commit 44d7175da6ea) These patches remove the associated NULL tests for the files th

[PATCH 31/39] KVM: MMU: drop null test before destroy functions

2015-09-13 Thread Julia Lawall
Remove unneeded NULL test. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // @@ expression x; @@ -if (x != NULL) \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x); // Signed-off-by: Julia Lawall --- arch/x86/kvm/mmu.c |6 ++ 1

Re: [patch] vhost: NULL vs ERR_PTR bug

2015-07-15 Thread Julia Lawall
On Wed, 15 Jul 2015, walter harms wrote: > > > Am 15.07.2015 13:28, schrieb Michael S. Tsirkin: > > On Wed, Jul 15, 2015 at 02:16:59PM +0300, Dan Carpenter wrote: > >> There is only one caller for vhost_kvzalloc() and it expects NULL on > >> allocation failure. Most people would probably expect t

[PATCH] KVM: x86: drop unneeded null test

2015-04-27 Thread Julia Lawall
From: Julia Lawall If the null test is needed, the call to cancel_delayed_work_sync would have already crashed. Normally, the destroy function should only be called if the init functoin has succeeded, in which case ioapic is not null. Problem found using Coccinelle. Signed-off-by: Julia

Re: KVM: x86: question about kvm_ioapic_destroy

2015-04-27 Thread Julia Lawall
On Mon, 27 Apr 2015, Michael S. Tsirkin wrote: > On Sun, Apr 26, 2015 at 07:19:58PM +0200, Julia Lawall wrote: > > The function kvm_ioapic_destroy is defined as follows: > > > > void kvm_ioapic_destroy(struct kvm *kvm) > > { > > struct kvm_i

KVM: x86: question about kvm_ioapic_destroy

2015-04-26 Thread Julia Lawall
The function kvm_ioapic_destroy is defined as follows: void kvm_ioapic_destroy(struct kvm *kvm) { struct kvm_ioapic *ioapic = kvm->arch.vioapic; cancel_delayed_work_sync(&ioapic->eoi_inject); if (ioapic) { kvm_io_bus_unregister_dev(kvm, KVM_MMIO_BUS, &ioapi

[PATCH 3/6] arch/powerpc/kvm/e500_tlb.c: fix error return code

2012-08-05 Thread Julia Lawall
From: Julia Lawall Convert a 0 error return code to a negative one, as returned elsewhere in the function. A new label is also added to avoid freeing things that are known to not yet be allocated. A simplified version of the semantic match that finds the first problem is as follows: (http

[PATCH 4/11] arch/x86/kvm/vmx.c: trivial: use BUG_ON

2011-08-02 Thread Julia Lawall
From: Julia Lawall Use BUG_ON(x) rather than if(x) BUG(); The semantic patch that fixes this problem is as follows: (http://coccinelle.lip6.fr/) // @@ identifier x; @@ -if (x) BUG(); +BUG_ON(x); @@ identifier x; @@ -if (!x) BUG(); +BUG_ON(!x); // Signed-off-by: Julia Lawall --- arch/x86

[PATCH 3/14] drivers/vhost/vhost.c: delete double assignment

2010-10-26 Thread Julia Lawall
From: Julia Lawall Delete successive assignments to the same location. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @@ expression i; @@ *i = ...; i = ...; // Signed-off-by: Julia Lawall --- drivers/vhost/vhost.c

[PATCH 3/3] arch/s390/kvm: Use GFP_ATOMIC when a lock is held

2010-05-30 Thread Julia Lawall
From: Julia Lawall The containing function is called from several places. At one of them, in the function __sigp_stop, the spin lock &fi->lock is held. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // @gfp exists@ identifier fn; position p;

[PATCH 10/17] arch/ia64/kvm: Add missing spin_unlock

2010-05-26 Thread Julia Lawall
From: Julia Lawall Add a spin_unlock missing on the error path. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @@ expression E1; @@ * spin_lock(E1,...); <+... when != E1 if (...) { ... when != E1 * return ...; } ...+> * spin_unl

[PATCH 4/11] arch/x86/kvm: Correct NULL test

2010-02-06 Thread Julia Lawall
From: Julia Lawall msr was tested above, so the second test is not needed. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @r@ expression *x; expression e; identifier l; @@ if (x == NULL || ...) { ... when forall

[PATCH 3/9] virt/kvm: correct error-handling code

2009-07-28 Thread Julia Lawall
From: Julia Lawall This code is not executed before file has been initialized to the result of calling eventfd_fget. This function returns an ERR_PTR value in an error case instead of NULL. Thus the test that file is not NULL is always true. A simplified version of the semantic match that

question about arch/s390/kvm/interrupt.c

2009-07-10 Thread Julia Lawall
In a recent version of linux-next, the function kvm_s390_handle_wait contains the following code: add_wait_queue(&vcpu->arch.local_int.wq, &wait); while (list_empty(&vcpu->arch.local_int.list) && list_empty(&vcpu->arch.local_int.float_int->list) &&

[PATCH retry] arch/ia64/kvm/kvm-ia64.c: Add local_irq_restore in error handling code

2008-07-22 Thread Julia Lawall
From: Julia Lawall <[EMAIL PROTECTED]> There is a call to local_irq_restore in the normal exit case, so it would seem that there should be one on an error return as well. The semantic patch that finds this problem is as follows: (http://www.emn.fr/x-info/coccinelle/) // @@ expres

Re: [PATCH 1/2] arch/ia64/kvm/kvm-ia64.c: Add local_irq_restore in error handling code

2008-07-22 Thread Julia Lawall
On Tue, 22 Jul 2008, Simon Holm Thøgersen wrote: > tir, 22 07 2008 kl. 18:44 +0200, skrev Julia Lawall: > > From: Julia Lawall <[EMAIL PROTECTED]> > > > > There is a call to local_irq_restore in the normal exit case, so it would > > seem that there should

[PATCH 1/2] arch/ia64/kvm/kvm-ia64.c: Add local_irq_restore in error handling code

2008-07-22 Thread Julia Lawall
From: Julia Lawall <[EMAIL PROTECTED]> There is a call to local_irq_restore in the normal exit case, so it would seem that there should be one on an error return as well. The semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // @@ expres