All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dmaengine: sh: make array descs static
@ 2021-09-15 11:19 Colin King
  2021-09-15 11:20 ` Colin Ian King
  0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2021-09-15 11:19 UTC (permalink / raw)
  To: Vinod Koul, dmaengine; +Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Don't populate the read-only array ds_lut on the stack but instead it
static. Also makes the object code smaller by 163 bytes:

Before:
   text    data     bss     dec     hex filename
  23508    4796       0   28304    6e90 ./drivers/dma/sh/rz-dmac.o

After:
   text    data     bss     dec     hex filename
  23281    4860       0   28141    6ded ./drivers/dma/sh/rz-dmac.o

(gcc version 11.2.0)

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/dma/sh/rz-dmac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/dma/sh/rz-dmac.c b/drivers/dma/sh/rz-dmac.c
index f9f30cbeccbe..005f1a3ff634 100644
--- a/drivers/dma/sh/rz-dmac.c
+++ b/drivers/dma/sh/rz-dmac.c
@@ -573,7 +573,7 @@ static void rz_dmac_issue_pending(struct dma_chan *chan)
 static u8 rz_dmac_ds_to_val_mapping(enum dma_slave_buswidth ds)
 {
 	u8 i;
-	const enum dma_slave_buswidth ds_lut[] = {
+	static const enum dma_slave_buswidth ds_lut[] = {
 		DMA_SLAVE_BUSWIDTH_1_BYTE,
 		DMA_SLAVE_BUSWIDTH_2_BYTES,
 		DMA_SLAVE_BUSWIDTH_4_BYTES,
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] dmaengine: sh: make array descs static
  2021-09-15 11:19 [PATCH] dmaengine: sh: make array descs static Colin King
@ 2021-09-15 11:20 ` Colin Ian King
  0 siblings, 0 replies; 2+ messages in thread
From: Colin Ian King @ 2021-09-15 11:20 UTC (permalink / raw)
  To: Vinod Koul, dmaengine; +Cc: kernel-janitors, linux-kernel

Incorrect $SUBJECT, V2 sent

On 15/09/2021 12:19, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Don't populate the read-only array ds_lut on the stack but instead it
> static. Also makes the object code smaller by 163 bytes:
> 
> Before:
>    text    data     bss     dec     hex filename
>   23508    4796       0   28304    6e90 ./drivers/dma/sh/rz-dmac.o
> 
> After:
>    text    data     bss     dec     hex filename
>   23281    4860       0   28141    6ded ./drivers/dma/sh/rz-dmac.o
> 
> (gcc version 11.2.0)
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  drivers/dma/sh/rz-dmac.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/dma/sh/rz-dmac.c b/drivers/dma/sh/rz-dmac.c
> index f9f30cbeccbe..005f1a3ff634 100644
> --- a/drivers/dma/sh/rz-dmac.c
> +++ b/drivers/dma/sh/rz-dmac.c
> @@ -573,7 +573,7 @@ static void rz_dmac_issue_pending(struct dma_chan *chan)
>  static u8 rz_dmac_ds_to_val_mapping(enum dma_slave_buswidth ds)
>  {
>  	u8 i;
> -	const enum dma_slave_buswidth ds_lut[] = {
> +	static const enum dma_slave_buswidth ds_lut[] = {
>  		DMA_SLAVE_BUSWIDTH_1_BYTE,
>  		DMA_SLAVE_BUSWIDTH_2_BYTES,
>  		DMA_SLAVE_BUSWIDTH_4_BYTES,
> 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-09-15 11:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-15 11:19 [PATCH] dmaengine: sh: make array descs static Colin King
2021-09-15 11:20 ` Colin Ian King

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.