From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: linux-media@vger.kernel.org,
Jacopo Mondi <jacopo.mondi@ideasonboard.com>,
Mehdi Djait <mehdi.djait@linux.intel.com>,
Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Subject: Re: [raw2rgbpnm PATCH v3 1/3] Add explicit switch fallthrough notation
Date: Wed, 18 Feb 2026 11:26:18 +0100 [thread overview]
Message-ID: <20260218102618.GA57525@killaraus.ideasonboard.com> (raw)
In-Reply-To: <20260218083424.2432541-2-sakari.ailus@linux.intel.com>
On Wed, Feb 18, 2026 at 10:34:22AM +0200, Sakari Ailus wrote:
> Use __attribute__((fallthrough)) instead of a comment this is taking
> place, to make modern GCC happy.
This will require gcc 7 or newer, which I think is fine. You could check
the compiler version at build time and emit an error if the compiler is
not recent enough (and you could use that as an opportunity to switch
from make to meson :-)). This is of course out of scope for this series.
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> ---
> raw2rgbpnm.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/raw2rgbpnm.c b/raw2rgbpnm.c
> index baeb8efc863a..5df3ff7ab31d 100644
> --- a/raw2rgbpnm.c
> +++ b/raw2rgbpnm.c
> @@ -362,7 +362,7 @@ static void raw_to_rgb(const struct format_info *info,
>
> case V4L2_PIX_FMT_NV21:
> color_pos = 0;
> - /* fallthrough */
> + __attribute__((fallthrough));
> case V4L2_PIX_FMT_NV12:
> src_luma = src;
> src_chroma = &src[src_width * src_height];
> @@ -576,7 +576,7 @@ static void raw_to_rgb(const struct format_info *info,
> case V4L2_PIX_FMT_SRGGB10:
> if (raw_layout_to_grbg(info, src, src_width, src_height, src_stride))
> error("Can't convert RAW layout to GRBG");
> - /* fallthrough */
> + __attribute__((fallthrough));
> case V4L2_PIX_FMT_SGRBG16:
> case V4L2_PIX_FMT_SGRBG14:
> case V4L2_PIX_FMT_SGRBG12:
> @@ -620,7 +620,7 @@ static void raw_to_rgb(const struct format_info *info,
> case V4L2_PIX_FMT_SRGGB8:
> if (raw_layout_to_grbg(info, src, src_width, src_height, src_stride))
> error("Can't convert RAW layout to GRBG");
> - /* fallthrough */
> + __attribute__((fallthrough));
> case V4L2_PIX_FMT_SGRBG8:
> buf = malloc(src_width * src_height * 3);
> if (buf==NULL) error("out of memory");
> @@ -688,7 +688,7 @@ static void raw_to_rgb(const struct format_info *info,
>
> case V4L2_PIX_FMT_BGR24:
> swaprb = !swaprb;
> - /* fallthrough */
> + __attribute__((fallthrough));
> case V4L2_PIX_FMT_RGB24:
> for (src_y = 0, dst_y = 0; dst_y < src_height; src_y++, dst_y++) {
> for (src_x = 0, dst_x = 0; dst_x < src_width; ) {
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2026-02-18 10:26 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-18 8:34 [raw2rgbpnm PATCH v3 0/3] 10-bit packed raw support Sakari Ailus
2026-02-18 8:34 ` [raw2rgbpnm PATCH v3 1/3] Add explicit switch fallthrough notation Sakari Ailus
2026-02-18 10:26 ` Laurent Pinchart [this message]
2026-02-18 11:21 ` Sakari Ailus
2026-02-18 21:30 ` Laurent Pinchart
2026-02-18 8:34 ` [raw2rgbpnm PATCH v3 2/3] Add compiler options to avoid warnings Sakari Ailus
2026-02-18 10:27 ` Laurent Pinchart
2026-02-18 11:20 ` Sakari Ailus
2026-02-18 8:34 ` [raw2rgbpnm PATCH v3 3/3] Add 10-bit CSI-2 packed format support Sakari Ailus
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=20260218102618.GA57525@killaraus.ideasonboard.com \
--to=laurent.pinchart@ideasonboard.com \
--cc=jacopo.mondi@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=mehdi.djait@linux.intel.com \
--cc=sakari.ailus@linux.intel.com \
--cc=tomi.valkeinen@ideasonboard.com \
/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