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
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
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
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
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
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
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
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
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
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
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
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
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;
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
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
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
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) &&
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
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
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
20 matches
Mail list logo