Re: [PATCH] staging: lustre: fix return type of lo_release.

2013-05-16 Thread Cyril Roelandt
On 05/16/2013 09:01 PM, Greg KH wrote: On Thu, May 16, 2013 at 06:06:20PM +0200, Cyril Roelandt wrote: The return type of block_device_operations.release() changed to void in commit db2a144b. Interesting, how did you test build this patch, given that the driver doesn't currently build at all

[PATCH] staging: lustre: fix return type of lo_release.

2013-05-16 Thread Cyril Roelandt
@ identifier has_release_func.release_func; @@ - int + void release_func(...) { ... - return ...; } Signed-off-by: Cyril Roelandt --- drivers/staging/lustre/lustre/llite/lloop.c |4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/lloop.c b

[PATCH] staging: lustre: fix return type of lo_release.

2013-05-16 Thread Cyril Roelandt
@ identifier has_release_func.release_func; @@ - int + void release_func(...) { ... - return ...; } /smpl Signed-off-by: Cyril Roelandt tipec...@gmail.com --- drivers/staging/lustre/lustre/llite/lloop.c |4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/staging/lustre

Re: [PATCH] staging: lustre: fix return type of lo_release.

2013-05-16 Thread Cyril Roelandt
On 05/16/2013 09:01 PM, Greg KH wrote: On Thu, May 16, 2013 at 06:06:20PM +0200, Cyril Roelandt wrote: The return type of block_device_operations.release() changed to void in commit db2a144b. Interesting, how did you test build this patch, given that the driver doesn't currently build at all

Re: [PATCH] net: ethernet: ti: remove redundant NULL check.

2013-02-12 Thread Cyril Roelandt
On 02/12/2013 11:06 PM, David Miller wrote: From: Cyril Roelandt Date: Tue, 12 Feb 2013 22:54:46 +0100 cpdma_chan_destroy() on a NULL pointer is a no-op, so the NULL check in cpdma_ctlr_destroy() can safely be removed. Signed-off-by: Cyril Roelandt ... @@ -450,8 +450,7 @@ int

[PATCH] net: ethernet: ti: remove redundant NULL check.

2013-02-12 Thread Cyril Roelandt
cpdma_chan_destroy() on a NULL pointer is a no-op, so the NULL check in cpdma_ctlr_destroy() can safely be removed. Signed-off-by: Cyril Roelandt --- drivers/net/ethernet/ti/davinci_cpdma.c |6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/ti

[PATCH] net: ethernet: ti: remove redundant NULL check.

2013-02-12 Thread Cyril Roelandt
cpdma_chan_destroy() on a NULL pointer is a no-op, so the NULL check in cpdma_ctlr_destroy() can safely be removed. Signed-off-by: Cyril Roelandt --- drivers/net/ethernet/ti/davinci_cpdma.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/ethernet/ti

[PATCH] net: ethernet: ti: remove redundant NULL check.

2013-02-12 Thread Cyril Roelandt
cpdma_chan_destroy() on a NULL pointer is a no-op, so the NULL check in cpdma_ctlr_destroy() can safely be removed. Signed-off-by: Cyril Roelandt tipec...@gmail.com --- drivers/net/ethernet/ti/davinci_cpdma.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net

[PATCH] net: ethernet: ti: remove redundant NULL check.

2013-02-12 Thread Cyril Roelandt
cpdma_chan_destroy() on a NULL pointer is a no-op, so the NULL check in cpdma_ctlr_destroy() can safely be removed. Signed-off-by: Cyril Roelandt tipec...@gmail.com --- drivers/net/ethernet/ti/davinci_cpdma.c |6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers

Re: [PATCH] net: ethernet: ti: remove redundant NULL check.

2013-02-12 Thread Cyril Roelandt
(ctlr-channels[i]); } SInce this is now a single statement basic block, remove the surrounding braces. Ok, I resent, though I forgot to add v2. Regards, Cyril Roelandt. -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord

[PATCH 3/5] staging: dgrp: remove redundant NULL check before unregister_dgrp_device().

2013-02-11 Thread Cyril Roelandt
unregister_dgrp_device on a NULL pointer is a no-op, so the NULL checks in dgrp_remove_nd() can be removed. Signed-off-by: Cyril Roelandt --- drivers/staging/dgrp/dgrp_specproc.c |9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/staging/dgrp

[PATCH 5/5] xen: remove redundant NULL check before unregister_and_remove_pcpu().

2013-02-11 Thread Cyril Roelandt
unregister_and_remove_pcpu on a NULL pointer is a no-op, so the NULL check in sync_pcpu can be removed. Signed-off-by: Cyril Roelandt --- drivers/xen/pcpu.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/xen/pcpu.c b/drivers/xen/pcpu.c index 067fcfa..5a27a45

[PATCH 2/5] iommu: remove redundant NULL check before dma_ops_domain_free().

2013-02-11 Thread Cyril Roelandt
dma_ops_domain_free on a NULL pointer is a no-op, so the NULL check in amd_iommu_init_dma_ops() can be removed. Signed-off-by: Cyril Roelandt --- drivers/iommu/amd_iommu.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu

[PATCH 4/5] staging: tidspbridge: remove redundant NULL check before delete_msg_mgr().

2013-02-11 Thread Cyril Roelandt
delete_msg_mgr on a NULL pointer is a no-op, so the NULL check in bridge_msg_delete can be removed. Signed-off-by: Cyril Roelandt --- drivers/staging/tidspbridge/core/msg_sm.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/tidspbridge/core/msg_sm.c b

[PATCH 0/5] Remove redundant NULL checks.

2013-02-11 Thread Cyril Roelandt
) { ... if (!param) return; ... } @@ identifier r.noop_func; expression E; statement S; @@ ( - if (E) noop_func(E); + noop_func(E); | - if (E) { noop_func(E); E = NULL; } + noop_func(E); + E = NULL; ) Regards, Cyril Roelandt --- Cyril Roelandt (5): radeon: Remove redundant NULL check before

[PATCH 1/5] radeon: Remove redundant NULL check before radeon_i2c_destroy().

2013-02-11 Thread Cyril Roelandt
radeon_i2c_destroy on a NULL pointer is a no-op. Signed-off-by: Cyril Roelandt --- drivers/gpu/drm/radeon/radeon_i2c.c |6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_i2c.c b/drivers/gpu/drm/radeon/radeon_i2c.c index fc60b74..850df44

[PATCH 0/5] Remove redundant NULL checks.

2013-02-11 Thread Cyril Roelandt
) { ... if (!param) return; ... } @@ identifier r.noop_func; expression E; statement S; @@ ( - if (E) noop_func(E); + noop_func(E); | - if (E) { noop_func(E); E = NULL; } + noop_func(E); + E = NULL; ) /smpl Regards, Cyril Roelandt --- Cyril Roelandt (5): radeon: Remove redundant NULL

[PATCH 1/5] radeon: Remove redundant NULL check before radeon_i2c_destroy().

2013-02-11 Thread Cyril Roelandt
radeon_i2c_destroy on a NULL pointer is a no-op. Signed-off-by: Cyril Roelandt tipec...@gmail.com --- drivers/gpu/drm/radeon/radeon_i2c.c |6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_i2c.c b/drivers/gpu/drm/radeon/radeon_i2c.c index

[PATCH 2/5] iommu: remove redundant NULL check before dma_ops_domain_free().

2013-02-11 Thread Cyril Roelandt
dma_ops_domain_free on a NULL pointer is a no-op, so the NULL check in amd_iommu_init_dma_ops() can be removed. Signed-off-by: Cyril Roelandt tipec...@gmail.com --- drivers/iommu/amd_iommu.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/iommu/amd_iommu.c b

[PATCH 4/5] staging: tidspbridge: remove redundant NULL check before delete_msg_mgr().

2013-02-11 Thread Cyril Roelandt
delete_msg_mgr on a NULL pointer is a no-op, so the NULL check in bridge_msg_delete can be removed. Signed-off-by: Cyril Roelandt tipec...@gmail.com --- drivers/staging/tidspbridge/core/msg_sm.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/tidspbridge

[PATCH 5/5] xen: remove redundant NULL check before unregister_and_remove_pcpu().

2013-02-11 Thread Cyril Roelandt
unregister_and_remove_pcpu on a NULL pointer is a no-op, so the NULL check in sync_pcpu can be removed. Signed-off-by: Cyril Roelandt tipec...@gmail.com --- drivers/xen/pcpu.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/xen/pcpu.c b/drivers/xen/pcpu.c index

[PATCH 3/5] staging: dgrp: remove redundant NULL check before unregister_dgrp_device().

2013-02-11 Thread Cyril Roelandt
unregister_dgrp_device on a NULL pointer is a no-op, so the NULL checks in dgrp_remove_nd() can be removed. Signed-off-by: Cyril Roelandt tipec...@gmail.com --- drivers/staging/dgrp/dgrp_specproc.c |9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/staging

[PATCH] mwifiex: avoid out of bounds access in mwifiex_get_common_rates.

2013-01-27 Thread Cyril Roelandt
Check that the array indexes are in-bounds before accessing the rate2 and tmp arrays. Found with the following semantic patch: @@ identifier t; identifier idx; expression E; statement S; @@ * for (... ; <+... t[idx] ...+> && idx < E ; ...) S Signed-off-by: Cyril Roelandt

[PATCH] mwifiex: avoid out of bounds access in mwifiex_get_common_rates.

2013-01-27 Thread Cyril Roelandt
Check that the array indexes are in-bounds before accessing the rate2 and tmp arrays. Found with the following semantic patch: smpl @@ identifier t; identifier idx; expression E; statement S; @@ * for (... ; +... t[idx] ...+ idx E ; ...) S /smpl Signed-off-by: Cyril Roelandt tipec

[PATCH 1/5] staging: omap-thermal: fix error check in omap_thermal_expose_sensor() and in omap_thermal_register_cpu_cooling().

2012-12-11 Thread Cyril Roelandt
The omap_bandgap_get_sensor_data() function returns ERR_PTR(), so we need to use IS_ERR() rather than a NULL check. Signed-off-by: Cyril Roelandt --- drivers/staging/omap-thermal/omap-thermal-common.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging

[PATCH 2/5] media: davinci: fix return value check in vpbe_display_reqbufs().

2012-12-11 Thread Cyril Roelandt
vb2_dma_contig_init_ctx() returns ERR_PTR and never returns NULL, so IS_ERR should be used instead of a NULL check. Signed-off-by: Cyril Roelandt --- drivers/media/platform/davinci/vpbe_display.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform

[PATCH 0/5] Use IS_ERR() rather than a NULL check when necessary.

2012-12-11 Thread Cyril Roelandt
The following five patches replace NULL checks by calls to IS_ERR() when checking the return values of functions that return ERR_PTR() on error. Regards, Cyril Roelandt. --- Cyril Roelandt (5): staging: omap-thermal: fix error check in omap_thermal_expose_sensor

[PATCH 4/5] net: sfc: fix return value check in efx_ptp_probe_channel().

2012-12-11 Thread Cyril Roelandt
The ptp_clock_register() returns ERR_PTR() and never returns NULL. Replace the NULL check by a call to IS_ERR(). Signed-off-by: Cyril Roelandt --- drivers/net/ethernet/sfc/ptp.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/sfc/ptp.c b/drivers/net

[PATCH 3/5] c2port: fix return value check in duramar2150_c2port_init().

2012-12-11 Thread Cyril Roelandt
The c2port_device_register() function returns ERR_PTR() and never returns NULL, so the NULL check should be replaced by a call to IS_ERR(). Signed-off-by: Cyril Roelandt --- drivers/misc/c2port/c2port-duramar2150.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers

[PATCH 5/5] spi: fix return value check in hspi_probe().

2012-12-11 Thread Cyril Roelandt
According to its documentation, clk_get() returns a "valid IS_ERR() condition containing errno", so we should call IS_ERR() rather than a NULL check. Signed-off-by: Cyril Roelandt --- drivers/spi/spi-sh-hspi.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/d

[PATCH 5/5] spi: fix return value check in hspi_probe().

2012-12-11 Thread Cyril Roelandt
According to its documentation, clk_get() returns a valid IS_ERR() condition containing errno, so we should call IS_ERR() rather than a NULL check. Signed-off-by: Cyril Roelandt tipec...@gmail.com --- drivers/spi/spi-sh-hspi.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH 3/5] c2port: fix return value check in duramar2150_c2port_init().

2012-12-11 Thread Cyril Roelandt
The c2port_device_register() function returns ERR_PTR() and never returns NULL, so the NULL check should be replaced by a call to IS_ERR(). Signed-off-by: Cyril Roelandt tipec...@gmail.com --- drivers/misc/c2port/c2port-duramar2150.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH 4/5] net: sfc: fix return value check in efx_ptp_probe_channel().

2012-12-11 Thread Cyril Roelandt
The ptp_clock_register() returns ERR_PTR() and never returns NULL. Replace the NULL check by a call to IS_ERR(). Signed-off-by: Cyril Roelandt tipec...@gmail.com --- drivers/net/ethernet/sfc/ptp.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/sfc

[PATCH 0/5] Use IS_ERR() rather than a NULL check when necessary.

2012-12-11 Thread Cyril Roelandt
The following five patches replace NULL checks by calls to IS_ERR() when checking the return values of functions that return ERR_PTR() on error. Regards, Cyril Roelandt. --- Cyril Roelandt (5): staging: omap-thermal: fix error check in omap_thermal_expose_sensor

[PATCH 2/5] media: davinci: fix return value check in vpbe_display_reqbufs().

2012-12-11 Thread Cyril Roelandt
vb2_dma_contig_init_ctx() returns ERR_PTR and never returns NULL, so IS_ERR should be used instead of a NULL check. Signed-off-by: Cyril Roelandt tipec...@gmail.com --- drivers/media/platform/davinci/vpbe_display.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers

[PATCH 1/5] staging: omap-thermal: fix error check in omap_thermal_expose_sensor() and in omap_thermal_register_cpu_cooling().

2012-12-11 Thread Cyril Roelandt
The omap_bandgap_get_sensor_data() function returns ERR_PTR(), so we need to use IS_ERR() rather than a NULL check. Signed-off-by: Cyril Roelandt tipec...@gmail.com --- drivers/staging/omap-thermal/omap-thermal-common.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

[PATCH 1/1] media: saa7146: don't use mutex_lock_interruptible() in device_release().

2012-12-10 Thread Cyril Roelandt
)) return -ERESTARTSYS; + mutex_lock(E); ... } Signed-off-by: Cyril Roelandt --- drivers/media/common/saa7146/saa7146_fops.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/media/common/saa7146/saa7146_fops.c b/drivers/media/common/saa7146/saa7146_fops.c index

[PATCH 0/1] media: saa7146: don't use mutex_lock_interruptible in

2012-12-10 Thread Cyril Roelandt
fixed a few of these issues, since I could not formulate it better. --- Cyril Roelandt (1): media: saa7146: don't use mutex_lock_interruptible() in device_release(). drivers/media/common/saa7146/saa7146_fops.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- 1.7.10.4

[PATCH v2] staging: rtl8712: avoid a useless call to memset().

2012-12-10 Thread Cyril Roelandt
In r8711_wx_get_wap(), make sure we do not call memcpy() on a memory area that has just been zeroed by a call to memset(). Signed-off-by: Cyril Roelandt --- drivers/staging/rtl8712/rtl871x_ioctl_linux.c |8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers

[PATCH v2] staging: rtl8712: avoid a useless call to memset().

2012-12-10 Thread Cyril Roelandt
In r8711_wx_get_wap(), make sure we do not call memcpy() on a memory area that has just been zeroed by a call to memset(). Signed-off-by: Cyril Roelandt tipec...@gmail.com --- drivers/staging/rtl8712/rtl871x_ioctl_linux.c |8 1 file changed, 4 insertions(+), 4 deletions(-) diff

[PATCH 0/1] media: saa7146: don't use mutex_lock_interruptible in

2012-12-10 Thread Cyril Roelandt
fixed a few of these issues, since I could not formulate it better. --- Cyril Roelandt (1): media: saa7146: don't use mutex_lock_interruptible() in device_release(). drivers/media/common/saa7146/saa7146_fops.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- 1.7.10.4

[PATCH 1/1] media: saa7146: don't use mutex_lock_interruptible() in device_release().

2012-12-10 Thread Cyril Roelandt
)) return -ERESTARTSYS; + mutex_lock(E); ... } /spml Signed-off-by: Cyril Roelandt tipec...@gmail.com --- drivers/media/common/saa7146/saa7146_fops.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/media/common/saa7146/saa7146_fops.c b/drivers/media/common/saa7146

Re: [PATCH] staging: rtl8712: avoid a useless call to memset().

2012-12-08 Thread Cyril Roelandt
On 12/05/2012 08:11 AM, Dan Carpenter wrote: On Wed, Dec 05, 2012 at 02:22:02AM +0100, Cyril Roelandt wrote: In r8711_wx_get_wap(), make sure we do not call memcpy() on a memory area that has just been zeroed by a call to memset(). I look at it like the original code is fine. Your version

Re: [PATCH] staging: rtl8712: avoid a useless call to memset().

2012-12-08 Thread Cyril Roelandt
On 12/05/2012 08:11 AM, Dan Carpenter wrote: On Wed, Dec 05, 2012 at 02:22:02AM +0100, Cyril Roelandt wrote: In r8711_wx_get_wap(), make sure we do not call memcpy() on a memory area that has just been zeroed by a call to memset(). I look at it like the original code is fine. Your version

[PATCH] staging: rtl8712: avoid a useless call to memset().

2012-12-04 Thread Cyril Roelandt
In r8711_wx_get_wap(), make sure we do not call memcpy() on a memory area that has just been zeroed by a call to memset(). Signed-off-by: Cyril Roelandt --- drivers/staging/rtl8712/rtl871x_ioctl_linux.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging

[PATCH] staging: csr: remove unneeded call to memset().

2012-12-04 Thread Cyril Roelandt
In uf_send_pkt_to_encrypt(), the memory area zeroed by this call to memset() is overwritten by a call to memcpy() a few instructions later, so it is not needed. Signed-off-by: Cyril Roelandt --- drivers/staging/csr/unifi_sme.c |1 - 1 file changed, 1 deletion(-) diff --git a/drivers

[PATCH] staging: wlags49_h2: remove unneeded memset() in wireless_get_bssid()

2012-12-04 Thread Cyril Roelandt
A few lines after this call, we memcpy over the same memory area, so the call to memset is not necessary. Signed-off-by: Cyril Roelandt --- drivers/staging/wlags49_h2/wl_wext.c |2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/wlags49_h2/wl_wext.c b/drivers/staging

[PATCH] staging: wlags49_h2: remove unneeded memset() in wireless_get_bssid()

2012-12-04 Thread Cyril Roelandt
A few lines after this call, we memcpy over the same memory area, so the call to memset is not necessary. Signed-off-by: Cyril Roelandt tipec...@gmail.com --- drivers/staging/wlags49_h2/wl_wext.c |2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/wlags49_h2/wl_wext.c b

[PATCH] staging: csr: remove unneeded call to memset().

2012-12-04 Thread Cyril Roelandt
In uf_send_pkt_to_encrypt(), the memory area zeroed by this call to memset() is overwritten by a call to memcpy() a few instructions later, so it is not needed. Signed-off-by: Cyril Roelandt tipec...@gmail.com --- drivers/staging/csr/unifi_sme.c |1 - 1 file changed, 1 deletion(-) diff

[PATCH] staging: rtl8712: avoid a useless call to memset().

2012-12-04 Thread Cyril Roelandt
In r8711_wx_get_wap(), make sure we do not call memcpy() on a memory area that has just been zeroed by a call to memset(). Signed-off-by: Cyril Roelandt tipec...@gmail.com --- drivers/staging/rtl8712/rtl871x_ioctl_linux.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git

[PATCH 4/6] scsi: megaraid: remove a useless call to memset().

2012-12-01 Thread Cyril Roelandt
This call is followed by a call to memcpy() on the same memory area, so it can be safely removed. Signed-off-by: Cyril Roelandt --- drivers/scsi/megaraid/megaraid_sas_fusion.c |2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi

[PATCH 3/6] scsi: bnx2fc: remove useless calls to memset().

2012-12-01 Thread Cyril Roelandt
These calls are followed by calls to memcpy() on the same memory area, so they can be safely removed. Signed-off-by: Cyril Roelandt --- drivers/scsi/bnx2fc/bnx2fc_hwi.c |4 1 file changed, 4 deletions(-) diff --git a/drivers/scsi/bnx2fc/bnx2fc_hwi.c b/drivers/scsi/bnx2fc/bnx2fc_hwi.c

[PATCH 6/6] vt6656: remove a useless call to memset().

2012-12-01 Thread Cyril Roelandt
This call is followed by a call to memcpy() on the same memory area, so it can be safely removed. Signed-off-by: Cyril Roelandt --- drivers/staging/vt6656/bssdb.c |1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/vt6656/bssdb.c b/drivers/staging/vt6656/bssdb.c index 6a13941

[PATCH 5/6] rtl8712: remove useless calls to memset().

2012-12-01 Thread Cyril Roelandt
These calls are followed by calls to memcpy() on the same memory area, so they can be safely removed. Signed-off-by: Cyril Roelandt --- drivers/staging/rtl8712/mlme_linux.c|2 -- drivers/staging/rtl8712/rtl871x_cmd.c |1 - drivers/staging/rtl8712/rtl871x_ioctl_set.c |2

[PATCH 1/6] bna: remove useless calls to memset().

2012-12-01 Thread Cyril Roelandt
These calls are followed by calls to memcpy() on the same memory area, so they can safely be removed. Signed-off-by: Cyril Roelandt --- drivers/net/ethernet/brocade/bna/bfa_ioc.c |4 1 file changed, 4 deletions(-) diff --git a/drivers/net/ethernet/brocade/bna/bfa_ioc.c b/drivers/net

[PATCH 2/6] scsi: bfa: remove useless calls to memset().

2012-12-01 Thread Cyril Roelandt
These calls are followed by calls to memcpy() on the same memory area, so they can safely be removed. Signed-off-by: Cyril Roelandt --- drivers/scsi/bfa/bfa_ioc.c |1 - drivers/scsi/bfa/bfad_bsg.c |1 - 2 files changed, 2 deletions(-) diff --git a/drivers/scsi/bfa/bfa_ioc.c b/drivers

[PATCH 0/6] Remove useless calls to memset().

2012-12-01 Thread Cyril Roelandt
The following six patches remove useless calls to memset(). They have been found with this Coccinelle script: @@ expression E; expression S; @@ -memset(E, 0, S); memcpy(E, ..., S); They have only been tested by compilation. WBR, Cyril Roelandt. Cyril Roelandt (6): bna: remove useless

[PATCH 0/6] Remove useless calls to memset().

2012-12-01 Thread Cyril Roelandt
The following six patches remove useless calls to memset(). They have been found with this Coccinelle script: spml @@ expression E; expression S; @@ -memset(E, 0, S); memcpy(E, ..., S); /spml They have only been tested by compilation. WBR, Cyril Roelandt. Cyril Roelandt (6): bna: remove

[PATCH 2/6] scsi: bfa: remove useless calls to memset().

2012-12-01 Thread Cyril Roelandt
These calls are followed by calls to memcpy() on the same memory area, so they can safely be removed. Signed-off-by: Cyril Roelandt tipec...@gmail.com --- drivers/scsi/bfa/bfa_ioc.c |1 - drivers/scsi/bfa/bfad_bsg.c |1 - 2 files changed, 2 deletions(-) diff --git a/drivers/scsi/bfa

[PATCH 1/6] bna: remove useless calls to memset().

2012-12-01 Thread Cyril Roelandt
These calls are followed by calls to memcpy() on the same memory area, so they can safely be removed. Signed-off-by: Cyril Roelandt tipec...@gmail.com --- drivers/net/ethernet/brocade/bna/bfa_ioc.c |4 1 file changed, 4 deletions(-) diff --git a/drivers/net/ethernet/brocade/bna

[PATCH 5/6] rtl8712: remove useless calls to memset().

2012-12-01 Thread Cyril Roelandt
These calls are followed by calls to memcpy() on the same memory area, so they can be safely removed. Signed-off-by: Cyril Roelandt tipec...@gmail.com --- drivers/staging/rtl8712/mlme_linux.c|2 -- drivers/staging/rtl8712/rtl871x_cmd.c |1 - drivers/staging/rtl8712

[PATCH 6/6] vt6656: remove a useless call to memset().

2012-12-01 Thread Cyril Roelandt
This call is followed by a call to memcpy() on the same memory area, so it can be safely removed. Signed-off-by: Cyril Roelandt tipec...@gmail.com --- drivers/staging/vt6656/bssdb.c |1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/vt6656/bssdb.c b/drivers/staging/vt6656

[PATCH 3/6] scsi: bnx2fc: remove useless calls to memset().

2012-12-01 Thread Cyril Roelandt
These calls are followed by calls to memcpy() on the same memory area, so they can be safely removed. Signed-off-by: Cyril Roelandt tipec...@gmail.com --- drivers/scsi/bnx2fc/bnx2fc_hwi.c |4 1 file changed, 4 deletions(-) diff --git a/drivers/scsi/bnx2fc/bnx2fc_hwi.c b/drivers/scsi

[PATCH 4/6] scsi: megaraid: remove a useless call to memset().

2012-12-01 Thread Cyril Roelandt
This call is followed by a call to memcpy() on the same memory area, so it can be safely removed. Signed-off-by: Cyril Roelandt tipec...@gmail.com --- drivers/scsi/megaraid/megaraid_sas_fusion.c |2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c

[PATCH v2] UVC: use GFP_ATOMIC under spin lock.

2012-11-24 Thread Cyril Roelandt
Found using the following semantic patch: @@ @@ spin_lock_irqsave(...); ... when != spin_unlock_irqrestore(...); * GFP_KERNEL Signed-off-by: Cyril Roelandt --- drivers/usb/gadget/uvc_video.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/usb/gadget

[PATCH v2] UVC: use GFP_ATOMIC under spin lock.

2012-11-24 Thread Cyril Roelandt
Found using the following semantic patch: spml @@ @@ spin_lock_irqsave(...); ... when != spin_unlock_irqrestore(...); * GFP_KERNEL /spml Signed-off-by: Cyril Roelandt tipec...@gmail.com --- drivers/usb/gadget/uvc_video.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git

Re: [PATCH] acpi_system_write_wakeup_device(): fix error check for unsigned variable.

2012-11-22 Thread Cyril Roelandt
On 11/21/2012 01:44 AM, Rafael J. Wysocki wrote: On Saturday, November 17, 2012 02:54:23 AM Cyril Roelandt wrote: The LEN variable is unsigned, therefore checking whether it is less than 0 is useless. Signed-off-by: Cyril Roelandt --- drivers/acpi/proc.c |2 -- 1 file changed, 2

Re: [PATCH] acpi_system_write_wakeup_device(): fix error check for unsigned variable.

2012-11-22 Thread Cyril Roelandt
On 11/22/2012 01:23 AM, Rafael J. Wysocki wrote: On Thursday, November 22, 2012 01:05:30 AM Cyril Roelandt wrote: On 11/21/2012 01:44 AM, Rafael J. Wysocki wrote: On Saturday, November 17, 2012 02:54:23 AM Cyril Roelandt wrote: The LEN variable is unsigned, therefore checking whether

[PATCH v2] acpi_system_write_wakeup_device(): fix error check for unsigned variable.

2012-11-22 Thread Cyril Roelandt
The LEN variable is unsigned, therefore checking whether it is less than 0 is useless. Also drop the LEN variable, since the COUNT parameter can be used instead. Signed-off-by: Cyril Roelandt --- drivers/acpi/proc.c | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git

[PATCH v2] acpi_system_write_wakeup_device(): fix error check for unsigned variable.

2012-11-22 Thread Cyril Roelandt
The LEN variable is unsigned, therefore checking whether it is less than 0 is useless. Also drop the LEN variable, since the COUNT parameter can be used instead. Signed-off-by: Cyril Roelandt tipec...@gmail.com --- drivers/acpi/proc.c | 11 --- 1 file changed, 4 insertions(+), 7

Re: [PATCH] acpi_system_write_wakeup_device(): fix error check for unsigned variable.

2012-11-22 Thread Cyril Roelandt
On 11/22/2012 01:23 AM, Rafael J. Wysocki wrote: On Thursday, November 22, 2012 01:05:30 AM Cyril Roelandt wrote: On 11/21/2012 01:44 AM, Rafael J. Wysocki wrote: On Saturday, November 17, 2012 02:54:23 AM Cyril Roelandt wrote: The LEN variable is unsigned, therefore checking whether

Re: [PATCH] acpi_system_write_wakeup_device(): fix error check for unsigned variable.

2012-11-22 Thread Cyril Roelandt
On 11/21/2012 01:44 AM, Rafael J. Wysocki wrote: On Saturday, November 17, 2012 02:54:23 AM Cyril Roelandt wrote: The LEN variable is unsigned, therefore checking whether it is less than 0 is useless. Signed-off-by: Cyril Roelandttipec...@gmail.com --- drivers/acpi/proc.c |2 -- 1 file

[PATCH] mx2_camera: use GFP_ATOMIC under spin lock.

2012-11-19 Thread Cyril Roelandt
Found using the following semantic patch: @@ @@ spin_lock_irqsave(...); ... when != spin_unlock_irqrestore(...); * GFP_KERNEL Signed-off-by: Cyril Roelandt --- drivers/media/platform/soc_camera/mx2_camera.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media

[PATCH] UVC: use GFP_ATOMIC under spin lock.

2012-11-19 Thread Cyril Roelandt
Found using the following semantic patch: @@ @@ spin_lock_irqsave(...); ... when != spin_unlock_irqrestore(...); * GFP_KERNEL Signed-off-by: Cyril Roelandt --- drivers/usb/gadget/uvc_video.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/gadget/uvc_video.c

[PATCH] UVC: use GFP_ATOMIC under spin lock.

2012-11-19 Thread Cyril Roelandt
Found using the following semantic patch: spml @@ @@ spin_lock_irqsave(...); ... when != spin_unlock_irqrestore(...); * GFP_KERNEL /spml Signed-off-by: Cyril Roelandt tipec...@gmail.com --- drivers/usb/gadget/uvc_video.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH] mx2_camera: use GFP_ATOMIC under spin lock.

2012-11-19 Thread Cyril Roelandt
Found using the following semantic patch: spml @@ @@ spin_lock_irqsave(...); ... when != spin_unlock_irqrestore(...); * GFP_KERNEL /spml Signed-off-by: Cyril Roelandt tipec...@gmail.com --- drivers/media/platform/soc_camera/mx2_camera.c |2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH] acpi_system_write_wakeup_device(): fix error check for unsigned variable.

2012-11-16 Thread Cyril Roelandt
The LEN variable is unsigned, therefore checking whether it is less than 0 is useless. Signed-off-by: Cyril Roelandt --- drivers/acpi/proc.c |2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/acpi/proc.c b/drivers/acpi/proc.c index 27adb09..37871a7 100644 --- a/drivers/acpi/proc.c

[PATCH] staging/media/solo6x10/v4l2-enc.c: fix error-handling.

2012-11-16 Thread Cyril Roelandt
= E; ...+> } * if (ret < 0) S Signed-off-by: Cyril Roelandt --- drivers/staging/media/solo6x10/v4l2-enc.c |4 1 file changed, 4 insertions(+) diff --git a/drivers/staging/media/solo6x10/v4l2-enc.c b/drivers/staging/media/solo6x10/v4l2-enc.c index f8f0da9..4977e86 100644 ---

[PATCH] staging/media/solo6x10/v4l2-enc.c: fix error-handling.

2012-11-16 Thread Cyril Roelandt
= E; ...+ } * if (ret 0) S /spml Signed-off-by: Cyril Roelandt tipec...@gmail.com --- drivers/staging/media/solo6x10/v4l2-enc.c |4 1 file changed, 4 insertions(+) diff --git a/drivers/staging/media/solo6x10/v4l2-enc.c b/drivers/staging/media/solo6x10/v4l2-enc.c index f8f0da9..4977e86

[PATCH] acpi_system_write_wakeup_device(): fix error check for unsigned variable.

2012-11-16 Thread Cyril Roelandt
The LEN variable is unsigned, therefore checking whether it is less than 0 is useless. Signed-off-by: Cyril Roelandt tipec...@gmail.com --- drivers/acpi/proc.c |2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/acpi/proc.c b/drivers/acpi/proc.c index 27adb09..37871a7 100644

[PATCH] net/ethernet/intel/ixgbe/ixgbe_debugfs.c: fix error handling in ixgbe_dbg_reg_ops_read().

2012-11-15 Thread Cyril Roelandt
copy_to_user() cannot return a negative value: it returns the number of bytes that could not be copied. Return -EFAULT on failure rather than the number of bytes that could not be copied, as this seems more standard. Signed-off-by: Cyril Roelandt --- drivers/net/ethernet/intel/ixgbe

[PATCH] net/ethernet/intel/ixgbe/ixgbe_debugfs.c: fix error handling in ixgbe_dbg_reg_ops_read().

2012-11-15 Thread Cyril Roelandt
copy_to_user() cannot return a negative value: it returns the number of bytes that could not be copied. Return -EFAULT on failure rather than the number of bytes that could not be copied, as this seems more standard. Signed-off-by: Cyril Roelandt tipec...@gmail.com --- drivers/net/ethernet

[PATCH 1/3] Coccinelle: Add api/d_find_alias.cocci.

2012-11-11 Thread Cyril Roelandt
Ensure that calls to d_find_alias() have a corresponding dput(). Signed-off-by: Cyril Roelandt --- scripts/coccinelle/api/d_find_alias.cocci | 80 + 1 file changed, 80 insertions(+) create mode 100644 scripts/coccinelle/api/d_find_alias.cocci diff --git a/scripts

[PATCH 2/3] iommu/tegra-smmu.c: fix dentry reference leak in smmu_debugfs_stats_show().

2012-11-11 Thread Cyril Roelandt
Call to d_find_alias() needs a corresponding dput(). Signed-off-by: Cyril Roelandt --- drivers/iommu/tegra-smmu.c |1 + 1 file changed, 1 insertion(+) diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c index 4167863..4252d74 100644 --- a/drivers/iommu/tegra-smmu.c +++ b

[PATCH 3/3] ceph: fix dentry reference leak in ceph_encode_fh().

2012-11-11 Thread Cyril Roelandt
dput() was not called in the error path. Signed-off-by: Cyril Roelandt --- fs/ceph/export.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/ceph/export.c b/fs/ceph/export.c index 9349bb3..ca3ab3f 100644 --- a/fs/ceph/export.c +++ b/fs/ceph/export.c @@ -56,13 +56,15

[PATCH 0/3] Use dput() after d_find_alias().

2012-11-11 Thread Cyril Roelandt
Hello, A call to d_find_alias() needs a corresponding call to dput() in order to avoid resource leaks. The first patch is a Coccinelle scripts that looks for missing calls to dput(). The other two patches add calls to dput() where needed. WBR, Cyril Roelandt. -- To unsubscribe from this list

[PATCH 0/3] Use dput() after d_find_alias().

2012-11-11 Thread Cyril Roelandt
Hello, A call to d_find_alias() needs a corresponding call to dput() in order to avoid resource leaks. The first patch is a Coccinelle scripts that looks for missing calls to dput(). The other two patches add calls to dput() where needed. WBR, Cyril Roelandt. -- To unsubscribe from this list

[PATCH 3/3] ceph: fix dentry reference leak in ceph_encode_fh().

2012-11-11 Thread Cyril Roelandt
dput() was not called in the error path. Signed-off-by: Cyril Roelandt tipec...@gmail.com --- fs/ceph/export.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/ceph/export.c b/fs/ceph/export.c index 9349bb3..ca3ab3f 100644 --- a/fs/ceph/export.c +++ b/fs/ceph/export.c

[PATCH 2/3] iommu/tegra-smmu.c: fix dentry reference leak in smmu_debugfs_stats_show().

2012-11-11 Thread Cyril Roelandt
Call to d_find_alias() needs a corresponding dput(). Signed-off-by: Cyril Roelandt tipec...@gmail.com --- drivers/iommu/tegra-smmu.c |1 + 1 file changed, 1 insertion(+) diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c index 4167863..4252d74 100644 --- a/drivers/iommu

[PATCH 1/3] Coccinelle: Add api/d_find_alias.cocci.

2012-11-11 Thread Cyril Roelandt
Ensure that calls to d_find_alias() have a corresponding dput(). Signed-off-by: Cyril Roelandt tipec...@gmail.com --- scripts/coccinelle/api/d_find_alias.cocci | 80 + 1 file changed, 80 insertions(+) create mode 100644 scripts/coccinelle/api/d_find_alias.cocci