From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Colin King <colin.king@canonical.com>
Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org,
kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fbdev: matrox: make array wtst_xlat static const, makes object smaller
Date: Fri, 06 Sep 2019 18:17:14 +0000 [thread overview]
Message-ID: <20190906181714.GU7482@intel.com> (raw)
In-Reply-To: <20190906181114.31414-1-colin.king@canonical.com>
On Fri, Sep 06, 2019 at 07:11:14PM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Don't populate the array wtst_xlat on the stack but instead make it
> static const. Makes the object code smaller by 89 bytes.
>
> Before:
> text data bss dec hex filename
> 14347 840 0 15187 3b53 fbdev/matrox/matroxfb_misc.o
>
> After:
> text data bss dec hex filename
> 14162 936 0 15098 3afa fbdev/matrox/matroxfb_misc.o
>
> (gcc version 9.2.1, amd64)
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
> drivers/video/fbdev/matrox/matroxfb_misc.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/video/fbdev/matrox/matroxfb_misc.c b/drivers/video/fbdev/matrox/matroxfb_misc.c
> index c7aaca12805e..feb0977c82eb 100644
> --- a/drivers/video/fbdev/matrox/matroxfb_misc.c
> +++ b/drivers/video/fbdev/matrox/matroxfb_misc.c
> @@ -673,7 +673,10 @@ static int parse_pins5(struct matrox_fb_info *minfo,
> if (bd->pins[115] & 4) {
> minfo->values.reg.mctlwtst_core = minfo->values.reg.mctlwtst;
> } else {
> - u_int32_t wtst_xlat[] = { 0, 1, 5, 6, 7, 5, 2, 3 };
> + static const u_int32_t wtst_xlat[] = {
> + 0, 1, 5, 6, 7, 5, 2, 3
All of those would easily fit in u8 as well.
> + };
> +
> minfo->values.reg.mctlwtst_core = (minfo->values.reg.mctlwtst & ~7) |
> wtst_xlat[minfo->values.reg.mctlwtst & 7];
> }
> --
> 2.20.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Ville Syrjälä
Intel
WARNING: multiple messages have this Message-ID (diff)
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Colin King <colin.king@canonical.com>
Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org,
kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fbdev: matrox: make array wtst_xlat static const, makes object smaller
Date: Fri, 6 Sep 2019 21:17:14 +0300 [thread overview]
Message-ID: <20190906181714.GU7482@intel.com> (raw)
In-Reply-To: <20190906181114.31414-1-colin.king@canonical.com>
On Fri, Sep 06, 2019 at 07:11:14PM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Don't populate the array wtst_xlat on the stack but instead make it
> static const. Makes the object code smaller by 89 bytes.
>
> Before:
> text data bss dec hex filename
> 14347 840 0 15187 3b53 fbdev/matrox/matroxfb_misc.o
>
> After:
> text data bss dec hex filename
> 14162 936 0 15098 3afa fbdev/matrox/matroxfb_misc.o
>
> (gcc version 9.2.1, amd64)
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
> drivers/video/fbdev/matrox/matroxfb_misc.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/video/fbdev/matrox/matroxfb_misc.c b/drivers/video/fbdev/matrox/matroxfb_misc.c
> index c7aaca12805e..feb0977c82eb 100644
> --- a/drivers/video/fbdev/matrox/matroxfb_misc.c
> +++ b/drivers/video/fbdev/matrox/matroxfb_misc.c
> @@ -673,7 +673,10 @@ static int parse_pins5(struct matrox_fb_info *minfo,
> if (bd->pins[115] & 4) {
> minfo->values.reg.mctlwtst_core = minfo->values.reg.mctlwtst;
> } else {
> - u_int32_t wtst_xlat[] = { 0, 1, 5, 6, 7, 5, 2, 3 };
> + static const u_int32_t wtst_xlat[] = {
> + 0, 1, 5, 6, 7, 5, 2, 3
All of those would easily fit in u8 as well.
> + };
> +
> minfo->values.reg.mctlwtst_core = (minfo->values.reg.mctlwtst & ~7) |
> wtst_xlat[minfo->values.reg.mctlwtst & 7];
> }
> --
> 2.20.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Ville Syrjälä
Intel
next prev parent reply other threads:[~2019-09-06 18:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-06 18:11 [PATCH] fbdev: matrox: make array wtst_xlat static const, makes object smaller Colin King
2019-09-06 18:11 ` Colin King
2019-09-06 18:17 ` Ville Syrjälä [this message]
2019-09-06 18:17 ` Ville Syrjälä
2020-01-03 12:22 ` Bartlomiej Zolnierkiewicz
2020-01-03 12:22 ` Bartlomiej Zolnierkiewicz
2020-01-03 12:22 ` Bartlomiej Zolnierkiewicz
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=20190906181714.GU7482@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=b.zolnierkie@samsung.com \
--cc=colin.king@canonical.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@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 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.