* [PATCH] fbdev: matrox: make array wtst_xlat static const, makes object smaller
@ 2019-09-06 18:11 ` Colin King
0 siblings, 0 replies; 7+ messages in thread
From: Colin King @ 2019-09-06 18:11 UTC (permalink / raw)
To: Bartlomiej Zolnierkiewicz, linux-fbdev, dri-devel
Cc: kernel-janitors, linux-kernel
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
+ };
+
minfo->values.reg.mctlwtst_core = (minfo->values.reg.mctlwtst & ~7) |
wtst_xlat[minfo->values.reg.mctlwtst & 7];
}
--
2.20.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH] fbdev: matrox: make array wtst_xlat static const, makes object smaller
@ 2019-09-06 18:11 ` Colin King
0 siblings, 0 replies; 7+ messages in thread
From: Colin King @ 2019-09-06 18:11 UTC (permalink / raw)
To: Bartlomiej Zolnierkiewicz, linux-fbdev, dri-devel
Cc: kernel-janitors, linux-kernel
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
+ };
+
minfo->values.reg.mctlwtst_core = (minfo->values.reg.mctlwtst & ~7) |
wtst_xlat[minfo->values.reg.mctlwtst & 7];
}
--
2.20.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] fbdev: matrox: make array wtst_xlat static const, makes object smaller
2019-09-06 18:11 ` Colin King
@ 2019-09-06 18:17 ` Ville Syrjälä
-1 siblings, 0 replies; 7+ messages in thread
From: Ville Syrjälä @ 2019-09-06 18:17 UTC (permalink / raw)
To: Colin King
Cc: Bartlomiej Zolnierkiewicz, linux-fbdev, dri-devel,
kernel-janitors, linux-kernel
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] fbdev: matrox: make array wtst_xlat static const, makes object smaller
@ 2019-09-06 18:17 ` Ville Syrjälä
0 siblings, 0 replies; 7+ messages in thread
From: Ville Syrjälä @ 2019-09-06 18:17 UTC (permalink / raw)
To: Colin King
Cc: Bartlomiej Zolnierkiewicz, linux-fbdev, dri-devel,
kernel-janitors, linux-kernel
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] fbdev: matrox: make array wtst_xlat static const, makes object smaller
2019-09-06 18:17 ` Ville Syrjälä
(?)
@ 2020-01-03 12:22 ` Bartlomiej Zolnierkiewicz
-1 siblings, 0 replies; 7+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2020-01-03 12:22 UTC (permalink / raw)
To: Ville Syrjälä, Colin King
Cc: linux-fbdev, dri-devel, kernel-janitors, linux-kernel
On 9/6/19 8:17 PM, Ville Syrjälä wrote:
> 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>
Thanks, patch queued for v5.6 (also sorry for the delay).
>> ---
>> 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.
Good idea, I've converted the table to u8 while applying the patch.
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
>> + };
>> +
>> 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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] fbdev: matrox: make array wtst_xlat static const, makes object smaller
@ 2020-01-03 12:22 ` Bartlomiej Zolnierkiewicz
0 siblings, 0 replies; 7+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2020-01-03 12:22 UTC (permalink / raw)
To: Ville Syrjälä, Colin King
Cc: linux-fbdev, kernel-janitors, linux-kernel, dri-devel
On 9/6/19 8:17 PM, Ville Syrjälä wrote:
> 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>
Thanks, patch queued for v5.6 (also sorry for the delay).
>> ---
>> 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.
Good idea, I've converted the table to u8 while applying the patch.
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
>> + };
>> +
>> 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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] fbdev: matrox: make array wtst_xlat static const, makes object smaller
@ 2020-01-03 12:22 ` Bartlomiej Zolnierkiewicz
0 siblings, 0 replies; 7+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2020-01-03 12:22 UTC (permalink / raw)
To: Ville Syrjälä, Colin King
Cc: linux-fbdev, kernel-janitors, linux-kernel, dri-devel
On 9/6/19 8:17 PM, Ville Syrjälä wrote:
> 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>
Thanks, patch queued for v5.6 (also sorry for the delay).
>> ---
>> 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.
Good idea, I've converted the table to u8 while applying the patch.
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
>> + };
>> +
>> 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
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2020-01-03 12:22 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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ä
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
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.