Skip to contentSkip to conversation

imx: ipu-v3: fix typo leading to build warning

PATCH Applied Lucas Stach 4 participants 12 messages Oct 20, 2014 – Oct 21, 2014

Subsystems (9)
lore
Share & tools
lore
#0 lore raw

PATCH 1/7 imx: ipu-v3: fix typo leading to build warning

This PAGE_SIZE clearly should not be there.

---
 drivers/video/imx-ipu-v3/ipu-common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/imx-ipu-v3/ipu-common.c +1 -1
index c602363..f13cf01 100644
@@ -796,7 +796,7 @@ static int ipu_probe(struct device_d *dev)
 	dev_dbg(dev, "vdi:      0x%p\n",
 			ipu_base + devtype->vdi_ofs);
 
-	ipu->cm_reg = ipu_base + devtype->cm_ofs, PAGE_SIZE;
+	ipu->cm_reg = ipu_base + devtype->cm_ofs;
 	ipu->idmac_reg = ipu_base + devtype->cm_ofs + IPU_CM_IDMAC_REG_OFS;
 	ipu->cpmem_base = ipu_base + devtype->cpmem_ofs;
 
Signature · 7 lines
1.9.3


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#1 lore raw

PATCH 2/7 dfu: fix possible usage of uninitialized var

The error path would in fact use the status
variable without it being initialized first.

---
 drivers/usb/gadget/dfu.c | 1 +
 1 file changed, 1 insertion(+)
drivers/usb/gadget/dfu.c +1 -0
index 67a0703..351b584 100644
@@ -207,6 +207,7 @@ dfu_bind(struct usb_configuration *c, struct usb_function *f)
 	dfu->dnreq = usb_ep_alloc_request(c->cdev->gadget->ep0);
 	if (!dfu->dnreq) {
 		printf("usb_ep_alloc_request failed\n");
+		status = -ENOMEM;
 		goto out;
 	}
 	dfu->dnreq->buf = dma_alloc(CONFIG_USBD_DFU_XFER_SIZE);
Signature · 7 lines
1.9.3


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#2 lore raw

PATCH 3/7 arm: boards: variscite-mx6: check i2c return value

In reply to Lucas Stach

ret wasn't checked previously.

---
 arch/arm/boards/variscite-mx6/board.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
arch/arm/boards/variscite-mx6/board.c +5 -2
index ce1284f..de74abc 100644
@@ -49,7 +49,7 @@ static int setup_pmic_voltages(void)
 	unsigned char value, rev_id = 0 ;
 	struct i2c_adapter *adapter = NULL;
 	struct i2c_client client;
-	int addr = -1, ret, bus = 0;
+	int addr = -1, bus = 0;
 
 	/* I2C2 bus (2-1 = 1 in barebox numbering) */
 	bus = 1;
@@ -80,7 +80,10 @@ static int setup_pmic_voltages(void)
 
 	/* Set Gigabit Ethernet voltage (SOM v1.1/1.0)*/
         value = 0x60;
-	ret = i2c_write_reg(&client, 0x4a, &value, 1);
+	if (i2c_write_reg(&client, 0x4a, &value, 1) != 1) {
+		pr_err("Set ETH error!\n");
+		return -EIO;
+	}
 
 	/* set VGEN3 to 2.5V */
 	value = 0x77;
Signature · 7 lines
1.9.3


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#3 lore raw

PATCH 4/7 arm: at91: remove unused variable

In reply to Lucas Stach
---
 arch/arm/mach-at91/clock.c | 4 ----
 1 file changed, 4 deletions(-)
arch/arm/mach-at91/clock.c +0 -4
index 7a4282e..a7051c3 100644
@@ -347,7 +347,6 @@ EXPORT_SYMBOL(clk_get_rate);
 
 long clk_round_rate(struct clk *clk, unsigned long rate)
 {
-	unsigned long	flags;
 	unsigned	prescale;
 	unsigned long	actual;
 	unsigned long	prev = ULONG_MAX;
@@ -376,7 +375,6 @@ EXPORT_SYMBOL(clk_round_rate);
 
 int clk_set_rate(struct clk *clk, unsigned long rate)
 {
-	unsigned long	flags;
 	unsigned	prescale;
 	unsigned long	prescale_offset, css_mask;
 	unsigned long	actual;
@@ -421,8 +419,6 @@ EXPORT_SYMBOL(clk_get_parent);
 
 int clk_set_parent(struct clk *clk, struct clk *parent)
 {
-	unsigned long	flags;
-
 	if (clk->users)
 		return -EBUSY;
 	if (!clk_is_primary(parent) || !clk_is_programmable(clk))
Signature · 7 lines
1.9.3


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Acked-by on v1 4/7
#4 lore raw

Re: [PATCH 4/7] arm: at91: remove unused variable

Hi Lucas,

Quoted 1 line · Lucas Stach
Quoted 26 lines
---
  arch/arm/mach-at91/clock.c | 4 ----
  1 file changed, 4 deletions(-)
arch/arm/mach-at91/clock.c +0 -2
index 7a4282e..a7051c3 100644
@@ -347,7 +347,6 @@ EXPORT_SYMBOL(clk_get_rate);
 
  long clk_round_rate(struct clk *clk, unsigned long rate)
  {
-	unsigned long	flags;
  	unsigned	prescale;
  	unsigned long	actual;
  	unsigned long	prev = ULONG_MAX;
@@ -376,7 +375,6 @@ EXPORT_SYMBOL(clk_round_rate);
 
  int clk_set_rate(struct clk *clk, unsigned long rate)
  {
-	unsigned long	flags;
  	unsigned	prescale;
  	unsigned long	prescale_offset, css_mask;
  	unsigned long	actual;

arch/arm/mach-at91/clock.c EXPORT_SYMBOL(clk_get_parent); · line 424

Quoted 8 lines
arch/arm/mach-at91/clock.c +0 -2
@@ -421,8 +419,6 @@ EXPORT_SYMBOL(clk_get_parent);
 
  int clk_set_parent(struct clk *clk, struct clk *parent)
  {
-	unsigned long	flags;
-
  	if (clk->users)
  		return -EBUSY;
  	if (!clk_is_primary(parent) || !clk_is_programmable(clk))

Best Regards,
Bo Shen

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#5 lore raw

PATCH 5/7 sha2: fix invalid length check

In reply to Lucas Stach

length is unsigned an thus can never be <0.

---
 crypto/sha2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
crypto/sha2.c +1 -1
index 26162e8..e495313 100644
@@ -208,7 +208,7 @@ static void sha2_update(sha2_context * ctx, const uint8_t * input, size_t length
 	size_t fill;
 	uint32_t left;
 
-	if (length <= 0)
+	if (length = 0)
 		return;
 
 	left = ctx->total[0] & 0x3F;
Signature · 7 lines
1.9.3


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#6 lore raw

Re: [PATCH 5/7] sha2: fix invalid length check

Hi Lucas,

Quoted 12 lines · Lucas Stach

length is unsigned an thus can never be <0.

---
 crypto/sha2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
crypto/sha2.c +0 -0
index 26162e8..e495313 100644

crypto/sha2.c static void sha2_update(sha2_context * ctx, const uint8_t * input, size_t length · line 211

Quoted 5 lines
crypto/sha2.c +1 -1
@@ -208,7 +208,7 @@ static void sha2_update(sha2_context * ctx, const uint8_t * input, size_t length
 	size_t fill;
 	uint32_t left;
 
-	if (length <= 0)
+	if (length = 0)

should be (length == 0).

- Alex

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

maintainer
#7 lore raw

Re: [PATCH 5/7] sha2: fix invalid length check

Quoted 18 lines · Alexander Aring

Hi Lucas,

Quoted 15 lines · Lucas Stach

length is unsigned an thus can never be <0.

---
 crypto/sha2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
crypto/sha2.c +0 -0
index 26162e8..e495313 100644
@@ -208,7 +208,7 @@ static void sha2_update(sha2_context * ctx, const uint8_t * input, size_t length
 	size_t fill;
 	uint32_t left;
 
Quoted 4 lines

crypto/sha2.c static void sha2_update(sha2_context * ctx, const uint8_t * input, size_t length · line 211

Quoted 2 lines
crypto/sha2.c +1 -1
-	if (length <= 0)
+	if (length = 0)

should be (length == 0).

Fixed while applying.

Sascha

Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#8 lore raw

PATCH 6/7 i2c: at91: fix invalid length check

In reply to Lucas Stach
---
 drivers/i2c/busses/i2c-at91.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/i2c/busses/i2c-at91.c +2 -2
index deb4ea4..3a644cf 100644
@@ -140,7 +140,7 @@ static void at91_calc_twi_clock(struct at91_twi_dev *dev, int twi_clk)
 
 static void at91_twi_write_next_byte(struct at91_twi_dev *dev)
 {
-	if (dev->buf_len <= 0)
+	if (!dev->buf_len)
 		return;
 
 	at91_twi_write(dev, AT91_TWI_THR, *dev->buf);
@@ -156,7 +156,7 @@ static void at91_twi_write_next_byte(struct at91_twi_dev *dev)
 
 static void at91_twi_read_next_byte(struct at91_twi_dev *dev)
 {
-	if (dev->buf_len <= 0)
+	if (!dev->buf_len)
 		return;
 
 	*dev->buf = at91_twi_read(dev, AT91_TWI_RHR) & 0xff;
Signature · 7 lines
1.9.3


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Acked-by on v1 6/7
#9 lore raw

Re: [PATCH 6/7] i2c: at91: fix invalid length check

Hi Lucas,

Quoted 1 line · Lucas Stach
Quoted 19 lines
---
  drivers/i2c/busses/i2c-at91.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/i2c/busses/i2c-at91.c +1 -1
index deb4ea4..3a644cf 100644
@@ -140,7 +140,7 @@ static void at91_calc_twi_clock(struct at91_twi_dev *dev, int twi_clk)
 
  static void at91_twi_write_next_byte(struct at91_twi_dev *dev)
  {
-	if (dev->buf_len <= 0)
+	if (!dev->buf_len)
  		return;
 
  	at91_twi_write(dev, AT91_TWI_THR, *dev->buf);

drivers/i2c/busses/i2c-at91.c static void at91_twi_write_next_byte(struct at91_twi_dev *dev) · line 162

Quoted 8 lines
drivers/i2c/busses/i2c-at91.c +1 -1
@@ -156,7 +156,7 @@ static void at91_twi_write_next_byte(struct at91_twi_dev *dev)
 
  static void at91_twi_read_next_byte(struct at91_twi_dev *dev)
  {
-	if (dev->buf_len <= 0)
+	if (!dev->buf_len)
  		return;
 
  	*dev->buf = at91_twi_read(dev, AT91_TWI_RHR) & 0xff;

Best Regards,
Bo Shen

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#10 lore raw

PATCH 7/7 clk: gate: remove superfluous code

In reply to Lucas Stach

This code didn't have any effect.

---
 drivers/clk/clk-gate.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)
drivers/clk/clk-gate.c +1 -10
index 85eba3d..695e19a 100644
@@ -132,14 +132,5 @@ struct clk *clk_gate(const char *name, const char *parent, void __iomem *reg,
 struct clk *clk_gate_inverted(const char *name, const char *parent,
 		void __iomem *reg, u8 shift, unsigned flags)
 {
-	struct clk *clk;
-	struct clk_gate *g;
-
-	clk = clk_gate(name, parent, reg, shift, flags, CLK_GATE_INVERTED);
-	if (IS_ERR(clk))
-		return clk;
-
-	g = container_of(clk, struct clk_gate, clk);
-
-	return clk;
+	return clk_gate(name, parent, reg, shift, flags, CLK_GATE_INVERTED);
 }
Signature · 7 lines
1.9.3


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
maintainer Applied
#11 lore raw
In reply to Lucas Stach
Quoted 3 lines · Lucas Stach

This PAGE_SIZE clearly should not be there.

Applied all, thanks

Sascha

Quoted 26 lines
---
 drivers/video/imx-ipu-v3/ipu-common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/imx-ipu-v3/ipu-common.c +1 -1
index c602363..f13cf01 100644
@@ -796,7 +796,7 @@ static int ipu_probe(struct device_d *dev)
 	dev_dbg(dev, "vdi:      0x%p\n",
 			ipu_base + devtype->vdi_ofs);
 
-	ipu->cm_reg = ipu_base + devtype->cm_ofs, PAGE_SIZE;
+	ipu->cm_reg = ipu_base + devtype->cm_ofs;
 	ipu->idmac_reg = ipu_base + devtype->cm_ofs + IPU_CM_IDMAC_REG_OFS;
 	ipu->cpmem_base = ipu_base + devtype->cpmem_ofs;
 
Signature · 7 lines
1.9.3


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox