* [PATCH 2/7] dfu: fix possible usage of uninitialized var
2014-10-20 18:15 [PATCH 1/7] imx: ipu-v3: fix typo leading to build warning Lucas Stach
@ 2014-10-20 18:15 ` Lucas Stach
2014-10-20 18:15 ` [PATCH 3/7] arm: boards: variscite-mx6: check i2c return value Lucas Stach
` (5 subsequent siblings)
6 siblings, 0 replies; 12+ messages in thread
From: Lucas Stach @ 2014-10-20 18:15 UTC (permalink / raw)
To: barebox
The error path would in fact use the status
variable without it being initialized first.
Signed-off-by: Lucas Stach <dev@lynxeye.de>
---
drivers/usb/gadget/dfu.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/usb/gadget/dfu.c b/drivers/usb/gadget/dfu.c
index 67a0703..351b584 100644
--- a/drivers/usb/gadget/dfu.c
+++ b/drivers/usb/gadget/dfu.c
@@ -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);
--
1.9.3
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 3/7] arm: boards: variscite-mx6: check i2c return value
2014-10-20 18:15 [PATCH 1/7] imx: ipu-v3: fix typo leading to build warning Lucas Stach
2014-10-20 18:15 ` [PATCH 2/7] dfu: fix possible usage of uninitialized var Lucas Stach
@ 2014-10-20 18:15 ` Lucas Stach
2014-10-20 18:15 ` [PATCH 4/7] arm: at91: remove unused variable Lucas Stach
` (4 subsequent siblings)
6 siblings, 0 replies; 12+ messages in thread
From: Lucas Stach @ 2014-10-20 18:15 UTC (permalink / raw)
To: barebox
ret wasn't checked previously.
Signed-off-by: Lucas Stach <dev@lynxeye.de>
---
arch/arm/boards/variscite-mx6/board.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/arch/arm/boards/variscite-mx6/board.c b/arch/arm/boards/variscite-mx6/board.c
index ce1284f..de74abc 100644
--- a/arch/arm/boards/variscite-mx6/board.c
+++ b/arch/arm/boards/variscite-mx6/board.c
@@ -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;
--
1.9.3
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 4/7] arm: at91: remove unused variable
2014-10-20 18:15 [PATCH 1/7] imx: ipu-v3: fix typo leading to build warning Lucas Stach
2014-10-20 18:15 ` [PATCH 2/7] dfu: fix possible usage of uninitialized var Lucas Stach
2014-10-20 18:15 ` [PATCH 3/7] arm: boards: variscite-mx6: check i2c return value Lucas Stach
@ 2014-10-20 18:15 ` Lucas Stach
2014-10-21 1:56 ` Bo Shen
2014-10-20 18:15 ` [PATCH 5/7] sha2: fix invalid length check Lucas Stach
` (3 subsequent siblings)
6 siblings, 1 reply; 12+ messages in thread
From: Lucas Stach @ 2014-10-20 18:15 UTC (permalink / raw)
To: barebox
Signed-off-by: Lucas Stach <dev@lynxeye.de>
---
arch/arm/mach-at91/clock.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/arch/arm/mach-at91/clock.c b/arch/arm/mach-at91/clock.c
index 7a4282e..a7051c3 100644
--- a/arch/arm/mach-at91/clock.c
+++ b/arch/arm/mach-at91/clock.c
@@ -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))
--
1.9.3
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 4/7] arm: at91: remove unused variable
2014-10-20 18:15 ` [PATCH 4/7] arm: at91: remove unused variable Lucas Stach
@ 2014-10-21 1:56 ` Bo Shen
0 siblings, 0 replies; 12+ messages in thread
From: Bo Shen @ 2014-10-21 1:56 UTC (permalink / raw)
To: Lucas Stach; +Cc: barebox
Hi Lucas,
On 10/21/2014 02:15 AM, Lucas Stach wrote:
> Signed-off-by: Lucas Stach <dev@lynxeye.de>
Acked-by: Bo Shen <voice.shen@atmel.com>
> ---
> arch/arm/mach-at91/clock.c | 4 ----
> 1 file changed, 4 deletions(-)
>
> diff --git a/arch/arm/mach-at91/clock.c b/arch/arm/mach-at91/clock.c
> index 7a4282e..a7051c3 100644
> --- a/arch/arm/mach-at91/clock.c
> +++ b/arch/arm/mach-at91/clock.c
> @@ -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))
>
Best Regards,
Bo Shen
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 5/7] sha2: fix invalid length check
2014-10-20 18:15 [PATCH 1/7] imx: ipu-v3: fix typo leading to build warning Lucas Stach
` (2 preceding siblings ...)
2014-10-20 18:15 ` [PATCH 4/7] arm: at91: remove unused variable Lucas Stach
@ 2014-10-20 18:15 ` Lucas Stach
2014-10-20 21:06 ` Alexander Aring
2014-10-20 18:16 ` [PATCH 6/7] i2c: at91: " Lucas Stach
` (2 subsequent siblings)
6 siblings, 1 reply; 12+ messages in thread
From: Lucas Stach @ 2014-10-20 18:15 UTC (permalink / raw)
To: barebox
length is unsigned an thus can never be <0.
Signed-off-by: Lucas Stach <dev@lynxeye.de>
---
crypto/sha2.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/crypto/sha2.c b/crypto/sha2.c
index 26162e8..e495313 100644
--- a/crypto/sha2.c
+++ b/crypto/sha2.c
@@ -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;
--
1.9.3
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 5/7] sha2: fix invalid length check
2014-10-20 18:15 ` [PATCH 5/7] sha2: fix invalid length check Lucas Stach
@ 2014-10-20 21:06 ` Alexander Aring
2014-10-21 11:09 ` Sascha Hauer
0 siblings, 1 reply; 12+ messages in thread
From: Alexander Aring @ 2014-10-20 21:06 UTC (permalink / raw)
To: Lucas Stach; +Cc: barebox
Hi Lucas,
On Mon, Oct 20, 2014 at 08:15:59PM +0200, Lucas Stach wrote:
> length is unsigned an thus can never be <0.
>
> Signed-off-by: Lucas Stach <dev@lynxeye.de>
> ---
> crypto/sha2.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/crypto/sha2.c b/crypto/sha2.c
> index 26162e8..e495313 100644
> --- a/crypto/sha2.c
> +++ b/crypto/sha2.c
> @@ -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
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 5/7] sha2: fix invalid length check
2014-10-20 21:06 ` Alexander Aring
@ 2014-10-21 11:09 ` Sascha Hauer
0 siblings, 0 replies; 12+ messages in thread
From: Sascha Hauer @ 2014-10-21 11:09 UTC (permalink / raw)
To: Alexander Aring; +Cc: barebox
On Mon, Oct 20, 2014 at 11:06:49PM +0200, Alexander Aring wrote:
> Hi Lucas,
>
> On Mon, Oct 20, 2014 at 08:15:59PM +0200, Lucas Stach wrote:
> > length is unsigned an thus can never be <0.
> >
> > Signed-off-by: Lucas Stach <dev@lynxeye.de>
> > ---
> > crypto/sha2.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/crypto/sha2.c b/crypto/sha2.c
> > index 26162e8..e495313 100644
> > --- a/crypto/sha2.c
> > +++ b/crypto/sha2.c
> > @@ -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).
Fixed while applying.
Sascha
--
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
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 6/7] i2c: at91: fix invalid length check
2014-10-20 18:15 [PATCH 1/7] imx: ipu-v3: fix typo leading to build warning Lucas Stach
` (3 preceding siblings ...)
2014-10-20 18:15 ` [PATCH 5/7] sha2: fix invalid length check Lucas Stach
@ 2014-10-20 18:16 ` Lucas Stach
2014-10-21 2:01 ` Bo Shen
2014-10-20 18:16 ` [PATCH 7/7] clk: gate: remove superfluous code Lucas Stach
2014-10-21 11:09 ` [PATCH 1/7] imx: ipu-v3: fix typo leading to build warning Sascha Hauer
6 siblings, 1 reply; 12+ messages in thread
From: Lucas Stach @ 2014-10-20 18:16 UTC (permalink / raw)
To: barebox
Signed-off-by: Lucas Stach <dev@lynxeye.de>
---
drivers/i2c/busses/i2c-at91.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/i2c/busses/i2c-at91.c b/drivers/i2c/busses/i2c-at91.c
index deb4ea4..3a644cf 100644
--- a/drivers/i2c/busses/i2c-at91.c
+++ b/drivers/i2c/busses/i2c-at91.c
@@ -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;
--
1.9.3
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 6/7] i2c: at91: fix invalid length check
2014-10-20 18:16 ` [PATCH 6/7] i2c: at91: " Lucas Stach
@ 2014-10-21 2:01 ` Bo Shen
0 siblings, 0 replies; 12+ messages in thread
From: Bo Shen @ 2014-10-21 2:01 UTC (permalink / raw)
To: Lucas Stach; +Cc: barebox
Hi Lucas,
On 10/21/2014 02:16 AM, Lucas Stach wrote:
> Signed-off-by: Lucas Stach <dev@lynxeye.de>
Acked-by: Bo Shen <voice.shen@atmel.com>
> ---
> drivers/i2c/busses/i2c-at91.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-at91.c b/drivers/i2c/busses/i2c-at91.c
> index deb4ea4..3a644cf 100644
> --- a/drivers/i2c/busses/i2c-at91.c
> +++ b/drivers/i2c/busses/i2c-at91.c
> @@ -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;
>
Best Regards,
Bo Shen
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 7/7] clk: gate: remove superfluous code
2014-10-20 18:15 [PATCH 1/7] imx: ipu-v3: fix typo leading to build warning Lucas Stach
` (4 preceding siblings ...)
2014-10-20 18:16 ` [PATCH 6/7] i2c: at91: " Lucas Stach
@ 2014-10-20 18:16 ` Lucas Stach
2014-10-21 11:09 ` [PATCH 1/7] imx: ipu-v3: fix typo leading to build warning Sascha Hauer
6 siblings, 0 replies; 12+ messages in thread
From: Lucas Stach @ 2014-10-20 18:16 UTC (permalink / raw)
To: barebox
This code didn't have any effect.
Signed-off-by: Lucas Stach <dev@lynxeye.de>
---
drivers/clk/clk-gate.c | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/drivers/clk/clk-gate.c b/drivers/clk/clk-gate.c
index 85eba3d..695e19a 100644
--- a/drivers/clk/clk-gate.c
+++ b/drivers/clk/clk-gate.c
@@ -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);
}
--
1.9.3
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/7] imx: ipu-v3: fix typo leading to build warning
2014-10-20 18:15 [PATCH 1/7] imx: ipu-v3: fix typo leading to build warning Lucas Stach
` (5 preceding siblings ...)
2014-10-20 18:16 ` [PATCH 7/7] clk: gate: remove superfluous code Lucas Stach
@ 2014-10-21 11:09 ` Sascha Hauer
6 siblings, 0 replies; 12+ messages in thread
From: Sascha Hauer @ 2014-10-21 11:09 UTC (permalink / raw)
To: Lucas Stach; +Cc: barebox
On Mon, Oct 20, 2014 at 08:15:55PM +0200, Lucas Stach wrote:
> This PAGE_SIZE clearly should not be there.
>
> Signed-off-by: Lucas Stach <dev@lynxeye.de>
Applied all, thanks
Sascha
> ---
> drivers/video/imx-ipu-v3/ipu-common.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/video/imx-ipu-v3/ipu-common.c b/drivers/video/imx-ipu-v3/ipu-common.c
> index c602363..f13cf01 100644
> --- a/drivers/video/imx-ipu-v3/ipu-common.c
> +++ b/drivers/video/imx-ipu-v3/ipu-common.c
> @@ -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;
>
> --
> 1.9.3
>
>
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
>
--
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
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 12+ messages in thread