From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
To: Jiri Slaby <jirislaby@kernel.org>,
"Gustavo A. R. Silva" <gustavoars@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org,
linux-hardening@vger.kernel.org
Subject: Re: [PATCH v3][next] tty: tty_buffer: Avoid hundreds of -Wflex-array-member-not-at-end warnings
Date: Tue, 11 Feb 2025 17:32:57 +1030 [thread overview]
Message-ID: <55e010d1-4f98-40f1-b009-78580f895b86@embeddedor.com> (raw)
In-Reply-To: <daea13b0-137c-4ab5-8388-1d46919b8609@kernel.org>
>
>> @@ -576,11 +579,14 @@ int tty_insert_flip_string_and_push_buffer(struct tty_port *port,
>> void tty_buffer_init(struct tty_port *port)
>> {
>> struct tty_bufhead *buf = &port->buf;
>> + struct tty_buffer *buf_sentinel;
>> +
>> + buf_sentinel = container_of(&buf->sentinel, struct tty_buffer, hdr);
>
> Bah, so this is ugly and even dangerous if someone adds a member to tty_buffer outside _hdr.
>
> We should link headers in the list, it appears.
What should that patch look like?
--
Gustavo
prev parent reply other threads:[~2025-02-11 7:03 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-06 3:39 [PATCH v3][next] tty: tty_buffer: Avoid hundreds of -Wflex-array-member-not-at-end warnings Gustavo A. R. Silva
2025-02-06 4:40 ` Greg Kroah-Hartman
2025-02-06 23:23 ` Gustavo A. R. Silva
2025-02-07 9:38 ` Greg Kroah-Hartman
2025-02-06 9:12 ` Jiri Slaby
2025-02-06 9:23 ` Gustavo A. R. Silva
2025-02-11 7:02 ` Gustavo A. R. Silva [this message]
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=55e010d1-4f98-40f1-b009-78580f895b86@embeddedor.com \
--to=gustavo@embeddedor.com \
--cc=gregkh@linuxfoundation.org \
--cc=gustavoars@kernel.org \
--cc=jirislaby@kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.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