DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: dev@dpdk.org
Cc: Ferruh Yigit <ferruh.yigit@intel.com>
Subject: [dpdk-kmods] linux/igb_uio: fix build for switch fall through
Date: Wed, 15 Dec 2021 18:48:59 +0000	[thread overview]
Message-ID: <20211215184859.1859870-1-ferruh.yigit@intel.com> (raw)

Linux is using '-Wimplicit-fallthrough=5' compiler option, which doesn't
take any fall through comments into account but only uses compiler
'fallthrough' attribute to document fall through action is intended.

"falls through" comment was used in the code which is causing a build
error now, this patch converts comment to the 'fallthrough' macro
defined in the Linux.

To cover the case where Linux version doesn't have the macro, defined it
in the compatibility header too.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 linux/igb_uio/compat.h  | 4 ++++
 linux/igb_uio/igb_uio.c | 6 +++---
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/linux/igb_uio/compat.h b/linux/igb_uio/compat.h
index 8dbb896ae118..04ff7f60031f 100644
--- a/linux/igb_uio/compat.h
+++ b/linux/igb_uio/compat.h
@@ -152,3 +152,7 @@ static inline bool igbuio_kernel_is_locked_down(void)
 	return false;
 #endif
 }
+
+#ifndef fallthrough
+#define fallthrough	do {} while (0)  /* fallthrough */
+#endif
diff --git a/linux/igb_uio/igb_uio.c b/linux/igb_uio/igb_uio.c
index ea439d131de1..33e0e0286b69 100644
--- a/linux/igb_uio/igb_uio.c
+++ b/linux/igb_uio/igb_uio.c
@@ -250,7 +250,7 @@ igbuio_pci_enable_interrupts(struct rte_uio_pci_dev *udev)
 		}
 #endif
 
-	/* falls through - to MSI */
+	fallthrough;
 	case RTE_INTR_MODE_MSI:
 #ifndef HAVE_ALLOC_IRQ_VECTORS
 		if (pci_enable_msi(udev->pdev) == 0) {
@@ -269,7 +269,7 @@ igbuio_pci_enable_interrupts(struct rte_uio_pci_dev *udev)
 			break;
 		}
 #endif
-	/* falls through - to INTX */
+	fallthrough;
 	case RTE_INTR_MODE_LEGACY:
 		if (pci_intx_mask_supported(udev->pdev)) {
 			dev_dbg(&udev->pdev->dev, "using INTX");
@@ -279,7 +279,7 @@ igbuio_pci_enable_interrupts(struct rte_uio_pci_dev *udev)
 			break;
 		}
 		dev_notice(&udev->pdev->dev, "PCI INTX mask not supported\n");
-	/* falls through - to no IRQ */
+	fallthrough;
 	case RTE_INTR_MODE_NONE:
 		udev->mode = RTE_INTR_MODE_NONE;
 		udev->info.irq = UIO_IRQ_NONE;
-- 
2.33.1


             reply	other threads:[~2021-12-15 18:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-15 18:48 Ferruh Yigit [this message]
2021-12-15 19:20 ` Stephen Hemminger
2021-12-15 21:04   ` Ferruh Yigit
2021-12-15 23:15     ` Stephen Hemminger
2021-12-16  9:37       ` Ferruh Yigit
2021-12-16 12:03 ` [dpdk-kmods v2] " Ferruh Yigit
2022-01-11 14:32   ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211215184859.1859870-1-ferruh.yigit@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).