if device_register() returned an error! Always use put_device()
to give up the reference initialized.
Signed-off-by: Arvind Yadav
---
drivers/misc/ocxl/pci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/misc/ocxl/pci.c b/drivers/misc/ocxl/pci.c
index 0051d9e
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
---
drivers/misc/mic/bus/vop_bus.c | 6 --
1 file
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 of
devm_kasprintf() can fail here and we must check its return value.
Signed-off-by: Arvind Yadav
---
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/fsl-asoc-card.c b/sound/s
devm_kasprintf() can fail here and we must check its return value.
Signed-off-by: Arvind Yadav
---
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 3e9cc48..8eeac7c 100644
--- a
devm_kasprintf() can fail here and we must check its return value.
Signed-off-by: Arvind Yadav
---
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..86f240b 100644
--- a/sound/soc/fsl
devm_kasprintf() can fail here and we must check its return value.
Signed-off-by: Arvind Yadav
---
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/davinci-mcasp.c
index f395bbc..d1a4aa2
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 of
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
---
arch/powerpc/sysdev/ppc4xx_cpm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff
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
---
arch/powerpc/platforms/512x/clock-commonclk.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions
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
---
drivers/char/hw_random/pseries-rng.c | 2 +-
1 file changed, 1 insertion(+), 1
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
---
drivers/char/tpm/tpm_ibmvtpm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion
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
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
---
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 2 +-
1 file changed, 1 insertion(+), 1
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
---
drivers/scsi/ibmvscsi/ibmvscsi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion
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
---
drivers/scsi/ibmvscsi/ibmvfc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion
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
---
drivers/tty/hvc/hvcs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff
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
---
drivers/tty/hvc/hvc_vio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff
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
---
drivers/net/ethernet/ibm/ibmvnic.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion
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
---
drivers/net/ethernet/ibm/ibmveth.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion
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
---
drivers/crypto/nx/nx-842-pseries.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion
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
---
drivers/crypto/nx/nx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff
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
---
drivers/pci/hotplug/rpadlpar_sysfs.c | 2 +-
1 file changed, 1
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
/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
---
drivers/scsi/ibmvscsi/ibmvfc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
di
/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
---
drivers/scsi/ibmvscsi/ibmvscsi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
/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
---
drivers/net/ethernet/ibm/ibmveth.c | 2 +-
1 file changed, 1 insertion(+), 1 deletio
/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
---
Changes in v1:
Subject was wrong. It should be constify
/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
---
drivers/macintosh/rack-meter.c | 2 +-
1 file changed, 1 insertion(+), 1
Free memory mapping, if probe is not successful.
Signed-off-by: Arvind Yadav
---
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/drivers/dma/fsldma.c
+++ b/drivers/dma
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. Even qe_muram_addr will return wrong
virtual address. Which can cause an error.
kfree((void *)ugeth->tx_bd_ring_offset[i])
nd tx_base_offset).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
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
set).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.
This patch is to avoid this problem on 64bit machine.
Signed-off-by: Arvind Yadav
---
include/soc/fsl/qe
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
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
+++ b/include/linux/
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
+++ b/include/linux/
e comparison on 64bit system as well.
First 32bit of Value of (unsigned int)-4095 and (unsigned long)-4095 will
be equal.
Signed-off-by: Arvind Yadav
---
include/linux/err.h | 12 +++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/include/linux/err.h b/include/linux/err.
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/l
64-bit architectures before it gets converted into an
unsigned type.
Passing 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'.
Any user will get com
ything 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'.
Signed-off-by: Arvind Yadav
---
drivers/soc/fsl/qe/ucc_fast.c | 21 ++--
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'
the type is sign-extended
on 64-bit architectures before it gets 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 'u
ything 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'.
Signed-off-by: Arvind Yadav
---
drivers/soc/fsl/qe/ucc_fast.c | 21 ++--
j]))
+ if (!IS_ERR_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
igned 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
---
drivers/net/e
e casting.
-Passing value 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
igned 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
---
drivers/soc/fsl/
nge is alreday fixes lots of other
Worst abusers
Signed-off-by: Arvind Yadav
---
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/freescal
argument.
Commit '287980e49f; - This change is alreday fixes lots of other
worst abusers.
Signed-off-by: Arvind Yadav
---
drivers/net/ethernet/freescale/ucc_geth.c | 30 +++---
1 file changed, 15 insertions(+), 15 deletions(-)
diff --git a/drivers/ne
argument.
Commit '287980e49f; - This change is alreday fixes lots of other
worst abusers.
Signed-off-by: Arvind Yadav
---
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/
argument.
Commit '287980e49f; - This change is alreday fixes lots of other
worst abusers.
Signed-off-by: Arvind Yadav
---
drivers/net/ethernet/freescale/ucc_geth.c | 30 +++---
1 file changed, 15 insertions(+), 15 deletions(-)
diff --git a/drivers/ne
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 an
NO))
which ends up making all 16-bit or wider types work correctly with
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.
))-MAX_ERRNO))
which ends up making all 16-bit or wider types work correctly with
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 'un
55 matches
Mail list logo