Re: [v3] UCC_GETH/UCC_FAST: Use IS_ERR_VALUE_U32 API to avoid IS_ERR_VALUE abuses.

2016-07-27 Thread arvind Yadav
I am also agree with Arnd Bergmann. We should use 'static inline function' instead of macro to deal with error check. On Tuesday 26 July 2016 05:09 PM, Arnd Bergmann wrote: On Saturday, July 23, 2016 11:35:51 PM CEST Arvind Yadav wrote: diff --git a/include/linux/err.h b/include/linux/err.h

[v4] Fix to avoid IS_ERR_VALUE and IS_ERR abuses on 64bit systems.

2016-07-31 Thread Arvind Yadav
4bit system as well. First 32bit of Value of (unsigned int)-4095 and (unsigned long)-4095 will be equal. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- include/linux/err.h | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/include/linux/err.h b/in

Re: [v4] Fix to avoid IS_ERR_VALUE and IS_ERR abuses on 64bit systems.

2016-08-02 Thread arvind Yadav
On Tuesday 02 August 2016 01:15 PM, Arnd Bergmann wrote: On Monday, August 1, 2016 4:55:43 PM CEST Scott Wood wrote: On 08/01/2016 02:02 AM, Arnd Bergmann wrote: diff --git a/include/linux/err.h b/include/linux/err.h index 1e35588..c2a2789 100644 --- a/include/linux/err.h +++

Re: [PATCH] Remove lots of IS_ERR_VALUE abuses.

2016-07-07 Thread arvind Yadav
As per your concern, I have change commit message. Submit other patch. Thanks, Arvind Yadav On Thursday 07 July 2016 01:40 PM, Arnd Bergmann wrote: On Thursday, July 7, 2016 12:47:43 AM CEST Arvind Yadav wrote: Most users of IS_ERR_VALUE() in the kernel are wrong, as they pass

[PATCH] Removing lots of IS_ERR_VALUE abuses and compilation warning.

2016-07-07 Thread Arvind Yadav
fixes lots of other worst abusers. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/net/ethernet/freescale/ucc_geth.c | 30 +++--- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/drivers/net/ethernet/freescale/ucc_geth.c b/d

[PATCH] Removing lots of IS_ERR_VALUE abuses and compilation warning.

2016-07-07 Thread Arvind Yadav
-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/net/ethernet/freescale/ucc_geth.c | 30 +++--- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/drivers/net/ethernet/freescale/ucc_geth.c b/drivers/net/ethernet/freescale/ucc_geth.c index 5

[PATCH] Remove lots of IS_ERR_VALUE abuses and compilation warning.

2016-07-07 Thread Arvind Yadav
fixes lots of other worst abusers. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/soc/fsl/qe/ucc_fast.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/soc/fsl/qe/ucc_fast.c b/drivers/soc/fsl/qe/ucc_fast.c index a768931..7cc783c

[PATCH] Need proper type casting before assignment, Remove compilation Warning.

2016-07-07 Thread Arvind Yadav
, as are 8-bit integers and types that are wider than 'unsigned long'. -Any user will get compilation warning for that do not pass an unsigned long' argument. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/soc/fsl/qe/ucc_fast.c | 11 +++ 1 file changed, 7 inse

Re: Remove lots of IS_ERR_VALUE abuses and compilation warning.

2016-07-07 Thread arvind Yadav
in IS_ERR_VALUE() is wrong. So this is also need a proper type casting before passing an argument. I have done the changes and re-submitted anther patch, Please review It. Thanks, Arvind On Thursday 07 July 2016 09:21 PM, Guenter Roeck wrote: On Thu, Jul 07, 2016 at 08:57:29PM +0530, Arvind Yadav

[PATCH] Removing lots of IS_ERR_VALUE abuses and compilation warning.

2016-07-07 Thread Arvind Yadav
fixes lots of other worst abusers. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/net/ethernet/freescale/ucc_geth.c | 30 +++--- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/drivers/net/ethernet/freescale/ucc_geth.c b/d

Re: Removing lots of IS_ERR_VALUE abuses and compilation warning.

2016-07-07 Thread arvind Yadav
_VALUE((unsigned long)ugeth->rx_bd_ring_offset[j])) I have done the changes and re-submitted anther patch, Please review It. Thanks, Arvind On Thursday 07 July 2016 10:47 PM, Guenter Roeck wrote: On Thu, Jul 07, 2016 at 09:30:14PM +0530, Arvind Yadav wrote: Passing value in IS_

[PATCH] Need proper type casting before assignment, Remove compilation Warning.

2016-07-07 Thread Arvind Yadav
, as are 8-bit integers and types that are wider than 'unsigned long'. -Any user will get compilation warning for that do not pass an unsigned long' argument. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/net/ethernet/freescale/ucc_geth.

[PATCH] Remove lots of IS_ERR_VALUE abuses.

2016-07-06 Thread Arvind Yadav
h the most plausible interpretation of what IS_ERR_VALUE() was supposed to return according to its users, but also causes a compile-time warning for any users that do not pass an 'unsigned long' argument. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/net/ethernet/

[PATCH] Remove lots of IS_ERR_VALUE abuses.

2016-07-06 Thread Arvind Yadav
most plausible interpretation of what IS_ERR_VALUE() was supposed to return according to its users, but also causes a compile-time warning for any users that do not pass an 'unsigned long' argument. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/soc/fsl/qe/ucc_fas

Re: Need proper type casting before assignment, Remove compilation Warning.

2016-07-08 Thread arvind Yadav
ets converted into an unsigned type. However, anything that passes an 'unsigned short' or 'unsigned int' argument into IS_ERR_VALUE() is guaranteed to be broken, as are 8-bit integers and types that are wider than 'unsigned long'. Thanks, Arvind Yadav On Friday 08 July 2016 09:03 PM, Guenter Roeck wrote: O

[PATCH v1] Specific requirement of type casting for 64-bit architectures.

2016-07-08 Thread Arvind Yadav
IS_ERR_VALUE() is guaranteed to be broken, as are 8-bit integers and types that are wider than 'unsigned long'. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/soc/fsl/qe/ucc_fast.c | 21 ++--- 1 file changed, 14 insertions(+), 7 deletions(-) diff --gi

[PATCH v1] Specific requirement of type casting for 64-bit architectures.

2016-07-08 Thread Arvind Yadav
IS_ERR_VALUE() is guaranteed to be broken, as are 8-bit integers and types that are wider than 'unsigned long'. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/soc/fsl/qe/ucc_fast.c | 21 ++--- 1 file changed, 14 insertions(+), 7 deletions(-) diff --gi

Re: Need proper type casting before assignment, Remove compilation Warning.

2016-07-08 Thread arvind Yadav
As per you concern, I have submitted one more patch with some changes. Please review it. Thanks, On Friday 08 July 2016 09:03 PM, Guenter Roeck wrote: On Thu, Jul 07, 2016 at 10:31:11PM +0530, Arvind Yadav wrote: -Return type of 'qe_muram_alloc' is 'unsigned long', That Was trying

Re: [v5.1] ucc_fast: Fix to avoid IS_ERR_VALUE abuses and dead code on 64bit systems.

2016-08-05 Thread arvind Yadav
On Friday 05 August 2016 02:01 AM, Arnd Bergmann wrote: On Thursday, August 4, 2016 10:22:43 PM CEST Arvind Yadav wrote: index df8ea79..ada9070 100644 --- a/include/soc/fsl/qe/ucc_fast.h +++ b/include/soc/fsl/qe/ucc_fast.h @@ -165,10 +165,12 @@ struct ucc_fast_private { int

[v5.2] ucc_slow: Fix to avoid IS_ERR_VALUE abuses and dead code on 64bit systems.

2016-08-05 Thread Arvind Yadav
t).If qe_muram_alloc will return any error, Then IS_ERR_VALUE will always return 0. it'll not call ucc_fast_free for any failure. Inside 'if code' will be a dead code on 64bit. Even qe_muram_addr will return wrong virtual address. Which can cause an error. This patch is to avoid this problem on 64bit

[5.3] ucc_geth: Fix to avoid IS_ERR_VALUE abuses and dead code on 64bit systems.

2016-08-08 Thread Arvind Yadav
rror, Then IS_ERR_VALUE will always return 0. it'll not call ucc_fast_free for any failure. Inside 'if code' will be a dead code on 64bit. Even qe_muram_addr will return wrong virtual address. Which can cause an error. kfree((void *)ugeth->tx_bd_ring_offset[i]); which is not 64-bit safe when tx_

Re: [v4] Fix to avoid IS_ERR_VALUE and IS_ERR abuses on 64bit systems.

2016-08-02 Thread arvind Yadav
On Tuesday 02 August 2016 01:15 PM, Arnd Bergmann wrote: On Monday, August 1, 2016 4:55:43 PM CEST Scott Wood wrote: On 08/01/2016 02:02 AM, Arnd Bergmann wrote: diff --git a/include/linux/err.h b/include/linux/err.h index 1e35588..c2a2789 100644 --- a/include/linux/err.h +++

[v3] UCC_GETH/UCC_FAST: Use IS_ERR_VALUE_U32 API to avoid IS_ERR_VALUE abuses.

2016-07-23 Thread Arvind Yadav
short' or 'unsigned int'argument into IS_ERR_VALUE() is guaranteed to be broken, as are 8-bit integers and types that are wider than 'unsigned long'. Any user will get compilation warning for that do not pass an unsigned long' argument. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.

Re: [v4] Fix to avoid IS_ERR_VALUE and IS_ERR abuses on 64bit systems.

2016-08-03 Thread arvind Yadav
On Wednesday 03 August 2016 01:27 AM, Scott Wood wrote: On 08/02/2016 10:34 AM, arvind Yadav wrote: On Tuesday 02 August 2016 01:15 PM, Arnd Bergmann wrote: On Monday, August 1, 2016 4:55:43 PM CEST Scott Wood wrote: On 08/01/2016 02:02 AM, Arnd Bergmann wrote: diff --git a/include/linux

[v5.1] ucc_fast: Fix to avoid IS_ERR_VALUE abuses and dead code on 64bit systems.

2016-08-04 Thread Arvind Yadav
oc will return any error, Then IS_ERR_VALUE will always return 0. it'll not call ucc_fast_free for any failure. Inside 'if code' will be a dead code on 64bit. This patch is to avoid this problem on 64bit machine. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- include/soc/fsl/qe/u

[PATCH] dma/fsldma : Unmap region obtained by of_iomap

2016-09-28 Thread Arvind Yadav
Free memory mapping, if probe is not successful. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/dma/fsldma.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/dma/fsldma.c b/drivers/dma/fsldma.c index 911b717..7ba8944 100644 --- a/drive

[PATCH 0/3] constify pci attribute_group structures.

2017-07-11 Thread Arvind Yadav
attribute_groups are not supposed to change at runtime. All functions working with attribute_groups provided by work with const attribute_group. So mark the non-const structs as const. Arvind Yadav (3): [PATCH 1/3] PCI: pci-sysfs: constify attribute_group structures. [PATCH 2/3] PCI: pci

[PATCH 3/3] PCI: hotplug: constify attribute_group structures.

2017-07-11 Thread Arvind Yadav
drivers/pci/hotplug/rpadlpar_sysfs.o File size After adding 'const': textdata bss dec hex filename 482 96 8 586 232 drivers/pci/hotplug/rpadlpar_sysfs.o Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/pci/hotplug/rpadlpar_sysfs.c | 2

[PATCH] net: ibm: ibmveth: constify dev_pm_ops structures.

2017-06-28 Thread Arvind Yadav
/ibm/ibmveth.o File size After adding 'const': textdata bss dec hex filename 156181064 0 16682412a drivers/net/ethernet/ibm/ibmveth.o Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/net/ethernet/ibm/ibmveth.c | 2 +- 1 file chan

[PATCH] scsi: ibmvscsi: constify dev_pm_ops structures.

2017-06-29 Thread Arvind Yadav
/ibmvscsi.o File size After adding 'const': textdata bss dec hex filename 181641264 8 194364bec drivers/scsi/ibmvscsi/ibmvscsi.o Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/scsi/ibmvscsi/ibmvscsi.c | 2 +- 1 file changed, 1 ins

[PATCH] scsi: ibmvfc: constify dev_pm_ops structures.

2017-06-29 Thread Arvind Yadav
/ibmvfc.o File size After adding 'const': textdata bss dec hex filename 421291104 20 43253a8f5 drivers/scsi/ibmvscsi/ibmvfc.o Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/scsi/ibmvscsi/ibmvfc.c | 2 +- 1 file changed, 1 insertion

[PATCH] crypto: nx: constify vio_device_id

2017-08-17 Thread Arvind Yadav
vio_device_id are not supposed to change at runtime. All functions working with vio_device_id provided by work with const vio_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/crypto/nx/nx.c | 2 +- 1 file changed, 1 ins

[PATCH] net: ibm: ibmveth: constify vio_device_id

2017-08-17 Thread Arvind Yadav
vio_device_id are not supposed to change at runtime. All functions working with vio_device_id provided by work with const vio_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/net/ethernet/ibm/ibmveth.c | 2 +- 1 file c

[PATCH 1/3] scsi: ibmvfc: constify vio_device_id

2017-08-17 Thread Arvind Yadav
vio_device_id are not supposed to change at runtime. All functions working with vio_device_id provided by work with const vio_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/scsi/ibmvscsi/ibmvfc.c | 2 +- 1 file chan

[PATCH 0/3] constify scsi vio_device_id

2017-08-17 Thread Arvind Yadav
vio_device_id are not supposed to change at runtime. All functions working with vio_device_id provided by work with const vio_device_id. So mark the non-const structs as const. Arvind Yadav (3): [PATCH 1/3] scsi: ibmvfc: constify vio_device_id [PATCH 2/3] scsi: ibmvscsi: constify

[PATCH] crypto: nx: 842: constify vio_device_id

2017-08-17 Thread Arvind Yadav
vio_device_id are not supposed to change at runtime. All functions working with vio_device_id provided by work with const vio_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/crypto/nx/nx-842-pseries.c | 2 +- 1 file c

[PATCH] tty: hvc_vio: constify vio_device_id

2017-08-17 Thread Arvind Yadav
vio_device_id are not supposed to change at runtime. All functions working with vio_device_id provided by work with const vio_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/tty/hvc/hvc_vio.c | 2 +- 1 file chan

[PATCH 3/3] scsi: ibmvscsi_tgt: constify vio_device_id

2017-08-17 Thread Arvind Yadav
vio_device_id are not supposed to change at runtime. All functions working with vio_device_id provided by work with const vio_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 2 +-

[PATCH] tty: hvcs: constify vio_device_id

2017-08-17 Thread Arvind Yadav
vio_device_id are not supposed to change at runtime. All functions working with vio_device_id provided by work with const vio_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/tty/hvc/hvcs.c | 2 +- 1 file changed, 1 ins

[PATCH 2/3] scsi: ibmvscsi: constify vio_device_id

2017-08-17 Thread Arvind Yadav
vio_device_id are not supposed to change at runtime. All functions working with vio_device_id provided by work with const vio_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/scsi/ibmvscsi/ibmvscsi.c | 2 +- 1 file chan

[PATCH] net: ibm: ibmvnic: constify vio_device_id

2017-08-17 Thread Arvind Yadav
vio_device_id are not supposed to change at runtime. All functions working with vio_device_id provided by work with const vio_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/net/ethernet/ibm/ibmvnic.c | 2 +- 1 file c

[PATCH] hwrng: pseries: constify vio_device_id

2017-08-17 Thread Arvind Yadav
vio_device_id are not supposed to change at runtime. All functions working with vio_device_id provided by work with const vio_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/char/hw_random/pseries-rng.c | 2 +-

[PATCH] macintosh: rack-meter: make of_device_ids const.

2017-06-18 Thread Arvind Yadav
/macintosh/rack-meter.o File size after constify keystone_qmss_of_match. textdata bss dec hex filename 807 176 0 983 3d7 drivers/macintosh/rack-meter.o Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/macintosh/rack-meter.c | 2 +-

[PATCH v2] macintosh: rack-meter: make of_device_ids const.

2017-06-18 Thread Arvind Yadav
/macintosh/rack-meter.o File size after constify rackmeter_match. textdata bss dec hex filename 807 176 0 983 3d7 drivers/macintosh/rack-meter.o Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- Changes in v1: Subject was wrong. It

[PATCH 2/3] ASoC: fsl-asoc-card: Handle return value of devm_kasprintf

2017-09-20 Thread Arvind Yadav
devm_kasprintf() can fail here and we must check its return value. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- sound/soc/fsl/fsl-asoc-card.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sound/soc/fsl/fsl-asoc-card.c b/sound/soc/fsl/fsl-asoc-card.c index 2db4d0c..8

[PATCH 3/3] ASoC: omap-hdmi-audio: Handle return value of devm_kasprintf

2017-09-20 Thread Arvind Yadav
devm_kasprintf() can fail here and we must check its return value. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- sound/soc/omap/omap-hdmi-audio.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sound/soc/omap/omap-hdmi-audio.c b/sound/soc/omap/omap-hdmi-audio.c index 3

[PATCH 0/3] ASoC: Handle return value of devm_kasprintf

2017-09-20 Thread Arvind Yadav
devm_kasprintf() can fail here and we must check its return value. Arvind Yadav (3): [PATCH 1/3] ASoC: davinci-mcasp: Handle return value of devm_kasprintf [PATCH 2/3] ASoC: fsl-asoc-card: Handle return value of devm_kasprintf [PATCH 3/3] ASoC: omap-hdmi-audio: Handle return value

[PATCH 1/3] ASoC: davinci-mcasp: Handle return value of devm_kasprintf

2017-09-20 Thread Arvind Yadav
devm_kasprintf() can fail here and we must check its return value. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- sound/soc/davinci/davinci-mcasp.c | 12 1 file changed, 12 insertions(+) diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/d

[PATCH v2 2/3] ASoC: fsl-asoc-card: Handle return value of devm_kasprintf

2017-09-20 Thread Arvind Yadav
devm_kasprintf() can fail here and we must check its return value. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- changes in v2: Set return 'ret' to -ENOMEM. sound/soc/fsl/fsl-asoc-card.c | 4 1 file changed, 4 insertions(+) diff --git a/sound/soc/fsl/fs

[PATCH] powerpc: 4xx: constify platform_suspend_ops

2017-08-30 Thread Arvind Yadav
platform_suspend_ops are not supposed to change at runtime. Functions suspend_set_ops working with const platform_suspend_ops. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- arch/powerpc/sysdev/ppc4xx_cpm.c | 2 +- 1 file changed, 1 ins

[PATCH] powerpc/512x: clk: constify clk_div_table

2017-08-28 Thread Arvind Yadav
clk_div_table are not supposed to change at runtime. mpc512x_clk_divtable function working with const clk_div_table. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- arch/powerpc/platforms/512x/clock-commonclk.c | 4 ++-- 1 file chan

[PATCH] tpm: vtpm: constify vio_device_id

2017-08-17 Thread Arvind Yadav
vio_device_id are not supposed to change at runtime. All functions working with vio_device_id provided by work with const vio_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/char/tpm/tpm_ibmvtpm.c | 2 +- 1 file chan

[PATCH 2/2] misc: ocxl: use put_device() instead of device_unregister()

2018-03-12 Thread Arvind Yadav
if device_register() returned an error! Always use put_device() to give up the reference initialized. Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/misc/ocxl/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/misc/ocxl/pci.c b/driver

[PATCH 0/2] misc: use put_device() instead of kfree()

2018-03-12 Thread Arvind Yadav
Never directly free @dev after calling device_register(), even if it returned an error! Always use put_device() to give up the reference initialized. Arvind Yadav (2): [PATCH 1/2] misc: mic: Release reference count and memory for VOP device [PATCH 2/2] misc: ocxl: use put_device() instead

[PATCH 1/2] misc: mic: Release reference count and memory for VOP device

2018-03-12 Thread Arvind Yadav
Never directly free @dev after calling device_register(), even if it returned an error! Always use put_device() to give up the reference initialized. Release allocated memory for vop device in vop_release_dev(). Signed-off-by: Arvind Yadav <arvind.yadav...@gmail.com> --- drivers/misc/m