From: Kees Cook <kees@kernel.org>
To: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
Cc: "Gustavo A. R. Silva" <gustavoars@kernel.org>,
Lukasz Majczak <lma@chromium.org>,
Wim Van Sebroeck <wim@linux-watchdog.org>,
Guenter Roeck <linux@roeck-us.net>,
Benson Leung <bleung@chromium.org>,
Tzung-Bi Shih <tzungbi@kernel.org>,
chrome-platform@lists.linux.dev, linux-watchdog@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org
Subject: Re: [PATCH v2][next] watchdog: cros-ec: Avoid -Wflex-array-member-not-at-end warning
Date: Mon, 7 Apr 2025 13:36:16 -0700 [thread overview]
Message-ID: <202504071331.D9E4D6B058@keescook> (raw)
In-Reply-To: <e8114ca6-d092-482b-9d6b-db7ea1c15cbc@embeddedor.com>
On Mon, Apr 07, 2025 at 01:42:07PM -0600, Gustavo A. R. Silva wrote:
>
> >
> > > + msg->command = EC_CMD_HANG_DETECT;
> > > + msg->insize = (arg->req.command == EC_HANG_DETECT_CMD_GET_STATUS) ?
> > > + sizeof(struct ec_response_hang_detect) :
> > > + 0;
> > > + msg->outsize = sizeof(struct ec_params_hang_detect);
> > > + *(struct ec_params_hang_detect *)msg->data = arg->req;
> > > +
> > > + ret = cros_ec_cmd_xfer_status(cros_ec, msg);
> > > if (ret < 0)
> > > return ret;
> > > - arg->resp = buf.data.resp;
> > > + arg->resp = *(struct ec_response_hang_detect *)msg->data;
> >
> > msg->data used twice and a "sizeof()" earlier... might be nicer to have
> > an explicit pointer?
>
> Those are two different pointers:
>
> *(struct ec_params_hang_detect *)msg->data = arg->req;
> arg->resp = *(struct ec_response_hang_detect *)msg->data;
Argh. I did it again. I can't see "params" vs "response". q_q
Sorry for the noise!
Reviewed-by: Kees Cook <kees@kernel.org>
--
Kees Cook
next prev parent reply other threads:[~2025-04-07 20:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-27 17:12 [PATCH v2][next] watchdog: cros-ec: Avoid -Wflex-array-member-not-at-end warning Gustavo A. R. Silva
2025-03-28 4:41 ` Guenter Roeck
2025-04-07 19:13 ` Kees Cook
2025-04-07 19:42 ` Gustavo A. R. Silva
2025-04-07 20:36 ` Kees Cook [this message]
2025-04-16 0:24 ` Gustavo A. R. Silva
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=202504071331.D9E4D6B058@keescook \
--to=kees@kernel.org \
--cc=bleung@chromium.org \
--cc=chrome-platform@lists.linux.dev \
--cc=gustavo@embeddedor.com \
--cc=gustavoars@kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=lma@chromium.org \
--cc=tzungbi@kernel.org \
--cc=wim@linux-watchdog.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.