[patch v2] spi/xilinx: signedness issue checking platform_get_irq()

2013-07-17 Thread Dan Carpenter
In xilinx_spi_probe() we use xspi->irq to store negative error codes so it has to be signed. We weren't going to use the upper bit any way so this is fine. Signed-off-by: Dan Carpenter --- v2: The first version introduced an ugly cast. Sorry for that. diff --git a/drivers/spi/spi-xi

Re: [patch] spi/xilinx: signedness issue checking platform_get_irq()

2013-07-17 Thread Dan Carpenter
On Wed, Jul 17, 2013 at 09:03:53AM -0600, Stephen Warren wrote: > On 07/17/2013 06:26 AM, Dan Carpenter wrote: > > "xspi->irq" is unsigned int so it's never less than zero. I have added > > a cast. > > Um. Doesn't this just hide a warning, not solve t

[patch] spi/xilinx: signedness issue checking platform_get_irq()

2013-07-17 Thread Dan Carpenter
"xspi->irq" is unsigned int so it's never less than zero. I have added a cast. Signed-off-by: Dan Carpenter diff --git a/drivers/spi/spi-xilinx.c b/drivers/spi/spi-xilinx.c index fea815c..e5201fb 100644 --- a/drivers/spi/spi-xilinx.c +++ b/drivers/spi/spi-xilinx.c @@ -442,

[patch -next] spi: spi-xilinx: cleanup a check in xilinx_spi_txrx_bufs()

2013-06-09 Thread Dan Carpenter
ive. I suspect that going negative may cause a bug, but I don't have the hardware and can't test. Signed-off-by: Dan Carpenter diff --git a/drivers/spi/spi-xilinx.c b/drivers/spi/spi-xilinx.c index 0b8398c..fb56fcf 100644 --- a/drivers/spi/spi-xilinx.c +++ b/drivers/spi/spi-xil

re: regulator: palma: add ramp delay support through regulator constraints

2013-04-29 Thread Dan Carpenter
6 if (ramp_delay_support) { 847 addr = palmas_regs_info[id].tstep_addr; 848 ret = palmas_smps_read(pmic->palmas, addr, ®); 849 if (ret < 0) { regards, dan carpenter _

[patch -next] net: calxedaxgmac: fix condition in xgmac_set_features()

2013-04-25 Thread Dan Carpenter
The "changed" variable should be a 64 bit type, otherwise it can't store all the features. The way the code is now the test for whether NETIF_F_RXCSUM changed is always false and we return immediately. Signed-off-by: Dan Carpenter diff --git a/drivers/net/ethernet/calxeda/xgm

[patch] mtd: denali_dt: harmless case of testing the wrong variable

2013-03-31 Thread Dan Carpenter
There is a warning message that can't be printed because we test the wrong variable. Signed-off-by: Dan Carpenter diff --git a/drivers/mtd/nand/denali_dt.c b/drivers/mtd/nand/denali_dt.c index 546f8cb..02988b0 100644 --- a/drivers/mtd/nand/denali_dt.c +++ b/drivers/mtd/nand/denali_dt.c @@

[patch] ALSA: ASoC: tas5086: signedness bug in tas5086_hw_params()

2013-03-12 Thread Dan Carpenter
"val" has to be signed for the error handling to work. Signed-off-by: Dan Carpenter diff --git a/sound/soc/codecs/tas5086.c b/sound/soc/codecs/tas5086.c index 008bea4..41d03ae 100644 --- a/sound/soc/codecs/tas5086.c +++ b/sound/soc/codecs/tas5086.c @@ -251,7 +251,7 @@

[patch] hwmon/max6697: fix memset size in max6697_init_chip()

2013-01-14 Thread Dan Carpenter
sizeof(p) was intended instead of sizeof(data). data is a pointer and p is a 7 character struct. It probably doesn't make a difference most of the time, but it could result in using uninitialized data. Signed-off-by: Dan Carpenter diff --git a/drivers/hwmon/max6697.c b/drivers/hwmon/max6

[patch] tg3: missing break statement in tg3_get_5720_nvram_info()

2013-01-11 Thread Dan Carpenter
There is a missing break statement so FLASH_5762_EEPROM_HD gets treated like FLASH_5762_EEPROM_LD. Signed-off-by: Dan Carpenter --- Only needed in linux-next. diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c index bc4d989..642764e 100644 --- a/drivers/net

re: spi-gpio: allow operation without CS signal

2012-10-03 Thread Dan Carpenter
used like this through out. The comments say that it's supposed to be used as a void pointer but that doesn't make a lot of sense either. 230 /* SPI is normally active-low */ 231 gpio_set_value(cs, (spi->mode & SPI_CS_HIGH) ? is_active : !is_

[patch] usb: phy: signedness bug in suspend/resume

2012-09-13 Thread Dan Carpenter
"ret" should be signed here for the error handling to work. Signed-off-by: Dan Carpenter diff --git a/drivers/usb/phy/omap-usb2.c b/drivers/usb/phy/omap-usb2.c index 15ab3d6..d36c282 100644 --- a/drivers/usb/phy/omap-usb2.c +++ b/drivers/usb/phy/omap-usb2.c @@ -120,7 +120,7 @@

[patch] video: mb862xxfb: prevent divide by zero bug

2012-08-18 Thread Dan Carpenter
Do a sanity check on these before using them as divisors. Signed-off-by: Dan Carpenter diff --git a/drivers/video/mb862xx/mb862xxfbdrv.c b/drivers/video/mb862xx/mb862xxfbdrv.c index 00ce1f3..57d940b 100644 --- a/drivers/video/mb862xx/mb862xxfbdrv.c +++ b/drivers/video/mb862xx/mb862xxfbdrv.c

Re: [patch] driver-core: dev_to_node() should handle NULL pointers

2012-07-20 Thread Dan Carpenter
On Fri, Jul 20, 2012 at 08:00:42AM -0700, Greg Kroah-Hartman wrote: > On Fri, Jul 20, 2012 at 09:56:23AM +0300, Dan Carpenter wrote: > > What prompted this patch is that in dma_pool_create() we call > > dev_to_node() before checking whether "dev" is NULL. It looks like &

[patch] driver-core: dev_to_node() should handle NULL pointers

2012-07-19 Thread Dan Carpenter
What prompted this patch is that in dma_pool_create() we call dev_to_node() before checking whether "dev" is NULL. It looks like there are places which call dma_pool_create() with a NULL pointer. An example is in drivers/usb/gadget/amd5536udc.c. Signed-off-by: Dan Carpenter --- Stat

re: regulator: tps65217: Add device tree support

2012-07-13 Thread Dan Carpenter
t;of_node[i]; ^^ Old dereference. 246 reg_data = pdata->tps65217_init_data[i]; 247 platform_device_add_data(pdev, reg_data, sizeof(*reg_data)); regards, dan carpenter ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss

re: mfd: mc13xxx: add codec platform data

2012-05-21 Thread Dan Carpenter
mc13xxx_add_subdevice_pdata(mc13xxx, "%s-codec", 695 pdata->codec, sizeof(*pdata->codec)); New dereference. 696 697 if (mc13xxx->flags & MC13XXX_USE_RTC) regards, dan carpenter __

Re: [PATCH V2 1/2] staging: iio: add driver for isl29028

2012-04-12 Thread Dan Carpenter
> --- > Taken care of all review comment from Dan. Looks nice. You went above and beyond and cleaned up a couple things I didn't mention. Thanks. regards, dan carpenter ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org

Re: [PATCH V1 1/2] staging: iio: add driver for isl29028

2012-04-11 Thread Dan Carpenter
On Wed, Apr 11, 2012 at 10:58:03PM +0530, Laxman Dewangan wrote: > Intersil's ISL29028 is concurrent Ambient Light and > Proximity Sensor device. > Add driver to access the light and IR intensity and > proximity value via iio interface. > > Signed-off-by: Laxman Dewangan > --- > drivers/staging/

[patch] max17042_battery: fix a couple buffer overflows

2012-03-27 Thread Dan Carpenter
Signed-off-by: Dan Carpenter --- I don't have this hardware. The original code is clearly buggy, but I can't test that my fix is correct. Please review carefully. diff --git a/drivers/power/max17042_battery.c b/drivers/power/max17042_battery.c index e36763a..f8cd48c 1

[patch] sata_mv: silence an uninitialized variable warning

2012-03-27 Thread Dan Carpenter
Gcc version 4.6.2-12 complains that if we can't find the "nr-ports" property in of_property_read_u32_array() then "n_ports" is used uninitialized. Let's set it to zero in that case. Signed-off-by: Dan Carpenter diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sa

[patch] qla2xxx: locking problem in qla2x00_init_rings()

2010-09-12 Thread Dan Carpenter
IRQs are already disabled here so we don't need to disable them again. But more importantly, the spin_lock_irqsave() overwrites "flags" and that breaks things when we want to re-enable the IRQs when we call spin_unlock_irqrestore(&ha->hardware_lock, flags); Signed-off-by: D

[patch] ehci-ppc-of: problems in unwind

2010-08-14 Thread Dan Carpenter
"USB: powerpc: Workaround for the PPC440EPX USBH_23 errata [take 3]" I modified the few lines in front a little so that my code didn't obscure the return success code path. Signed-off-by: Dan Carpenter --- I don't have a cross compile environment set up so I haven't compiled t

Re: [PATCH 8/9] arch/powerpc/kernel: Drop unnecessary null test

2010-08-03 Thread Dan Carpenter
e other hand the code has been this way for a year and no one has complained... regards, dan carpenter > } > } > } ___ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss

[patch v2] nouveau: unwind on load errors

2010-07-30 Thread Dan Carpenter
nuveau_load() just returned directly if there was an error instead of releasing resources. Signed-off-by: Dan Carpenter --- V2

[patch] nouveau: unwind on load errors

2010-07-29 Thread Dan Carpenter
nouveau_load() just returned directly if there was an error instead of releasing resources. Signed-off-by: Dan Carpenter diff --git a/drivers/gpu/drm/nouveau/nouveau_state.c b/drivers/gpu/drm/nouveau/nouveau_state.c index e632339..e53253a 100644 --- a/drivers/gpu/drm/nouveau/nouveau_state.c

Re: [patch] of: check for IS_ERR()

2010-03-29 Thread Dan Carpenter
On Fri, Feb 26, 2010 at 01:54:20AM -0800, David Miller wrote: > From: Dan Carpenter > Date: Fri, 26 Feb 2010 12:49:41 +0300 > > > get_phy_device() can return an ERR_PTR() > > > > Signed-off-by: Dan Carpenter > > --- > > I don't have a cross compil

[patch] of: check for IS_ERR()

2010-02-26 Thread Dan Carpenter
get_phy_device() can return an ERR_PTR() Signed-off-by: Dan Carpenter --- I don't have a cross compile environment set up so I can't even compile test this. :/ But err.h is included so it should be OK. diff --git a/drivers/of/of_mdio.c b/drivers/of/of_mdio.c index 18ecae4..b474