All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][spi-next] spi: stm32: fix range limit checks on div
@ 2017-06-22 15:41 ` Colin King
  0 siblings, 0 replies; 20+ messages in thread
From: Colin King @ 2017-06-22 15:41 UTC (permalink / raw)
  To: Mark Brown, Maxime Coquelin, Alexandre Torgue, linux-spi,
	linux-arm-kernel
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Currently the check for range limits on div is incorrect and will
never return -EINVAL. Fix this by replacing && with ||

Detected by CoverityScan, CID#1446580 ("Structurally dead code")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/spi/spi-stm32.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/spi-stm32.c b/drivers/spi/spi-stm32.c
index 0553f61ab3b7..b75909e7b117 100644
--- a/drivers/spi/spi-stm32.c
+++ b/drivers/spi/spi-stm32.c
@@ -262,7 +262,7 @@ static int stm32_spi_prepare_mbr(struct stm32_spi *spi, u32 speed_hz)
 	 * no need to check it there.
 	 * However, we need to ensure the following calculations.
 	 */
-	if ((div < SPI_MBR_DIV_MIN) &&
+	if ((div < SPI_MBR_DIV_MIN) ||
 	    (div > SPI_MBR_DIV_MAX))
 		return -EINVAL;
 
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH][spi-next] spi: stm32: fix range limit checks on div
@ 2017-06-22 15:41 ` Colin King
  0 siblings, 0 replies; 20+ messages in thread
From: Colin King @ 2017-06-22 15:41 UTC (permalink / raw)
  To: linux-arm-kernel

From: Colin Ian King <colin.king@canonical.com>

Currently the check for range limits on div is incorrect and will
never return -EINVAL. Fix this by replacing && with ||

Detected by CoverityScan, CID#1446580 ("Structurally dead code")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/spi/spi-stm32.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/spi-stm32.c b/drivers/spi/spi-stm32.c
index 0553f61ab3b7..b75909e7b117 100644
--- a/drivers/spi/spi-stm32.c
+++ b/drivers/spi/spi-stm32.c
@@ -262,7 +262,7 @@ static int stm32_spi_prepare_mbr(struct stm32_spi *spi, u32 speed_hz)
 	 * no need to check it there.
 	 * However, we need to ensure the following calculations.
 	 */
-	if ((div < SPI_MBR_DIV_MIN) &&
+	if ((div < SPI_MBR_DIV_MIN) ||
 	    (div > SPI_MBR_DIV_MAX))
 		return -EINVAL;
 
-- 
2.11.0


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH][spi-next] spi: stm32: fix range limit checks on div
@ 2017-06-22 15:41 ` Colin King
  0 siblings, 0 replies; 20+ messages in thread
From: Colin King @ 2017-06-22 15:41 UTC (permalink / raw)
  To: Mark Brown, Maxime Coquelin, Alexandre Torgue,
	linux-spi-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
  Cc: kernel-janitors-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

From: Colin Ian King <colin.king-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>

Currently the check for range limits on div is incorrect and will
never return -EINVAL. Fix this by replacing && with ||

Detected by CoverityScan, CID#1446580 ("Structurally dead code")

Signed-off-by: Colin Ian King <colin.king-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
---
 drivers/spi/spi-stm32.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/spi-stm32.c b/drivers/spi/spi-stm32.c
index 0553f61ab3b7..b75909e7b117 100644
--- a/drivers/spi/spi-stm32.c
+++ b/drivers/spi/spi-stm32.c
@@ -262,7 +262,7 @@ static int stm32_spi_prepare_mbr(struct stm32_spi *spi, u32 speed_hz)
 	 * no need to check it there.
 	 * However, we need to ensure the following calculations.
 	 */
-	if ((div < SPI_MBR_DIV_MIN) &&
+	if ((div < SPI_MBR_DIV_MIN) ||
 	    (div > SPI_MBR_DIV_MAX))
 		return -EINVAL;
 
-- 
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH][spi-next] spi: stm32: fix range limit checks on div
@ 2017-06-22 15:41 ` Colin King
  0 siblings, 0 replies; 20+ messages in thread
From: Colin King @ 2017-06-22 15:41 UTC (permalink / raw)
  To: linux-arm-kernel

From: Colin Ian King <colin.king@canonical.com>

Currently the check for range limits on div is incorrect and will
never return -EINVAL. Fix this by replacing && with ||

Detected by CoverityScan, CID#1446580 ("Structurally dead code")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/spi/spi-stm32.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/spi-stm32.c b/drivers/spi/spi-stm32.c
index 0553f61ab3b7..b75909e7b117 100644
--- a/drivers/spi/spi-stm32.c
+++ b/drivers/spi/spi-stm32.c
@@ -262,7 +262,7 @@ static int stm32_spi_prepare_mbr(struct stm32_spi *spi, u32 speed_hz)
 	 * no need to check it there.
 	 * However, we need to ensure the following calculations.
 	 */
-	if ((div < SPI_MBR_DIV_MIN) &&
+	if ((div < SPI_MBR_DIV_MIN) ||
 	    (div > SPI_MBR_DIV_MAX))
 		return -EINVAL;
 
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* Re: [PATCH][spi-next] spi: stm32: fix range limit checks on div
  2017-06-22 15:41 ` Colin King
  (?)
  (?)
@ 2017-06-22 15:49   ` Amelie DELAUNAY
  -1 siblings, 0 replies; 20+ messages in thread
From: Amelie DELAUNAY @ 2017-06-22 15:49 UTC (permalink / raw)
  To: Colin King, Mark Brown, Maxime Coquelin, Alexandre Torgue,
	linux-spi, linux-arm-kernel
  Cc: kernel-janitors, linux-kernel

Hi Colin,

I'm preparing a v2 for the initial patchset introducing spi-stm32, if 
you agree, I can directly add your fix.

Regards,
Amelie

On 06/22/2017 05:41 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Currently the check for range limits on div is incorrect and will
> never return -EINVAL. Fix this by replacing && with ||
> 
> Detected by CoverityScan, CID#1446580 ("Structurally dead code")
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   drivers/spi/spi-stm32.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/spi/spi-stm32.c b/drivers/spi/spi-stm32.c
> index 0553f61ab3b7..b75909e7b117 100644
> --- a/drivers/spi/spi-stm32.c
> +++ b/drivers/spi/spi-stm32.c
> @@ -262,7 +262,7 @@ static int stm32_spi_prepare_mbr(struct stm32_spi *spi, u32 speed_hz)
>   	 * no need to check it there.
>   	 * However, we need to ensure the following calculations.
>   	 */
> -	if ((div < SPI_MBR_DIV_MIN) &&
> +	if ((div < SPI_MBR_DIV_MIN) ||
>   	    (div > SPI_MBR_DIV_MAX))
>   		return -EINVAL;
>   
> 

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH][spi-next] spi: stm32: fix range limit checks on div
@ 2017-06-22 15:49   ` Amelie DELAUNAY
  0 siblings, 0 replies; 20+ messages in thread
From: Amelie DELAUNAY @ 2017-06-22 15:49 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Colin,

I'm preparing a v2 for the initial patchset introducing spi-stm32, if 
you agree, I can directly add your fix.

Regards,
Amelie

On 06/22/2017 05:41 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Currently the check for range limits on div is incorrect and will
> never return -EINVAL. Fix this by replacing && with ||
> 
> Detected by CoverityScan, CID#1446580 ("Structurally dead code")
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   drivers/spi/spi-stm32.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/spi/spi-stm32.c b/drivers/spi/spi-stm32.c
> index 0553f61ab3b7..b75909e7b117 100644
> --- a/drivers/spi/spi-stm32.c
> +++ b/drivers/spi/spi-stm32.c
> @@ -262,7 +262,7 @@ static int stm32_spi_prepare_mbr(struct stm32_spi *spi, u32 speed_hz)
>   	 * no need to check it there.
>   	 * However, we need to ensure the following calculations.
>   	 */
> -	if ((div < SPI_MBR_DIV_MIN) &&
> +	if ((div < SPI_MBR_DIV_MIN) ||
>   	    (div > SPI_MBR_DIV_MAX))
>   		return -EINVAL;
>   
> 

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH][spi-next] spi: stm32: fix range limit checks on div
@ 2017-06-22 15:49   ` Amelie DELAUNAY
  0 siblings, 0 replies; 20+ messages in thread
From: Amelie DELAUNAY @ 2017-06-22 15:49 UTC (permalink / raw)
  To: Colin King, Mark Brown, Maxime Coquelin, Alexandre Torgue,
	linux-spi-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
  Cc: kernel-janitors-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

Hi Colin,

I'm preparing a v2 for the initial patchset introducing spi-stm32, if 
you agree, I can directly add your fix.

Regards,
Amelie

On 06/22/2017 05:41 PM, Colin King wrote:
> From: Colin Ian King <colin.king-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
> 
> Currently the check for range limits on div is incorrect and will
> never return -EINVAL. Fix this by replacing && with ||
> 
> Detected by CoverityScan, CID#1446580 ("Structurally dead code")
> 
> Signed-off-by: Colin Ian King <colin.king-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
> ---
>   drivers/spi/spi-stm32.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/spi/spi-stm32.c b/drivers/spi/spi-stm32.c
> index 0553f61ab3b7..b75909e7b117 100644
> --- a/drivers/spi/spi-stm32.c
> +++ b/drivers/spi/spi-stm32.c
> @@ -262,7 +262,7 @@ static int stm32_spi_prepare_mbr(struct stm32_spi *spi, u32 speed_hz)
>   	 * no need to check it there.
>   	 * However, we need to ensure the following calculations.
>   	 */
> -	if ((div < SPI_MBR_DIV_MIN) &&
> +	if ((div < SPI_MBR_DIV_MIN) ||
>   	    (div > SPI_MBR_DIV_MAX))
>   		return -EINVAL;
>   
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH][spi-next] spi: stm32: fix range limit checks on div
@ 2017-06-22 15:49   ` Amelie DELAUNAY
  0 siblings, 0 replies; 20+ messages in thread
From: Amelie DELAUNAY @ 2017-06-22 15:49 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Colin,

I'm preparing a v2 for the initial patchset introducing spi-stm32, if 
you agree, I can directly add your fix.

Regards,
Amelie

On 06/22/2017 05:41 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Currently the check for range limits on div is incorrect and will
> never return -EINVAL. Fix this by replacing && with ||
> 
> Detected by CoverityScan, CID#1446580 ("Structurally dead code")
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   drivers/spi/spi-stm32.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/spi/spi-stm32.c b/drivers/spi/spi-stm32.c
> index 0553f61ab3b7..b75909e7b117 100644
> --- a/drivers/spi/spi-stm32.c
> +++ b/drivers/spi/spi-stm32.c
> @@ -262,7 +262,7 @@ static int stm32_spi_prepare_mbr(struct stm32_spi *spi, u32 speed_hz)
>   	 * no need to check it there.
>   	 * However, we need to ensure the following calculations.
>   	 */
> -	if ((div < SPI_MBR_DIV_MIN) &&
> +	if ((div < SPI_MBR_DIV_MIN) ||
>   	    (div > SPI_MBR_DIV_MAX))
>   		return -EINVAL;
>   
> 

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH][spi-next] spi: stm32: fix range limit checks on div
  2017-06-22 15:49   ` Amelie DELAUNAY
  (?)
  (?)
@ 2017-06-22 15:50     ` Colin Ian King
  -1 siblings, 0 replies; 20+ messages in thread
From: Colin Ian King @ 2017-06-22 15:50 UTC (permalink / raw)
  To: Amelie DELAUNAY, Mark Brown, Maxime Coquelin, Alexandre Torgue,
	linux-spi, linux-arm-kernel
  Cc: kernel-janitors, linux-kernel

On 22/06/17 16:49, Amelie DELAUNAY wrote:
> Hi Colin,
> 
> I'm preparing a v2 for the initial patchset introducing spi-stm32, if
> you agree, I can directly add your fix.

Yep, please do, sounds like a plan.

Colin
> 
> Regards,
> Amelie
> 
> On 06/22/2017 05:41 PM, Colin King wrote:
>> From: Colin Ian King <colin.king@canonical.com>
>>
>> Currently the check for range limits on div is incorrect and will
>> never return -EINVAL. Fix this by replacing && with ||
>>
>> Detected by CoverityScan, CID#1446580 ("Structurally dead code")
>>
>> Signed-off-by: Colin Ian King <colin.king@canonical.com>
>> ---
>>   drivers/spi/spi-stm32.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/spi/spi-stm32.c b/drivers/spi/spi-stm32.c
>> index 0553f61ab3b7..b75909e7b117 100644
>> --- a/drivers/spi/spi-stm32.c
>> +++ b/drivers/spi/spi-stm32.c
>> @@ -262,7 +262,7 @@ static int stm32_spi_prepare_mbr(struct stm32_spi
>> *spi, u32 speed_hz)
>>        * no need to check it there.
>>        * However, we need to ensure the following calculations.
>>        */
>> -    if ((div < SPI_MBR_DIV_MIN) &&
>> +    if ((div < SPI_MBR_DIV_MIN) ||
>>           (div > SPI_MBR_DIV_MAX))
>>           return -EINVAL;
>>  

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH][spi-next] spi: stm32: fix range limit checks on div
@ 2017-06-22 15:50     ` Colin Ian King
  0 siblings, 0 replies; 20+ messages in thread
From: Colin Ian King @ 2017-06-22 15:50 UTC (permalink / raw)
  To: linux-arm-kernel

On 22/06/17 16:49, Amelie DELAUNAY wrote:
> Hi Colin,
> 
> I'm preparing a v2 for the initial patchset introducing spi-stm32, if
> you agree, I can directly add your fix.

Yep, please do, sounds like a plan.

Colin
> 
> Regards,
> Amelie
> 
> On 06/22/2017 05:41 PM, Colin King wrote:
>> From: Colin Ian King <colin.king@canonical.com>
>>
>> Currently the check for range limits on div is incorrect and will
>> never return -EINVAL. Fix this by replacing && with ||
>>
>> Detected by CoverityScan, CID#1446580 ("Structurally dead code")
>>
>> Signed-off-by: Colin Ian King <colin.king@canonical.com>
>> ---
>>   drivers/spi/spi-stm32.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/spi/spi-stm32.c b/drivers/spi/spi-stm32.c
>> index 0553f61ab3b7..b75909e7b117 100644
>> --- a/drivers/spi/spi-stm32.c
>> +++ b/drivers/spi/spi-stm32.c
>> @@ -262,7 +262,7 @@ static int stm32_spi_prepare_mbr(struct stm32_spi
>> *spi, u32 speed_hz)
>>        * no need to check it there.
>>        * However, we need to ensure the following calculations.
>>        */
>> -    if ((div < SPI_MBR_DIV_MIN) &&
>> +    if ((div < SPI_MBR_DIV_MIN) ||
>>           (div > SPI_MBR_DIV_MAX))
>>           return -EINVAL;
>>  


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH][spi-next] spi: stm32: fix range limit checks on div
@ 2017-06-22 15:50     ` Colin Ian King
  0 siblings, 0 replies; 20+ messages in thread
From: Colin Ian King @ 2017-06-22 15:50 UTC (permalink / raw)
  To: Amelie DELAUNAY, Mark Brown, Maxime Coquelin, Alexandre Torgue,
	linux-spi-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
  Cc: kernel-janitors-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

On 22/06/17 16:49, Amelie DELAUNAY wrote:
> Hi Colin,
> 
> I'm preparing a v2 for the initial patchset introducing spi-stm32, if
> you agree, I can directly add your fix.

Yep, please do, sounds like a plan.

Colin
> 
> Regards,
> Amelie
> 
> On 06/22/2017 05:41 PM, Colin King wrote:
>> From: Colin Ian King <colin.king-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
>>
>> Currently the check for range limits on div is incorrect and will
>> never return -EINVAL. Fix this by replacing && with ||
>>
>> Detected by CoverityScan, CID#1446580 ("Structurally dead code")
>>
>> Signed-off-by: Colin Ian King <colin.king-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
>> ---
>>   drivers/spi/spi-stm32.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/spi/spi-stm32.c b/drivers/spi/spi-stm32.c
>> index 0553f61ab3b7..b75909e7b117 100644
>> --- a/drivers/spi/spi-stm32.c
>> +++ b/drivers/spi/spi-stm32.c
>> @@ -262,7 +262,7 @@ static int stm32_spi_prepare_mbr(struct stm32_spi
>> *spi, u32 speed_hz)
>>        * no need to check it there.
>>        * However, we need to ensure the following calculations.
>>        */
>> -    if ((div < SPI_MBR_DIV_MIN) &&
>> +    if ((div < SPI_MBR_DIV_MIN) ||
>>           (div > SPI_MBR_DIV_MAX))
>>           return -EINVAL;
>>  

--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH][spi-next] spi: stm32: fix range limit checks on div
@ 2017-06-22 15:50     ` Colin Ian King
  0 siblings, 0 replies; 20+ messages in thread
From: Colin Ian King @ 2017-06-22 15:50 UTC (permalink / raw)
  To: linux-arm-kernel

On 22/06/17 16:49, Amelie DELAUNAY wrote:
> Hi Colin,
> 
> I'm preparing a v2 for the initial patchset introducing spi-stm32, if
> you agree, I can directly add your fix.

Yep, please do, sounds like a plan.

Colin
> 
> Regards,
> Amelie
> 
> On 06/22/2017 05:41 PM, Colin King wrote:
>> From: Colin Ian King <colin.king@canonical.com>
>>
>> Currently the check for range limits on div is incorrect and will
>> never return -EINVAL. Fix this by replacing && with ||
>>
>> Detected by CoverityScan, CID#1446580 ("Structurally dead code")
>>
>> Signed-off-by: Colin Ian King <colin.king@canonical.com>
>> ---
>>   drivers/spi/spi-stm32.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/spi/spi-stm32.c b/drivers/spi/spi-stm32.c
>> index 0553f61ab3b7..b75909e7b117 100644
>> --- a/drivers/spi/spi-stm32.c
>> +++ b/drivers/spi/spi-stm32.c
>> @@ -262,7 +262,7 @@ static int stm32_spi_prepare_mbr(struct stm32_spi
>> *spi, u32 speed_hz)
>>        * no need to check it there.
>>        * However, we need to ensure the following calculations.
>>        */
>> -    if ((div < SPI_MBR_DIV_MIN) &&
>> +    if ((div < SPI_MBR_DIV_MIN) ||
>>           (div > SPI_MBR_DIV_MAX))
>>           return -EINVAL;
>>  

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH][spi-next] spi: stm32: fix range limit checks on div
  2017-06-22 15:49   ` Amelie DELAUNAY
  (?)
  (?)
@ 2017-06-23 11:11     ` Mark Brown
  -1 siblings, 0 replies; 20+ messages in thread
From: Mark Brown @ 2017-06-23 11:11 UTC (permalink / raw)
  To: Amelie DELAUNAY
  Cc: Colin King, Maxime Coquelin, Alexandre Torgue, linux-spi,
	linux-arm-kernel, kernel-janitors, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 826 bytes --]

On Thu, Jun 22, 2017 at 05:49:10PM +0200, Amelie DELAUNAY wrote:

> I'm preparing a v2 for the initial patchset introducing spi-stm32, if you
> agree, I can directly add your fix.

Please don't resubmit patches that have already been applied, you should
submit patches against current code in the tree you're expecting things
to be applied to.  If any updates are needed to a patch that's already
been applied you should submit incremental patches which make those
updates.  This avoids having to change published git commits which could
cause problems for people working against git.

Please don't top post, reply in line with needed context.  This allows
readers to readily follow the flow of conversation and understand what
you are talking about and also helps ensure that everything in the
discussion is being addressed.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH][spi-next] spi: stm32: fix range limit checks on div
@ 2017-06-23 11:11     ` Mark Brown
  0 siblings, 0 replies; 20+ messages in thread
From: Mark Brown @ 2017-06-23 11:11 UTC (permalink / raw)
  To: linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 826 bytes --]

On Thu, Jun 22, 2017 at 05:49:10PM +0200, Amelie DELAUNAY wrote:

> I'm preparing a v2 for the initial patchset introducing spi-stm32, if you
> agree, I can directly add your fix.

Please don't resubmit patches that have already been applied, you should
submit patches against current code in the tree you're expecting things
to be applied to.  If any updates are needed to a patch that's already
been applied you should submit incremental patches which make those
updates.  This avoids having to change published git commits which could
cause problems for people working against git.

Please don't top post, reply in line with needed context.  This allows
readers to readily follow the flow of conversation and understand what
you are talking about and also helps ensure that everything in the
discussion is being addressed.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH][spi-next] spi: stm32: fix range limit checks on div
@ 2017-06-23 11:11     ` Mark Brown
  0 siblings, 0 replies; 20+ messages in thread
From: Mark Brown @ 2017-06-23 11:11 UTC (permalink / raw)
  To: Amelie DELAUNAY
  Cc: Colin King, Maxime Coquelin, Alexandre Torgue,
	linux-spi-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 826 bytes --]

On Thu, Jun 22, 2017 at 05:49:10PM +0200, Amelie DELAUNAY wrote:

> I'm preparing a v2 for the initial patchset introducing spi-stm32, if you
> agree, I can directly add your fix.

Please don't resubmit patches that have already been applied, you should
submit patches against current code in the tree you're expecting things
to be applied to.  If any updates are needed to a patch that's already
been applied you should submit incremental patches which make those
updates.  This avoids having to change published git commits which could
cause problems for people working against git.

Please don't top post, reply in line with needed context.  This allows
readers to readily follow the flow of conversation and understand what
you are talking about and also helps ensure that everything in the
discussion is being addressed.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH][spi-next] spi: stm32: fix range limit checks on div
@ 2017-06-23 11:11     ` Mark Brown
  0 siblings, 0 replies; 20+ messages in thread
From: Mark Brown @ 2017-06-23 11:11 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Jun 22, 2017 at 05:49:10PM +0200, Amelie DELAUNAY wrote:

> I'm preparing a v2 for the initial patchset introducing spi-stm32, if you
> agree, I can directly add your fix.

Please don't resubmit patches that have already been applied, you should
submit patches against current code in the tree you're expecting things
to be applied to.  If any updates are needed to a patch that's already
been applied you should submit incremental patches which make those
updates.  This avoids having to change published git commits which could
cause problems for people working against git.

Please don't top post, reply in line with needed context.  This allows
readers to readily follow the flow of conversation and understand what
you are talking about and also helps ensure that everything in the
discussion is being addressed.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20170623/869852e2/attachment.sig>

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH][spi-next] spi: stm32: fix range limit checks on div
  2017-06-22 15:41 ` Colin King
  (?)
  (?)
@ 2017-06-23 12:42   ` Amelie DELAUNAY
  -1 siblings, 0 replies; 20+ messages in thread
From: Amelie DELAUNAY @ 2017-06-23 12:42 UTC (permalink / raw)
  To: Colin King, Mark Brown, Maxime Coquelin, Alexandre Torgue,
	linux-spi, linux-arm-kernel
  Cc: kernel-janitors, linux-kernel


On 06/22/2017 05:41 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Currently the check for range limits on div is incorrect and will
> never return -EINVAL. Fix this by replacing && with ||
> 
> Detected by CoverityScan, CID#1446580 ("Structurally dead code")
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   drivers/spi/spi-stm32.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/spi/spi-stm32.c b/drivers/spi/spi-stm32.c
> index 0553f61ab3b7..b75909e7b117 100644
> --- a/drivers/spi/spi-stm32.c
> +++ b/drivers/spi/spi-stm32.c
> @@ -262,7 +262,7 @@ static int stm32_spi_prepare_mbr(struct stm32_spi *spi, u32 speed_hz)
>   	 * no need to check it there.
>   	 * However, we need to ensure the following calculations.
>   	 */
> -	if ((div < SPI_MBR_DIV_MIN) &&
> +	if ((div < SPI_MBR_DIV_MIN) ||
>   	    (div > SPI_MBR_DIV_MAX))
>   		return -EINVAL;
>   
> 

Reviewed-by: Amelie Delaunay <amelie.delaunay@st.com>

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH][spi-next] spi: stm32: fix range limit checks on div
@ 2017-06-23 12:42   ` Amelie DELAUNAY
  0 siblings, 0 replies; 20+ messages in thread
From: Amelie DELAUNAY @ 2017-06-23 12:42 UTC (permalink / raw)
  To: linux-arm-kernel


On 06/22/2017 05:41 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Currently the check for range limits on div is incorrect and will
> never return -EINVAL. Fix this by replacing && with ||
> 
> Detected by CoverityScan, CID#1446580 ("Structurally dead code")
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   drivers/spi/spi-stm32.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/spi/spi-stm32.c b/drivers/spi/spi-stm32.c
> index 0553f61ab3b7..b75909e7b117 100644
> --- a/drivers/spi/spi-stm32.c
> +++ b/drivers/spi/spi-stm32.c
> @@ -262,7 +262,7 @@ static int stm32_spi_prepare_mbr(struct stm32_spi *spi, u32 speed_hz)
>   	 * no need to check it there.
>   	 * However, we need to ensure the following calculations.
>   	 */
> -	if ((div < SPI_MBR_DIV_MIN) &&
> +	if ((div < SPI_MBR_DIV_MIN) ||
>   	    (div > SPI_MBR_DIV_MAX))
>   		return -EINVAL;
>   
> 

Reviewed-by: Amelie Delaunay <amelie.delaunay@st.com>

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH][spi-next] spi: stm32: fix range limit checks on div
@ 2017-06-23 12:42   ` Amelie DELAUNAY
  0 siblings, 0 replies; 20+ messages in thread
From: Amelie DELAUNAY @ 2017-06-23 12:42 UTC (permalink / raw)
  To: Colin King, Mark Brown, Maxime Coquelin, Alexandre Torgue,
	linux-spi-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
  Cc: kernel-janitors-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA


On 06/22/2017 05:41 PM, Colin King wrote:
> From: Colin Ian King <colin.king-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
> 
> Currently the check for range limits on div is incorrect and will
> never return -EINVAL. Fix this by replacing && with ||
> 
> Detected by CoverityScan, CID#1446580 ("Structurally dead code")
> 
> Signed-off-by: Colin Ian King <colin.king-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
> ---
>   drivers/spi/spi-stm32.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/spi/spi-stm32.c b/drivers/spi/spi-stm32.c
> index 0553f61ab3b7..b75909e7b117 100644
> --- a/drivers/spi/spi-stm32.c
> +++ b/drivers/spi/spi-stm32.c
> @@ -262,7 +262,7 @@ static int stm32_spi_prepare_mbr(struct stm32_spi *spi, u32 speed_hz)
>   	 * no need to check it there.
>   	 * However, we need to ensure the following calculations.
>   	 */
> -	if ((div < SPI_MBR_DIV_MIN) &&
> +	if ((div < SPI_MBR_DIV_MIN) ||
>   	    (div > SPI_MBR_DIV_MAX))
>   		return -EINVAL;
>   
> 

Reviewed-by: Amelie Delaunay <amelie.delaunay-qxv4g6HH51o@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH][spi-next] spi: stm32: fix range limit checks on div
@ 2017-06-23 12:42   ` Amelie DELAUNAY
  0 siblings, 0 replies; 20+ messages in thread
From: Amelie DELAUNAY @ 2017-06-23 12:42 UTC (permalink / raw)
  To: linux-arm-kernel


On 06/22/2017 05:41 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Currently the check for range limits on div is incorrect and will
> never return -EINVAL. Fix this by replacing && with ||
> 
> Detected by CoverityScan, CID#1446580 ("Structurally dead code")
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   drivers/spi/spi-stm32.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/spi/spi-stm32.c b/drivers/spi/spi-stm32.c
> index 0553f61ab3b7..b75909e7b117 100644
> --- a/drivers/spi/spi-stm32.c
> +++ b/drivers/spi/spi-stm32.c
> @@ -262,7 +262,7 @@ static int stm32_spi_prepare_mbr(struct stm32_spi *spi, u32 speed_hz)
>   	 * no need to check it there.
>   	 * However, we need to ensure the following calculations.
>   	 */
> -	if ((div < SPI_MBR_DIV_MIN) &&
> +	if ((div < SPI_MBR_DIV_MIN) ||
>   	    (div > SPI_MBR_DIV_MAX))
>   		return -EINVAL;
>   
> 

Reviewed-by: Amelie Delaunay <amelie.delaunay@st.com>

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2017-06-23 12:42 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-22 15:41 [PATCH][spi-next] spi: stm32: fix range limit checks on div Colin King
2017-06-22 15:41 ` Colin King
2017-06-22 15:41 ` Colin King
2017-06-22 15:41 ` Colin King
2017-06-22 15:49 ` Amelie DELAUNAY
2017-06-22 15:49   ` Amelie DELAUNAY
2017-06-22 15:49   ` Amelie DELAUNAY
2017-06-22 15:49   ` Amelie DELAUNAY
2017-06-22 15:50   ` Colin Ian King
2017-06-22 15:50     ` Colin Ian King
2017-06-22 15:50     ` Colin Ian King
2017-06-22 15:50     ` Colin Ian King
2017-06-23 11:11   ` Mark Brown
2017-06-23 11:11     ` Mark Brown
2017-06-23 11:11     ` Mark Brown
2017-06-23 11:11     ` Mark Brown
2017-06-23 12:42 ` Amelie DELAUNAY
2017-06-23 12:42   ` Amelie DELAUNAY
2017-06-23 12:42   ` Amelie DELAUNAY
2017-06-23 12:42   ` Amelie DELAUNAY

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.