lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <fb040564-eccd-0ef7-ff73-df3f3d20533f@gmx.de>
Date:   Wed, 12 Jul 2023 17:41:11 +0200
From:   Helge Deller <deller@....de>
To:     Colin Ian King <colin.i.king@...il.com>,
        linux-fbdev@...r.kernel.org, dri-devel@...ts.freedesktop.org
Cc:     kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH][next] video: fbdev: kyro: make some const read-only
 arrays static

On 7/12/23 16:57, Colin Ian King wrote:
> Don't populate the const read-only arrays on the stack but instead
> make them static const. Also makes the object code a little smaller.

Looks good, but you can optimze even further...

> Signed-off-by: Colin Ian King <colin.i.king@...il.com>
> ---
>   drivers/video/fbdev/kyro/STG4000InitDevice.c | 10 +++++-----
>   1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/video/fbdev/kyro/STG4000InitDevice.c b/drivers/video/fbdev/kyro/STG4000InitDevice.c
> index edfa0a04854d..bf1ee3addbd0 100644
> --- a/drivers/video/fbdev/kyro/STG4000InitDevice.c
> +++ b/drivers/video/fbdev/kyro/STG4000InitDevice.c
> @@ -83,11 +83,11 @@ volatile u32 i,count=0; \
>   static u32 InitSDRAMRegisters(volatile STG4000REG __iomem *pSTGReg,
>   			      u32 dwSubSysID, u32 dwRevID)
>   {
> -	u32 adwSDRAMArgCfg0[] = { 0xa0, 0x80, 0xa0, 0xa0, 0xa0 };
> -	u32 adwSDRAMCfg1[] = { 0x8732, 0x8732, 0xa732, 0xa732, 0x8732 };
> -	u32 adwSDRAMCfg2[] = { 0x87d2, 0x87d2, 0xa7d2, 0x87d2, 0xa7d2 };
> -	u32 adwSDRAMRsh[] = { 36, 39, 40 };
> -	u32 adwChipSpeed[] = { 110, 120, 125 };> +	static const u32 adwSDRAMArgCfg0[] = { 0xa0, 0x80, 0xa0, 0xa0, 0xa0 };

Make this u8 instead of u32 (saves 5*3 = 15 bytes):
+	static const u8 adwSDRAMArgCfg0[] = { 0xa0, 0x80, 0xa0, 0xa0, 0xa0 };

> +	static const u32 adwSDRAMCfg1[] = { 0x8732, 0x8732, 0xa732, 0xa732, 0x8732 };

u16

> +	static const u32 adwSDRAMCfg2[] = { 0x87d2, 0x87d2, 0xa7d2, 0x87d2, 0xa7d2 };

u16

> +	static const u32 adwSDRAMRsh[] = { 36, 39, 40 };

u8

> +	static const u32 adwChipSpeed[] = { 110, 120, 125 };

u8...

Can you change that (test compile) and resend?

Helge

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ