[dpdk-dev] crypto/dpaa2_sec: fix build with GCC 7

Message ID 20180129223650.16777-1-thomas@monjalon.net (mailing list archive)
State Accepted, archived
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Thomas Monjalon Jan. 29, 2018, 10:36 p.m. UTC
  Seen with GCC 7.2.0, a switch fall through is detected and
cannot be fixed with a fall-through comment or attribute:

drivers/crypto/dpaa2_sec/hw/rta/operation_cmd.h:89:6: error:
this statement may fall through [-Werror=implicit-fallthrough=]
   if (rta_sec_era < RTA_SEC_ERA_2)
      ^

The check is disabled in dpaa2_sec Makefile but not in dpaa_sec Makefile
which uses source code shared by dpaa2_sec.

The workaround is to disable the check at the beginning of the file.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 drivers/crypto/dpaa2_sec/hw/rta/operation_cmd.h | 2 ++
 1 file changed, 2 insertions(+)
  

Comments

Thomas Monjalon Jan. 29, 2018, 11:18 p.m. UTC | #1
29/01/2018 23:36, Thomas Monjalon:
> Seen with GCC 7.2.0, a switch fall through is detected and
> cannot be fixed with a fall-through comment or attribute:
> 
> drivers/crypto/dpaa2_sec/hw/rta/operation_cmd.h:89:6: error:
> this statement may fall through [-Werror=implicit-fallthrough=]
>    if (rta_sec_era < RTA_SEC_ERA_2)
>       ^
> 
> The check is disabled in dpaa2_sec Makefile but not in dpaa_sec Makefile
> which uses source code shared by dpaa2_sec.
> 
> The workaround is to disable the check at the beginning of the file.
> 
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>

Applied
  

Patch

diff --git a/drivers/crypto/dpaa2_sec/hw/rta/operation_cmd.h b/drivers/crypto/dpaa2_sec/hw/rta/operation_cmd.h
index dae4bdfa1..c4febcb2f 100644
--- a/drivers/crypto/dpaa2_sec/hw/rta/operation_cmd.h
+++ b/drivers/crypto/dpaa2_sec/hw/rta/operation_cmd.h
@@ -8,6 +8,8 @@ 
 #ifndef __RTA_OPERATION_CMD_H__
 #define __RTA_OPERATION_CMD_H__
 
+#pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
+
 extern enum rta_sec_era rta_sec_era;
 
 static inline int