[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e8114ca6-d092-482b-9d6b-db7ea1c15cbc@embeddedor.com>
Date: Mon, 7 Apr 2025 13:42:07 -0600
From: "Gustavo A. R. Silva" <gustavo@...eddedor.com>
To: Kees Cook <kees@...nel.org>, "Gustavo A. R. Silva" <gustavoars@...nel.org>
Cc: Lukasz Majczak <lma@...omium.org>,
Wim Van Sebroeck <wim@...ux-watchdog.org>, Guenter Roeck
<linux@...ck-us.net>, Benson Leung <bleung@...omium.org>,
Tzung-Bi Shih <tzungbi@...nel.org>, chrome-platform@...ts.linux.dev,
linux-watchdog@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-hardening@...r.kernel.org
Subject: Re: [PATCH v2][next] watchdog: cros-ec: Avoid
-Wflex-array-member-not-at-end warning
>
>> + 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;
--
Gustavo
Powered by blists - more mailing lists