All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mmc: dw_mmc: make const arrays mszs static
@ 2017-09-03 13:39 ` Colin King
  0 siblings, 0 replies; 4+ messages in thread
From: Colin King @ 2017-09-03 13:39 UTC (permalink / raw)
  To: Jaehoon Chung, Ulf Hansson, linux-mmc; +Cc: kernel-janitors, linux-kernel

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

Don't populate the const arrays mszs on the stack, instead make them
static. Makes the object code smaller by over 310 bytes:

Before:
   text	   data	    bss	    dec	    hex	filename
  47527	   8528	    320	  56375	   dc37	drivers/mmc/host/dw_mmc.o

After:
   text	   data	    bss	    dec	    hex	filename
  47055	   8688	    320	  56063	   daff	drivers/mmc/host/dw_mmc.o

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/mmc/host/dw_mmc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index 860313bd952a..45289c5e0295 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -796,7 +796,7 @@ static int dw_mci_edmac_start_dma(struct dw_mci *host,
 	struct dma_slave_config cfg;
 	struct dma_async_tx_descriptor *desc = NULL;
 	struct scatterlist *sgl = host->data->sg;
-	const u32 mszs[] = {1, 4, 8, 16, 32, 64, 128, 256};
+	static const u32 mszs[] = {1, 4, 8, 16, 32, 64, 128, 256};
 	u32 sg_elems = host->data->sg_len;
 	u32 fifoth_val;
 	u32 fifo_offset = host->fifo_reg - host->regs;
@@ -1003,7 +1003,7 @@ static int dw_mci_get_cd(struct mmc_host *mmc)
 static void dw_mci_adjust_fifoth(struct dw_mci *host, struct mmc_data *data)
 {
 	unsigned int blksz = data->blksz;
-	const u32 mszs[] = {1, 4, 8, 16, 32, 64, 128, 256};
+	static const u32 mszs[] = {1, 4, 8, 16, 32, 64, 128, 256};
 	u32 fifo_width = 1 << host->data_shift;
 	u32 blksz_depth = blksz / fifo_width, fifoth_val;
 	u32 msize = 0, rx_wmark = 1, tx_wmark, tx_wmark_invers;
-- 
2.14.1

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

* [PATCH] mmc: dw_mmc: make const arrays mszs static
@ 2017-09-03 13:39 ` Colin King
  0 siblings, 0 replies; 4+ messages in thread
From: Colin King @ 2017-09-03 13:39 UTC (permalink / raw)
  To: Jaehoon Chung, Ulf Hansson, linux-mmc; +Cc: kernel-janitors, linux-kernel

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

Don't populate the const arrays mszs on the stack, instead make them
static. Makes the object code smaller by over 310 bytes:

Before:
   text	   data	    bss	    dec	    hex	filename
  47527	   8528	    320	  56375	   dc37	drivers/mmc/host/dw_mmc.o

After:
   text	   data	    bss	    dec	    hex	filename
  47055	   8688	    320	  56063	   daff	drivers/mmc/host/dw_mmc.o

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/mmc/host/dw_mmc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index 860313bd952a..45289c5e0295 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -796,7 +796,7 @@ static int dw_mci_edmac_start_dma(struct dw_mci *host,
 	struct dma_slave_config cfg;
 	struct dma_async_tx_descriptor *desc = NULL;
 	struct scatterlist *sgl = host->data->sg;
-	const u32 mszs[] = {1, 4, 8, 16, 32, 64, 128, 256};
+	static const u32 mszs[] = {1, 4, 8, 16, 32, 64, 128, 256};
 	u32 sg_elems = host->data->sg_len;
 	u32 fifoth_val;
 	u32 fifo_offset = host->fifo_reg - host->regs;
@@ -1003,7 +1003,7 @@ static int dw_mci_get_cd(struct mmc_host *mmc)
 static void dw_mci_adjust_fifoth(struct dw_mci *host, struct mmc_data *data)
 {
 	unsigned int blksz = data->blksz;
-	const u32 mszs[] = {1, 4, 8, 16, 32, 64, 128, 256};
+	static const u32 mszs[] = {1, 4, 8, 16, 32, 64, 128, 256};
 	u32 fifo_width = 1 << host->data_shift;
 	u32 blksz_depth = blksz / fifo_width, fifoth_val;
 	u32 msize = 0, rx_wmark = 1, tx_wmark, tx_wmark_invers;
-- 
2.14.1


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

* Re: [PATCH] mmc: dw_mmc: make const arrays mszs static
  2017-09-03 13:39 ` Colin King
@ 2017-10-02  8:30   ` Ulf Hansson
  -1 siblings, 0 replies; 4+ messages in thread
From: Ulf Hansson @ 2017-10-02  8:30 UTC (permalink / raw)
  To: Colin King; +Cc: Jaehoon Chung, linux-mmc, kernel-janitors, linux-kernel

On 3 September 2017 at 15:39, Colin King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Don't populate the const arrays mszs on the stack, instead make them
> static. Makes the object code smaller by over 310 bytes:
>
> Before:
>    text    data     bss     dec     hex filename
>   47527    8528     320   56375    dc37 drivers/mmc/host/dw_mmc.o
>
> After:
>    text    data     bss     dec     hex filename
>   47055    8688     320   56063    daff drivers/mmc/host/dw_mmc.o
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Thanks, applied for next!

Kind regards
Uffe

> ---
>  drivers/mmc/host/dw_mmc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
> index 860313bd952a..45289c5e0295 100644
> --- a/drivers/mmc/host/dw_mmc.c
> +++ b/drivers/mmc/host/dw_mmc.c
> @@ -796,7 +796,7 @@ static int dw_mci_edmac_start_dma(struct dw_mci *host,
>         struct dma_slave_config cfg;
>         struct dma_async_tx_descriptor *desc = NULL;
>         struct scatterlist *sgl = host->data->sg;
> -       const u32 mszs[] = {1, 4, 8, 16, 32, 64, 128, 256};
> +       static const u32 mszs[] = {1, 4, 8, 16, 32, 64, 128, 256};
>         u32 sg_elems = host->data->sg_len;
>         u32 fifoth_val;
>         u32 fifo_offset = host->fifo_reg - host->regs;
> @@ -1003,7 +1003,7 @@ static int dw_mci_get_cd(struct mmc_host *mmc)
>  static void dw_mci_adjust_fifoth(struct dw_mci *host, struct mmc_data *data)
>  {
>         unsigned int blksz = data->blksz;
> -       const u32 mszs[] = {1, 4, 8, 16, 32, 64, 128, 256};
> +       static const u32 mszs[] = {1, 4, 8, 16, 32, 64, 128, 256};
>         u32 fifo_width = 1 << host->data_shift;
>         u32 blksz_depth = blksz / fifo_width, fifoth_val;
>         u32 msize = 0, rx_wmark = 1, tx_wmark, tx_wmark_invers;
> --
> 2.14.1
>

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

* Re: [PATCH] mmc: dw_mmc: make const arrays mszs static
@ 2017-10-02  8:30   ` Ulf Hansson
  0 siblings, 0 replies; 4+ messages in thread
From: Ulf Hansson @ 2017-10-02  8:30 UTC (permalink / raw)
  To: Colin King; +Cc: Jaehoon Chung, linux-mmc, kernel-janitors, linux-kernel

On 3 September 2017 at 15:39, Colin King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Don't populate the const arrays mszs on the stack, instead make them
> static. Makes the object code smaller by over 310 bytes:
>
> Before:
>    text    data     bss     dec     hex filename
>   47527    8528     320   56375    dc37 drivers/mmc/host/dw_mmc.o
>
> After:
>    text    data     bss     dec     hex filename
>   47055    8688     320   56063    daff drivers/mmc/host/dw_mmc.o
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Thanks, applied for next!

Kind regards
Uffe

> ---
>  drivers/mmc/host/dw_mmc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
> index 860313bd952a..45289c5e0295 100644
> --- a/drivers/mmc/host/dw_mmc.c
> +++ b/drivers/mmc/host/dw_mmc.c
> @@ -796,7 +796,7 @@ static int dw_mci_edmac_start_dma(struct dw_mci *host,
>         struct dma_slave_config cfg;
>         struct dma_async_tx_descriptor *desc = NULL;
>         struct scatterlist *sgl = host->data->sg;
> -       const u32 mszs[] = {1, 4, 8, 16, 32, 64, 128, 256};
> +       static const u32 mszs[] = {1, 4, 8, 16, 32, 64, 128, 256};
>         u32 sg_elems = host->data->sg_len;
>         u32 fifoth_val;
>         u32 fifo_offset = host->fifo_reg - host->regs;
> @@ -1003,7 +1003,7 @@ static int dw_mci_get_cd(struct mmc_host *mmc)
>  static void dw_mci_adjust_fifoth(struct dw_mci *host, struct mmc_data *data)
>  {
>         unsigned int blksz = data->blksz;
> -       const u32 mszs[] = {1, 4, 8, 16, 32, 64, 128, 256};
> +       static const u32 mszs[] = {1, 4, 8, 16, 32, 64, 128, 256};
>         u32 fifo_width = 1 << host->data_shift;
>         u32 blksz_depth = blksz / fifo_width, fifoth_val;
>         u32 msize = 0, rx_wmark = 1, tx_wmark, tx_wmark_invers;
> --
> 2.14.1
>

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

end of thread, other threads:[~2017-10-02  8:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-03 13:39 [PATCH] mmc: dw_mmc: make const arrays mszs static Colin King
2017-09-03 13:39 ` Colin King
2017-10-02  8:30 ` Ulf Hansson
2017-10-02  8:30   ` Ulf Hansson

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.