coresight: tpdm: Fix build break due to uninitialised field
authorSuzuki K Poulose <suzuki.poulose@arm.com>
Tue, 13 Feb 2024 10:12:46 +0000 (10:12 +0000)
committerSuzuki K Poulose <suzuki.poulose@arm.com>
Tue, 13 Feb 2024 11:01:19 +0000 (11:01 +0000)
{CMB/DSB}_PATT_ENABLE_TS attributes do not use an "idx" field and never sets it.
But, since have full blown warning enabled in coresight, it triggerst the warning
on some of the newer compiler versions:

drivers/hwtracing/coresight/coresight-tpdm.c:1055:2: error: missing field 'idx' initializer [-Werror,-Wmissing-field-initializers]
 1055 |         DSB_PATT_ENABLE_TS,
      |         ^
drivers/hwtracing/coresight/coresight-tpdm.h:184:3: note: expanded from macro 'DSB_PATT_ENABLE_TS'
  184 |                 tpdm_patt_enable_ts(enable_ts,                  \
      |                 ^
drivers/hwtracing/coresight/coresight-tpdm.h:156:5: note: expanded from macro 'tpdm_patt_enable_ts'
  156 |            }                                                    \
      |            ^
drivers/hwtracing/coresight/coresight-tpdm.c:1109:2: error: missing field 'idx' initializer [-Werror,-Wmissing-field-initializers]
 1109 |         CMB_PATT_ENABLE_TS,
      |         ^
drivers/hwtracing/coresight/coresight-tpdm.h:208:3: note: expanded from macro 'CMB_PATT_ENABLE_TS'
  208 |                 tpdm_patt_enable_ts(enable_ts,                  \
      |                 ^
drivers/hwtracing/coresight/coresight-tpdm.h:156:5: note: expanded from macro 'tpdm_patt_enable_ts'
  156 |            }                                                    \
      |            ^

Make sure we initialise this.

Fixes: dc6ce57e2aa0 ("coresight-tpdm: Add timestamp control register support for the CMB")
Acked-by: Arnd Bergmann <arnd@arndb.de>
Reported-by: Arnd Bergmann <arnd@arndb.de>
Cc: Tao Zhang <quic_taozha@quicinc.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
drivers/hwtracing/coresight/coresight-tpdm.h

index f3a8f56d0fe7657a8579a30902dace932f9a8a0d..e08d212642e351a3797d54f5d56c3b2196c9a23d 100644 (file)
                __ATTR(name, 0644, enable_ts_show,              \
                enable_ts_store),               \
                mem,                                            \
+               0,                                              \
           }                                                    \
        })[0].attr.attr)