Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4184971pxk; Tue, 22 Sep 2020 12:29:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwA3LWSm1tfCIRerm51BAN0EH34HrydJbvNToK+7E3rTaeRlKVCDzYD8y8MXswrtOJI18Kg X-Received: by 2002:a50:c051:: with SMTP id u17mr5835318edd.39.1600802995682; Tue, 22 Sep 2020 12:29:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600802995; cv=none; d=google.com; s=arc-20160816; b=M0mrTdeMU5p+oSbf4/EKbViHzKg5Jr901+WgAKj/zH42hg9uKZi4kkWniCR9Fmcv9b StR5Vs0Ph+w100MQFAvWCk/sOcoquNeZzzNfTJwGVgYUM3I5v04uTQ8VdjlVf2XjCyUb rjfr73ZtTB+WkcyIC/7IeM7Ilm2yoo3KMhvm3o9X3mcNgvMLeBHvovf882sUIvvBU0nO /2iOapVxGEx6bTmw2BOhMx7wc7CGJuUghb5ix0YMnXAVpQ46cMpBPfujqSA2j2481xC1 yg/3nGtBpWR/Aa83db1JcNF5iCxMNcgxK10B9o/WY4R/xPp9VzmBiSuzo74TNTH/Z8I2 FwYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=zg6ilJOJPijk+82aRAFHt7wNQSPk2Nri12CuIZN1pbI=; b=bz/SEHDUSdYeWxQ/UVJ45o0DUJdx2npAvUWAKbMHXK+4Slny8zovQo/zukiu75Jzyt eXVVKZBNUqwC2Gt0AHaPx6QVEKKCs5oiiD/MCrKacNIL9RgCU/0giVX2UfY9PPSIarZO HPVGyUPyxhyuwEyDpCBqUrov+10uFafQ9kkGmFdxT3KW+YkW2RHTNMyX+RnSMFKK9Ns5 fjn1Xrvaq4sF5CBB+DDUBjhtDpSqSMAy6WhmG8aqXMJirkSHYssqFhfVenFEPWZ7txn8 OyDardXYVlxhh6S/wS/JMQMXp4oQegvBKgqczOULWPlqFI8FOLTelUtkJ1CsD9Vx8uJe kCew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=qryF1qeV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o10si12411029edt.499.2020.09.22.12.29.31; Tue, 22 Sep 2020 12:29:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=qryF1qeV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726779AbgIVT1l (ORCPT + 99 others); Tue, 22 Sep 2020 15:27:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726629AbgIVT1L (ORCPT ); Tue, 22 Sep 2020 15:27:11 -0400 Received: from mail-lf1-x143.google.com (mail-lf1-x143.google.com [IPv6:2a00:1450:4864:20::143]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42A32C0613CF for ; Tue, 22 Sep 2020 12:27:11 -0700 (PDT) Received: by mail-lf1-x143.google.com with SMTP id y11so19315305lfl.5 for ; Tue, 22 Sep 2020 12:27:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=zg6ilJOJPijk+82aRAFHt7wNQSPk2Nri12CuIZN1pbI=; b=qryF1qeVUWrQeTcTH3EEwVlwDoJGpvp5Y0gz9QhWYXj6eSKMSbdvrcZkuHt/JBSl34 HMgXo87bp0vgZg5cW5bCcHjSujwhVAOtulhMesO+Hs4GH389nIFQkdGxTBeGDY/ahR5w /V75nrmmCfVHGO5Wk8iC5pxKWRj1nH23O1uS+0s7MvQv/lLL7WwQd+PhtqhioKtebvwr 08mewC6v9x8Ln0+8CSPh7d8TaJdvxSWiMuPZF3okM6SJXkOfS/y/yk+d0EFIev8RSvIS aPSdwUlKuq/KHw7azPa1cOg0MK0x0vO5wCtXeNPy8B7u6HfjuCNNHUGrkVaJCdRARAKW imXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zg6ilJOJPijk+82aRAFHt7wNQSPk2Nri12CuIZN1pbI=; b=tY1hBTx2us2/uYPXjo2PMplt+y5jig5cUwoyMv/P2t9jmv65uq0NGeODgHThiKEwBU YKG96LNxxmDCRAI1tvnzNBadJOEkV7tcrN4gJMYN4oVeFyC77l1IYQzoPPrCUoTN+ElE yg5DrdnHIV1QTMxCeIFFQ/d+c28cCBas/YkKbpaN1WFOU/96AblNTNfexfxkJW+1AYQH ldb+FE1s0E8Y1kGWCfKvV2OEV8NRde4UgeqZ2knMNFRLDfirZN/+MOIfIHlKYdyGiCzG 84CcnSBibNBI0pKVV2Q/S2OXquLWPX5nyZF/6mo5dK9aoHvWUL7CN4BzC1j73/K8+Dqp ZLTA== X-Gm-Message-State: AOAM530AZGx8H+6ycYPb+9S6jdYXmN/smD3NbhIrYxtnHRLD4j7Mu2jK 3qPwvaEQ6oi15rpi5qWXH1s= X-Received: by 2002:a19:ac49:: with SMTP id r9mr2030828lfc.582.1600802829605; Tue, 22 Sep 2020 12:27:09 -0700 (PDT) Received: from localhost.localdomain (h-82-196-111-59.NA.cust.bahnhof.se. [82.196.111.59]) by smtp.gmail.com with ESMTPSA id r132sm3770013lff.167.2020.09.22.12.27.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Sep 2020 12:27:08 -0700 (PDT) From: Rikard Falkeborn To: Lee Jones Cc: linux-kernel@vger.kernel.org, Rikard Falkeborn , Andy Shevchenko Subject: [PATCH 2/8] mfd: intel: Constify static struct resource Date: Tue, 22 Sep 2020 21:26:53 +0200 Message-Id: <20200922192659.14535-3-rikard.falkeborn@gmail.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200922192659.14535-1-rikard.falkeborn@gmail.com> References: <20200922192659.14535-1-rikard.falkeborn@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Constify a number of static struct resource. The only usage of the structs are to assign their address to the resources field in the mfd_cell struct. This allows the compiler to put them in read-only memory. Done with the help of Coccinelle. Signed-off-by: Rikard Falkeborn --- drivers/mfd/intel_msic.c | 18 +++++++++--------- drivers/mfd/intel_soc_pmic_bxtwc.c | 14 +++++++------- drivers/mfd/intel_soc_pmic_chtdc_ti.c | 10 +++++----- drivers/mfd/intel_soc_pmic_chtwc.c | 4 ++-- drivers/mfd/intel_soc_pmic_crc.c | 10 +++++----- 5 files changed, 28 insertions(+), 28 deletions(-) diff --git a/drivers/mfd/intel_msic.c b/drivers/mfd/intel_msic.c index bb24c2a07900..daa772f8146b 100644 --- a/drivers/mfd/intel_msic.c +++ b/drivers/mfd/intel_msic.c @@ -50,23 +50,23 @@ struct intel_msic { void __iomem *irq_base; }; -static struct resource msic_touch_resources[] = { +static const struct resource msic_touch_resources[] = { DEFINE_RES_IRQ(0), }; -static struct resource msic_adc_resources[] = { +static const struct resource msic_adc_resources[] = { DEFINE_RES_IRQ(0), }; -static struct resource msic_battery_resources[] = { +static const struct resource msic_battery_resources[] = { DEFINE_RES_IRQ(0), }; -static struct resource msic_gpio_resources[] = { +static const struct resource msic_gpio_resources[] = { DEFINE_RES_IRQ(0), }; -static struct resource msic_audio_resources[] = { +static const struct resource msic_audio_resources[] = { DEFINE_RES_IRQ_NAMED(0, "IRQ"), /* * We will pass IRQ_BASE to the driver now but this can be removed @@ -75,19 +75,19 @@ static struct resource msic_audio_resources[] = { DEFINE_RES_MEM_NAMED(MSIC_IRQ_STATUS_ACCDET, 1, "IRQ_BASE"), }; -static struct resource msic_hdmi_resources[] = { +static const struct resource msic_hdmi_resources[] = { DEFINE_RES_IRQ(0), }; -static struct resource msic_thermal_resources[] = { +static const struct resource msic_thermal_resources[] = { DEFINE_RES_IRQ(0), }; -static struct resource msic_power_btn_resources[] = { +static const struct resource msic_power_btn_resources[] = { DEFINE_RES_IRQ(0), }; -static struct resource msic_ocd_resources[] = { +static const struct resource msic_ocd_resources[] = { DEFINE_RES_IRQ(0), }; diff --git a/drivers/mfd/intel_soc_pmic_bxtwc.c b/drivers/mfd/intel_soc_pmic_bxtwc.c index eba89780dbe7..47d0d3a69a58 100644 --- a/drivers/mfd/intel_soc_pmic_bxtwc.c +++ b/drivers/mfd/intel_soc_pmic_bxtwc.c @@ -200,32 +200,32 @@ static struct regmap_irq_chip bxtwc_regmap_irq_chip_crit = { .num_regs = 1, }; -static struct resource gpio_resources[] = { +static const struct resource gpio_resources[] = { DEFINE_RES_IRQ_NAMED(BXTWC_GPIO_LVL1_IRQ, "GPIO"), }; -static struct resource adc_resources[] = { +static const struct resource adc_resources[] = { DEFINE_RES_IRQ_NAMED(BXTWC_ADC_IRQ, "ADC"), }; -static struct resource usbc_resources[] = { +static const struct resource usbc_resources[] = { DEFINE_RES_IRQ(BXTWC_USBC_IRQ), }; -static struct resource charger_resources[] = { +static const struct resource charger_resources[] = { DEFINE_RES_IRQ_NAMED(BXTWC_CHGR0_IRQ, "CHARGER"), DEFINE_RES_IRQ_NAMED(BXTWC_CHGR1_IRQ, "CHARGER1"), }; -static struct resource thermal_resources[] = { +static const struct resource thermal_resources[] = { DEFINE_RES_IRQ(BXTWC_THRM_LVL1_IRQ), }; -static struct resource bcu_resources[] = { +static const struct resource bcu_resources[] = { DEFINE_RES_IRQ_NAMED(BXTWC_BCU_IRQ, "BCU"), }; -static struct resource tmu_resources[] = { +static const struct resource tmu_resources[] = { DEFINE_RES_IRQ_NAMED(BXTWC_TMU_IRQ, "TMU"), }; diff --git a/drivers/mfd/intel_soc_pmic_chtdc_ti.c b/drivers/mfd/intel_soc_pmic_chtdc_ti.c index 64b5c3cc30e7..1c7577b881ff 100644 --- a/drivers/mfd/intel_soc_pmic_chtdc_ti.c +++ b/drivers/mfd/intel_soc_pmic_chtdc_ti.c @@ -32,23 +32,23 @@ enum { CHTDC_TI_CCEOCAL = 7, /* battery */ }; -static struct resource power_button_resources[] = { +static const struct resource power_button_resources[] = { DEFINE_RES_IRQ(CHTDC_TI_PWRBTN), }; -static struct resource thermal_resources[] = { +static const struct resource thermal_resources[] = { DEFINE_RES_IRQ(CHTDC_TI_DIETMPWARN), }; -static struct resource adc_resources[] = { +static const struct resource adc_resources[] = { DEFINE_RES_IRQ(CHTDC_TI_ADCCMPL), }; -static struct resource pwrsrc_resources[] = { +static const struct resource pwrsrc_resources[] = { DEFINE_RES_IRQ(CHTDC_TI_VBUSDET), }; -static struct resource battery_resources[] = { +static const struct resource battery_resources[] = { DEFINE_RES_IRQ(CHTDC_TI_VBATLOW), DEFINE_RES_IRQ(CHTDC_TI_CCEOCAL), }; diff --git a/drivers/mfd/intel_soc_pmic_chtwc.c b/drivers/mfd/intel_soc_pmic_chtwc.c index be84bb2aa837..49c5f71664bc 100644 --- a/drivers/mfd/intel_soc_pmic_chtwc.c +++ b/drivers/mfd/intel_soc_pmic_chtwc.c @@ -41,11 +41,11 @@ enum { CHT_WC_CRIT_IRQ = 7, }; -static struct resource cht_wc_pwrsrc_resources[] = { +static const struct resource cht_wc_pwrsrc_resources[] = { DEFINE_RES_IRQ(CHT_WC_PWRSRC_IRQ), }; -static struct resource cht_wc_ext_charger_resources[] = { +static const struct resource cht_wc_ext_charger_resources[] = { DEFINE_RES_IRQ(CHT_WC_EXT_CHGR_IRQ), }; diff --git a/drivers/mfd/intel_soc_pmic_crc.c b/drivers/mfd/intel_soc_pmic_crc.c index 429efa1f8e55..38acb20e2d60 100644 --- a/drivers/mfd/intel_soc_pmic_crc.c +++ b/drivers/mfd/intel_soc_pmic_crc.c @@ -28,23 +28,23 @@ #define CRYSTAL_COVE_IRQ_GPIO 5 #define CRYSTAL_COVE_IRQ_VHDMIOCP 6 -static struct resource gpio_resources[] = { +static const struct resource gpio_resources[] = { DEFINE_RES_IRQ_NAMED(CRYSTAL_COVE_IRQ_GPIO, "GPIO"), }; -static struct resource pwrsrc_resources[] = { +static const struct resource pwrsrc_resources[] = { DEFINE_RES_IRQ_NAMED(CRYSTAL_COVE_IRQ_PWRSRC, "PWRSRC"), }; -static struct resource adc_resources[] = { +static const struct resource adc_resources[] = { DEFINE_RES_IRQ_NAMED(CRYSTAL_COVE_IRQ_ADC, "ADC"), }; -static struct resource thermal_resources[] = { +static const struct resource thermal_resources[] = { DEFINE_RES_IRQ_NAMED(CRYSTAL_COVE_IRQ_THRM, "THERMAL"), }; -static struct resource bcu_resources[] = { +static const struct resource bcu_resources[] = { DEFINE_RES_IRQ_NAMED(CRYSTAL_COVE_IRQ_BCU, "BCU"), }; -- 2.28.0