diff options
author | Colin Ian King <colin.king@canonical.com> | 2019-09-06 19:11:14 +0100 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> | 2020-01-03 14:27:47 +0100 |
commit | 776b0aa9a645804cbae0e9adf7e3556c25707da9 (patch) | |
tree | 8f7c2279bc91db6c8757a9fd35311023865472e9 /drivers/video/fbdev | |
parent | 3149299e105b678bd30df63f07bb4ab54ed0c373 (diff) | |
download | linux-776b0aa9a645804cbae0e9adf7e3556c25707da9.tar.gz linux-776b0aa9a645804cbae0e9adf7e3556c25707da9.tar.bz2 linux-776b0aa9a645804cbae0e9adf7e3556c25707da9.zip |
fbdev: matrox: make array wtst_xlat static const, makes object smaller
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>
[b.zolnierkie: use u8 while at it (suggested by Ville Syrjälä)]
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190906181114.31414-1-colin.king@canonical.com
Diffstat (limited to 'drivers/video/fbdev')
-rw-r--r-- | drivers/video/fbdev/matrox/matroxfb_misc.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/video/fbdev/matrox/matroxfb_misc.c b/drivers/video/fbdev/matrox/matroxfb_misc.c index c7aaca12805e..8f159a2ad8d0 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 u8 wtst_xlat[] = { + 0, 1, 5, 6, 7, 5, 2, 3 + }; + minfo->values.reg.mctlwtst_core = (minfo->values.reg.mctlwtst & ~7) | wtst_xlat[minfo->values.reg.mctlwtst & 7]; } |