OSDN Git Service

media: s3c-camif: make array 'registers' static const, makes object smaller
authorColin Ian King <colin.king@canonical.com>
Fri, 6 Sep 2019 08:11:33 +0000 (05:11 -0300)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Tue, 1 Oct 2019 19:43:49 +0000 (16:43 -0300)
Don't populate the array 'registers' on the stack but instead make it
static const. Makes the object code smaller by 45 bytes.

Before:
   text    data     bss     dec     hex filename
  17364    5000       0   22364    575c platform/s3c-camif/camif-regs.o

After:
   text    data     bss     dec     hex filename
  17255    5064       0   22319    572f platform/s3c-camif/camif-regs.o

(gcc version 9.2.1, amd64)

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/platform/s3c-camif/camif-regs.c

index 1a65532..e80204f 100644 (file)
@@ -553,7 +553,7 @@ void camif_hw_disable_capture(struct camif_vp *vp)
 
 void camif_hw_dump_regs(struct camif_dev *camif, const char *label)
 {
-       struct {
+       static const struct {
                u32 offset;
                const char * const name;
        } registers[] = {