diff mbox series

tools/testing/nvdimm: Fix missing 'fallthrough' warning

Message ID 162767522046.3313209.14767278726893995797.stgit@dwillia2-desk3.amr.corp.intel.com (mailing list archive)
State Accepted
Commit f21453b0ff6e307bfd59e7a126d9848cea25315c
Headers show
Series tools/testing/nvdimm: Fix missing 'fallthrough' warning | expand

Commit Message

Dan Williams July 30, 2021, 8 p.m. UTC
Use "fallthrough;" to address:

tools/testing/nvdimm/test/nfit.c: In function ‘nd_intel_test_finish_query’:
tools/testing/nvdimm/test/nfit.c:436:37: warning: this statement may
	fall through [-Wimplicit-fallthrough=]
  436 |                 fw->missed_activate = false;
      |                 ~~~~~~~~~~~~~~~~~~~~^~~~~~~
tools/testing/nvdimm/test/nfit.c:438:9: note: here
  438 |         case FW_STATE_UPDATED:
      |         ^~~~

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 tools/testing/nvdimm/test/nfit.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jeff Moyer Aug. 4, 2021, 5:13 p.m. UTC | #1
Dan Williams <dan.j.williams@intel.com> writes:

> Use "fallthrough;" to address:
>
> tools/testing/nvdimm/test/nfit.c: In function ‘nd_intel_test_finish_query’:
> tools/testing/nvdimm/test/nfit.c:436:37: warning: this statement may
> 	fall through [-Wimplicit-fallthrough=]
>   436 |                 fw->missed_activate = false;
>       |                 ~~~~~~~~~~~~~~~~~~~~^~~~~~~
> tools/testing/nvdimm/test/nfit.c:438:9: note: here
>   438 |         case FW_STATE_UPDATED:
>       |         ^~~~
>
> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
> ---
>  tools/testing/nvdimm/test/nfit.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/testing/nvdimm/test/nfit.c b/tools/testing/nvdimm/test/nfit.c
> index 54f367cbadae..b1bff5fb0f65 100644
> --- a/tools/testing/nvdimm/test/nfit.c
> +++ b/tools/testing/nvdimm/test/nfit.c
> @@ -434,7 +434,7 @@ static int nd_intel_test_finish_query(struct nfit_test *t,
>  		dev_dbg(dev, "%s: transition out verify\n", __func__);
>  		fw->state = FW_STATE_UPDATED;
>  		fw->missed_activate = false;
> -		/* fall through */
> +		fallthrough;
>  	case FW_STATE_UPDATED:
>  		nd_cmd->status = 0;
>  		/* bogus test version */

Reviewed-by: Jeff Moyer <jmoyer@redhat.com>
diff mbox series

Patch

diff --git a/tools/testing/nvdimm/test/nfit.c b/tools/testing/nvdimm/test/nfit.c
index 54f367cbadae..b1bff5fb0f65 100644
--- a/tools/testing/nvdimm/test/nfit.c
+++ b/tools/testing/nvdimm/test/nfit.c
@@ -434,7 +434,7 @@  static int nd_intel_test_finish_query(struct nfit_test *t,
 		dev_dbg(dev, "%s: transition out verify\n", __func__);
 		fw->state = FW_STATE_UPDATED;
 		fw->missed_activate = false;
-		/* fall through */
+		fallthrough;
 	case FW_STATE_UPDATED:
 		nd_cmd->status = 0;
 		/* bogus test version */