summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Holland <[email protected]>2025-03-25 16:43:26 -0700
committerAnup Patel <[email protected]>2025-04-23 12:32:50 +0530
commitde777cc633bae869bb752d8b64c4b116db9594ef (patch)
treee86510b60abd925075b84e0dd068a163635e9c34
parentac2e428c4be6bb876b160643984617911d60a5e6 (diff)
platform: generic: thead: Avoid casting away const
struct fdt_match expects match data to be const. Follow this expectation so that no type casting is needed. Signed-off-by: Samuel Holland <[email protected]> Reviewed-by: Anup Patel <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Anup Patel <[email protected]>
-rw-r--r--platform/generic/thead/thead-generic.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/platform/generic/thead/thead-generic.c b/platform/generic/thead/thead-generic.c
index fedb6145..25919df1 100644
--- a/platform/generic/thead/thead-generic.c
+++ b/platform/generic/thead/thead-generic.c
@@ -22,7 +22,7 @@ struct thead_generic_quirks {
static int thead_generic_early_init(bool cold_boot, const void *fdt,
const struct fdt_match *match)
{
- struct thead_generic_quirks *quirks = (void *)match->data;
+ const struct thead_generic_quirks *quirks = match->data;
if (quirks->errata & THEAD_QUIRK_ERRATA_TLB_FLUSH)
thead_register_tlb_flush_trap_handler();
@@ -33,7 +33,7 @@ static int thead_generic_early_init(bool cold_boot, const void *fdt,
static int thead_generic_extensions_init(const struct fdt_match *match,
struct sbi_hart_features *hfeatures)
{
- struct thead_generic_quirks *quirks = (void *)match->data;
+ const struct thead_generic_quirks *quirks = match->data;
if (quirks->errata & THEAD_QUIRK_ERRATA_THEAD_PMU)
thead_c9xx_register_pmu_device();
@@ -41,11 +41,11 @@ static int thead_generic_extensions_init(const struct fdt_match *match,
return 0;
}
-static struct thead_generic_quirks thead_th1520_quirks = {
+static const struct thead_generic_quirks thead_th1520_quirks = {
.errata = THEAD_QUIRK_ERRATA_TLB_FLUSH | THEAD_QUIRK_ERRATA_THEAD_PMU,
};
-static struct thead_generic_quirks thead_pmu_quirks = {
+static const struct thead_generic_quirks thead_pmu_quirks = {
.errata = THEAD_QUIRK_ERRATA_THEAD_PMU,
};