linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] io: core: mark expected switch fall-through
@ 2017-11-08 17:36 Gustavo A. R. Silva
  2017-11-08 17:59 ` Peter Meerwald-Stadler
  0 siblings, 1 reply; 5+ messages in thread
From: Gustavo A. R. Silva @ 2017-11-08 17:36 UTC (permalink / raw)
  To: Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler
  Cc: linux-iio, linux-kernel, Gustavo A. R. Silva

In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

Addresses-Coverity-ID: 1397962
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
---
 drivers/iio/industrialio-core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c
index 9c4cfd1..2e8e36f 100644
--- a/drivers/iio/industrialio-core.c
+++ b/drivers/iio/industrialio-core.c
@@ -588,6 +588,7 @@ static ssize_t __iio_format_value(char *buf, size_t len, unsigned int type,
 		return snprintf(buf, len, "%d", vals[0]);
 	case IIO_VAL_INT_PLUS_MICRO_DB:
 		scale_db = true;
+		/* fall through */
 	case IIO_VAL_INT_PLUS_MICRO:
 		if (vals[1] < 0)
 			return snprintf(buf, len, "-%d.%06u%s", abs(vals[0]),
-- 
2.7.4

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

* Re: [PATCH] io: core: mark expected switch fall-through
  2017-11-08 17:36 [PATCH] io: core: mark expected switch fall-through Gustavo A. R. Silva
@ 2017-11-08 17:59 ` Peter Meerwald-Stadler
  2017-11-08 18:02   ` Gustavo A. R. Silva
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Meerwald-Stadler @ 2017-11-08 17:59 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen, linux-iio,
	linux-kernel


> In preparation to enabling -Wimplicit-fallthrough, mark switch cases
> where we are expecting to fall through.

please fix the subject line, should be 
iio: core: Mark...

thx, p.
 
> Addresses-Coverity-ID: 1397962
> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
> ---
>  drivers/iio/industrialio-core.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c
> index 9c4cfd1..2e8e36f 100644
> --- a/drivers/iio/industrialio-core.c
> +++ b/drivers/iio/industrialio-core.c
> @@ -588,6 +588,7 @@ static ssize_t __iio_format_value(char *buf, size_t len, unsigned int type,
>  		return snprintf(buf, len, "%d", vals[0]);
>  	case IIO_VAL_INT_PLUS_MICRO_DB:
>  		scale_db = true;
> +		/* fall through */
>  	case IIO_VAL_INT_PLUS_MICRO:
>  		if (vals[1] < 0)
>  			return snprintf(buf, len, "-%d.%06u%s", abs(vals[0]),
> 

-- 

Peter Meerwald-Stadler
Mobile: +43 664 24 44 418

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

* Re: [PATCH] io: core: mark expected switch fall-through
  2017-11-08 17:59 ` Peter Meerwald-Stadler
@ 2017-11-08 18:02   ` Gustavo A. R. Silva
  2017-11-08 18:08     ` [PATCH v2] iio: core: Mark " Gustavo A. R. Silva
  0 siblings, 1 reply; 5+ messages in thread
From: Gustavo A. R. Silva @ 2017-11-08 18:02 UTC (permalink / raw)
  To: Peter Meerwald-Stadler
  Cc: Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen, linux-iio,
	linux-kernel


Quoting Peter Meerwald-Stadler <pmeerw@pmeerw.net>:

>> In preparation to enabling -Wimplicit-fallthrough, mark switch cases
>> where we are expecting to fall through.
>
> please fix the subject line, should be
> iio: core: Mark...
>

Oh yeah. I'll send v2 shortly.

Thanks!
--
Gustavo A. R. Silva

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

* [PATCH v2] iio: core: Mark expected switch fall-through
  2017-11-08 18:02   ` Gustavo A. R. Silva
@ 2017-11-08 18:08     ` Gustavo A. R. Silva
  2017-11-19 14:48       ` Jonathan Cameron
  0 siblings, 1 reply; 5+ messages in thread
From: Gustavo A. R. Silva @ 2017-11-08 18:08 UTC (permalink / raw)
  To: Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler
  Cc: linux-iio, linux-kernel, Gustavo A. R. Silva

In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

Addresses-Coverity-ID: 1397962
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
---
Changes in v2:
 Fix subject line.

 drivers/iio/industrialio-core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c
index 9c4cfd1..2e8e36f 100644
--- a/drivers/iio/industrialio-core.c
+++ b/drivers/iio/industrialio-core.c
@@ -588,6 +588,7 @@ static ssize_t __iio_format_value(char *buf, size_t len, unsigned int type,
 		return snprintf(buf, len, "%d", vals[0]);
 	case IIO_VAL_INT_PLUS_MICRO_DB:
 		scale_db = true;
+		/* fall through */
 	case IIO_VAL_INT_PLUS_MICRO:
 		if (vals[1] < 0)
 			return snprintf(buf, len, "-%d.%06u%s", abs(vals[0]),
-- 
2.7.4

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

* Re: [PATCH v2] iio: core: Mark expected switch fall-through
  2017-11-08 18:08     ` [PATCH v2] iio: core: Mark " Gustavo A. R. Silva
@ 2017-11-19 14:48       ` Jonathan Cameron
  0 siblings, 0 replies; 5+ messages in thread
From: Jonathan Cameron @ 2017-11-19 14:48 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler,
	linux-iio, linux-kernel

On Wed, 8 Nov 2017 12:08:26 -0600
"Gustavo A. R. Silva" <garsilva@embeddedor.com> wrote:

> In preparation to enabling -Wimplicit-fallthrough, mark switch cases
> where we are expecting to fall through.
> 
> Addresses-Coverity-ID: 1397962
> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Applied to the togreg branch of iio.git and will be pushed out as
testing. 

Thanks,

Jonathan
> ---
> Changes in v2:
>  Fix subject line.
> 
>  drivers/iio/industrialio-core.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c
> index 9c4cfd1..2e8e36f 100644
> --- a/drivers/iio/industrialio-core.c
> +++ b/drivers/iio/industrialio-core.c
> @@ -588,6 +588,7 @@ static ssize_t __iio_format_value(char *buf, size_t len, unsigned int type,
>  		return snprintf(buf, len, "%d", vals[0]);
>  	case IIO_VAL_INT_PLUS_MICRO_DB:
>  		scale_db = true;
> +		/* fall through */
>  	case IIO_VAL_INT_PLUS_MICRO:
>  		if (vals[1] < 0)
>  			return snprintf(buf, len, "-%d.%06u%s", abs(vals[0]),

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

end of thread, other threads:[~2017-11-19 14:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-08 17:36 [PATCH] io: core: mark expected switch fall-through Gustavo A. R. Silva
2017-11-08 17:59 ` Peter Meerwald-Stadler
2017-11-08 18:02   ` Gustavo A. R. Silva
2017-11-08 18:08     ` [PATCH v2] iio: core: Mark " Gustavo A. R. Silva
2017-11-19 14:48       ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).