From: Zev Weiss <zweiss@equinix.com>
To: Joel Stanley <joel@jms.id.au>
Cc: "openbmc@lists.ozlabs.org" <openbmc@lists.ozlabs.org>,
"Cédric Le Goater" <clg@kaod.org>
Subject: Re: [PATCH u-boot v2019.04-aspeed-openbmc] otp: Reduce size of struct otpkey
Date: Sat, 16 Jul 2022 09:08:47 +0000 [thread overview]
Message-ID: <20220716090847.GC9659@packtop> (raw)
In-Reply-To: <20220714074552.818306-1-joel@jms.id.au>
On Thu, Jul 14, 2022 at 12:45:52AM PDT, Joel Stanley wrote:
>Don't store more information than is used.
>
> Function old new delta
> _otp_print_key 540 580 +40
> otp_verify_boot_image 1336 1328 -8
> a2_key_type 640 40 -600
> a1_key_type 640 40 -600
> a3_key_type 1024 64 -960
> a0_key_type 1024 64 -960
> Total: Before=279318, After=276230, chg -1.11%
>
>Signed-off-by: Joel Stanley <joel@jms.id.au>
>---
> cmd/otp.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
>diff --git a/cmd/otp.c b/cmd/otp.c
>index 049c217d6048..6dd2d2bdfb17 100644
>--- a/cmd/otp.c
>+++ b/cmd/otp.c
>@@ -133,11 +133,11 @@ struct otpstrap_status {
> };
>
> struct otpkey_type {
>- int value;
>- int key_type;
>- int order;
>- int need_id;
>- char information[110];
>+ int value: 4;
>+ int key_type: 4;
>+ int order: 1;
>+ int need_id: 1;
I'm not sure if there's any chance it could lead to any actual problems
here, but I think some static analyzers get unhappy about single-bit
signed bitfields...perhaps these (maybe all four?) should be unsigned
instead?
>+ char *information;
> };
>
> struct otp_pro_sts {
>--
>2.35.1
>
prev parent reply other threads:[~2022-07-16 9:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-14 7:45 [PATCH u-boot v2019.04-aspeed-openbmc] otp: Reduce size of struct otpkey Joel Stanley
2022-07-16 9:08 ` Zev Weiss [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=20220716090847.GC9659@packtop \
--to=zweiss@equinix.com \
--cc=clg@kaod.org \
--cc=joel@jms.id.au \
--cc=openbmc@lists.ozlabs.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.