From patchwork Sun Jan 17 21:28:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rikard Falkeborn X-Patchwork-Id: 12025771 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8496EC433E6 for ; Sun, 17 Jan 2021 21:31:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 51E3E222B3 for ; Sun, 17 Jan 2021 21:31:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729485AbhAQVaw (ORCPT ); Sun, 17 Jan 2021 16:30:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730231AbhAQV3d (ORCPT ); Sun, 17 Jan 2021 16:29:33 -0500 Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com [IPv6:2a00:1450:4864:20::233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3CE7EC061575; Sun, 17 Jan 2021 13:28:53 -0800 (PST) Received: by mail-lj1-x233.google.com with SMTP id u21so16247407lja.0; Sun, 17 Jan 2021 13:28:53 -0800 (PST) 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=pGnYP5b1bDIsYHya/pAq0V9WLLrl1QJY4UrDAmDKPYg=; b=nx0SYB/NbD9w9zFZz3U1CvgF3CDr1YdMqMlKZwWnsNpILFdt3vJxJaG1r0q4ezBiTD frNFmGge87M8DY87lZTm8VudMB22VrCoMExUgem4OZAg/4SRrtZBN0VyoSNe+8eZrpxb ROhUvtuAGnPUO5isMD8LJQ/2sNP6MtMpgrmU2IaTFr3T1tYQAQKw8dBvHb6b3iQkFVR/ rqEYyPChZuckA7n4LqVIy3AP9J5kCtMzvT3GIRAaxrJVrs4qQCWq+36vC4fBsFeL8Eh/ ik1JHjrcHolpqNcnvQl8o2EQMiPLTFHH3QKyOMEiCebAkL4i9PKdgLJR/s9pox3svinh 7D6A== 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=pGnYP5b1bDIsYHya/pAq0V9WLLrl1QJY4UrDAmDKPYg=; b=gw+8iGuWGnXuiVVpw3JfObsiCcK1/Oez+THqlqoZ0Mr9DcmBilo+UFxwyUw2rlay3x cRBHhkGH0kJ3pxrEZbdMToJaC/2L9nLlf1TlXUwLBQvn4aLajAMIX4QoXp0rHOYYdJTa hnaHDS23BYmGZMCQuAVMfKNNuvrVqj9Nf0NI5VNtiBJ9oUx+u+DIZ77/yWXjeFFwyKBh 6Eq727wAFmcs4gwQH5Ec+xfb6fh8q9tr+I5eBmEvkdOiGi7vpIf4oN/lXPnClTjuYGsL vNc+CQqEdvPZVEn8tL9zPcLBiSbz1qjrzQFm2mkuNYi+yJv8/3Ynkef3cMlA4DpXQP4e t94A== X-Gm-Message-State: AOAM531JG4Dj60kLOPVlELH2ytrTTvPXL7/hoyTSfjCPIRCCOT9IZH3z zdn9D6pA4tsIlxEZPBsSuwk= X-Google-Smtp-Source: ABdhPJyk/IlGV1zlFVOkeqim8MjcwEqd6MBGP3CyNxLvQv4Xmyzv22A20JbND8Mok2BDSpnqWWJ34g== X-Received: by 2002:a2e:2f16:: with SMTP id v22mr9029676ljv.198.1610918931755; Sun, 17 Jan 2021 13:28:51 -0800 (PST) Received: from localhost.localdomain (h-158-174-22-164.NA.cust.bahnhof.se. [158.174.22.164]) by smtp.gmail.com with ESMTPSA id s19sm1678858lfc.41.2021.01.17.13.28.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Jan 2021 13:28:51 -0800 (PST) From: Rikard Falkeborn To: Will Deacon , Mark Rutland , Bjorn Andersson , Andy Gross Cc: Frank Li , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Shaokun Zhang , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Rikard Falkeborn Subject: [PATCH 1/4] perf: qcom: Constify static struct attribute_group Date: Sun, 17 Jan 2021 22:28:44 +0100 Message-Id: <20210117212847.21319-2-rikard.falkeborn@gmail.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210117212847.21319-1-rikard.falkeborn@gmail.com> References: <20210117212847.21319-1-rikard.falkeborn@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org The only usage is to put their addresses in an array of pointers to const struct attribute group. Make them const to allow the compiler to put them in read-only memory. Signed-off-by: Rikard Falkeborn --- drivers/perf/qcom_l2_pmu.c | 6 +++--- drivers/perf/qcom_l3_pmu.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/perf/qcom_l2_pmu.c b/drivers/perf/qcom_l2_pmu.c index 23a0e008dafa..8883af955a2a 100644 --- a/drivers/perf/qcom_l2_pmu.c +++ b/drivers/perf/qcom_l2_pmu.c @@ -649,7 +649,7 @@ static struct attribute *l2_cache_pmu_cpumask_attrs[] = { NULL, }; -static struct attribute_group l2_cache_pmu_cpumask_group = { +static const struct attribute_group l2_cache_pmu_cpumask_group = { .attrs = l2_cache_pmu_cpumask_attrs, }; @@ -665,7 +665,7 @@ static struct attribute *l2_cache_pmu_formats[] = { NULL, }; -static struct attribute_group l2_cache_pmu_format_group = { +static const struct attribute_group l2_cache_pmu_format_group = { .name = "format", .attrs = l2_cache_pmu_formats, }; @@ -700,7 +700,7 @@ static struct attribute *l2_cache_pmu_events[] = { NULL }; -static struct attribute_group l2_cache_pmu_events_group = { +static const struct attribute_group l2_cache_pmu_events_group = { .name = "events", .attrs = l2_cache_pmu_events, }; diff --git a/drivers/perf/qcom_l3_pmu.c b/drivers/perf/qcom_l3_pmu.c index 9ddb577c542b..fb34b87b9471 100644 --- a/drivers/perf/qcom_l3_pmu.c +++ b/drivers/perf/qcom_l3_pmu.c @@ -630,7 +630,7 @@ static struct attribute *qcom_l3_cache_pmu_formats[] = { NULL, }; -static struct attribute_group qcom_l3_cache_pmu_format_group = { +static const struct attribute_group qcom_l3_cache_pmu_format_group = { .name = "format", .attrs = qcom_l3_cache_pmu_formats, }; @@ -663,7 +663,7 @@ static struct attribute *qcom_l3_cache_pmu_events[] = { NULL }; -static struct attribute_group qcom_l3_cache_pmu_events_group = { +static const struct attribute_group qcom_l3_cache_pmu_events_group = { .name = "events", .attrs = qcom_l3_cache_pmu_events, }; @@ -685,7 +685,7 @@ static struct attribute *qcom_l3_cache_pmu_cpumask_attrs[] = { NULL, }; -static struct attribute_group qcom_l3_cache_pmu_cpumask_attr_group = { +static const struct attribute_group qcom_l3_cache_pmu_cpumask_attr_group = { .attrs = qcom_l3_cache_pmu_cpumask_attrs, }; From patchwork Sun Jan 17 21:28:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rikard Falkeborn X-Patchwork-Id: 12025769 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8C783C433DB for ; Sun, 17 Jan 2021 21:30:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 66F8E222B3 for ; Sun, 17 Jan 2021 21:30:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730135AbhAQVay (ORCPT ); Sun, 17 Jan 2021 16:30:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730236AbhAQV3e (ORCPT ); Sun, 17 Jan 2021 16:29:34 -0500 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A8FEC061757; Sun, 17 Jan 2021 13:28:54 -0800 (PST) Received: by mail-lf1-x136.google.com with SMTP id o17so21234476lfg.4; Sun, 17 Jan 2021 13:28:54 -0800 (PST) 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=Ljz4BUV9MpBVMsBYNiPFW/cj+siA+YfamJ4GwS7oSFE=; b=HNjRteTmpz5BC7QY1vC4w4qSAZrS38U4dVo5qMshU1PCdGaRfHlPTiOT0RoHeYstDO A4Az1VvxkOyQjO0iA6/GYXPNf+YbytZJ57TqK9Wiv8cQYjRjR2uGBHGPVAF4i9u0DxNJ 8rotkKUpLQV+Xuu2n4UoObMRu+6mFvy+5vBePMHZDsICR+Q1F6Blu/xkP8OWWoFMTiyw XrJB4CbWvjFIyi/CoxZ0q46/FGr3zTbhMIkr29bIybD/lGDnIXeE8INGdsB7OaaNEldi auSRw9lhAcBz4/PGpwYweyg1M9cYylBqfszo6WIvEbhofcnpvlQSymFjfj3u/K0oO9k1 vYow== 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=Ljz4BUV9MpBVMsBYNiPFW/cj+siA+YfamJ4GwS7oSFE=; b=ACehOH4rQOrzfzBfTADJ3E26+o5h81rJfpkNDVaZlqJUyOQuHBgMyCdLEDdHVaMLXE BJTsxmXrKMI2C3WGXXnO8Qkrv0HGzU9aboytknZJ3hUREFUojrsL9nfu85eYzpFIJsae 0pRHPJjgAgM750WQPoCee85m8HQc74zlXKzOd/UhkD062J8PJWpzS5+YrImRqP4DXFVu QVtJqIwRxU59BVZitdiYTPizuseGyW2uJHopXHbRyOW8h1xZoFwMuf1wwJY4yjWuEAek uZXAqED2dCI46JFy3qNc3/hmNXQbUWXq94e9DP2UyJWepjAUVXAI4cM2p01JSPGiAGBb nrpw== X-Gm-Message-State: AOAM531WBpb6i0NN77cSHuKTLsPSPD6FcjTrefl1+xSy1ylIr1jyMdhR qvg5TpmeAH2OAxYQFt6MARs= X-Google-Smtp-Source: ABdhPJwEoloNtvy0ID9gRrHbfLZEscWOeO28Gijfq4kL+9DJPFKPsMrBpaKReeN9OTQ/u5VY5CQNDQ== X-Received: by 2002:a05:6512:312b:: with SMTP id p11mr9944645lfd.446.1610918932717; Sun, 17 Jan 2021 13:28:52 -0800 (PST) Received: from localhost.localdomain (h-158-174-22-164.NA.cust.bahnhof.se. [158.174.22.164]) by smtp.gmail.com with ESMTPSA id s19sm1678858lfc.41.2021.01.17.13.28.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Jan 2021 13:28:52 -0800 (PST) From: Rikard Falkeborn To: Will Deacon , Mark Rutland , Frank Li , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team Cc: Shaokun Zhang , Andy Gross , Bjorn Andersson , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Rikard Falkeborn Subject: [PATCH 2/4] perf/imx_ddr: Constify static struct attribute_group Date: Sun, 17 Jan 2021 22:28:45 +0100 Message-Id: <20210117212847.21319-3-rikard.falkeborn@gmail.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210117212847.21319-1-rikard.falkeborn@gmail.com> References: <20210117212847.21319-1-rikard.falkeborn@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org The only usage is to put their addresses in an array of pointers to const struct attribute group. Make them const to allow the compiler to put them in read-only memory. Signed-off-by: Rikard Falkeborn --- drivers/perf/fsl_imx8_ddr_perf.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/perf/fsl_imx8_ddr_perf.c b/drivers/perf/fsl_imx8_ddr_perf.c index a11bfd8a0823..be1f26b62ddb 100644 --- a/drivers/perf/fsl_imx8_ddr_perf.c +++ b/drivers/perf/fsl_imx8_ddr_perf.c @@ -133,7 +133,7 @@ static struct attribute *ddr_perf_identifier_attrs[] = { NULL, }; -static struct attribute_group ddr_perf_identifier_attr_group = { +static const struct attribute_group ddr_perf_identifier_attr_group = { .attrs = ddr_perf_identifier_attrs, .is_visible = ddr_perf_identifier_attr_visible, }; @@ -188,7 +188,7 @@ static struct attribute *ddr_perf_filter_cap_attr[] = { NULL, }; -static struct attribute_group ddr_perf_filter_cap_attr_group = { +static const struct attribute_group ddr_perf_filter_cap_attr_group = { .name = "caps", .attrs = ddr_perf_filter_cap_attr, }; @@ -209,7 +209,7 @@ static struct attribute *ddr_perf_cpumask_attrs[] = { NULL, }; -static struct attribute_group ddr_perf_cpumask_attr_group = { +static const struct attribute_group ddr_perf_cpumask_attr_group = { .attrs = ddr_perf_cpumask_attrs, }; @@ -265,7 +265,7 @@ static struct attribute *ddr_perf_events_attrs[] = { NULL, }; -static struct attribute_group ddr_perf_events_attr_group = { +static const struct attribute_group ddr_perf_events_attr_group = { .name = "events", .attrs = ddr_perf_events_attrs, }; @@ -281,7 +281,7 @@ static struct attribute *ddr_perf_format_attrs[] = { NULL, }; -static struct attribute_group ddr_perf_format_attr_group = { +static const struct attribute_group ddr_perf_format_attr_group = { .name = "format", .attrs = ddr_perf_format_attrs, }; From patchwork Sun Jan 17 21:28:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rikard Falkeborn X-Patchwork-Id: 12025765 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7129BC433E0 for ; Sun, 17 Jan 2021 21:30:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4418C225AC for ; Sun, 17 Jan 2021 21:30:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730240AbhAQV3w (ORCPT ); Sun, 17 Jan 2021 16:29:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33050 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729744AbhAQV3f (ORCPT ); Sun, 17 Jan 2021 16:29:35 -0500 Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com [IPv6:2a00:1450:4864:20::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1BBFBC061573; Sun, 17 Jan 2021 13:28:55 -0800 (PST) Received: by mail-lj1-x229.google.com with SMTP id m13so16164966ljo.11; Sun, 17 Jan 2021 13:28:55 -0800 (PST) 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=1wUaf9lrdnf3y/o85VysxjiWKzQk/1dFwHGTwfk7M+s=; b=tX0M5CaMFaJxBYIeOdNfJd8R9RawSr/4pdBNMoHNKL6TVUxcY+FxU+lXEUfsZFbrl2 VmunUJsvt6KZhYd2XlO4eAXBsGFh9Sp3aYTlEKpcqdnE7jbBY/grtHkvIE+lD9KLx5X0 VN+wZlG56K3cTRq2Gkyq3Pa8YhcP5vdfbnZBSHJ2L1/ZmBn9jxzj+UduZyO6GgYzqhqj 6qX3Slj7DWr9SFBhQfsXyHHEllm2hwQKCckAMTBKkSbpjFQ+i3tC7esfnGy/ylzdL7Br 5JJrucvbDKBswMxR1mSjMfesOpWv4xq1T7Tpvd7wTfPcBD7mxYjsANdQcHVmKtpIp3lV QRow== 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=1wUaf9lrdnf3y/o85VysxjiWKzQk/1dFwHGTwfk7M+s=; b=NTQzkSKz88b1g0NZkjywiAsdKWhqlDDBc4tIV5g/iKGsNzVEAnnnzS9BguFeaptPFI HMMba9Ghf9rXeD0+ZhpKQDICMwOKn9Q0uETC5I6CcKG3vDKTUDtW+dka53NTBZNhLqWU remNhxOS40MF7rK5pe1lIynvkC/FmBpF/9TTxJJtxa1oSud1FEkM9mXdh3MaFMPvQUmh oGND+H76pekKpbW2GNdnYunit71AKPj9PQ7+FNf20TDGuiVHq7DSbhld9zuGMmewLhX3 Zdlw0EhTcizrUYyIDDgi7IIP/3nIhCMbBTlcf8cpQuoZo9gTJnOaEDSAd52Gcb0zrgXL fL8A== X-Gm-Message-State: AOAM533fpjoBFDdSyPWcj0TEuR5JmcEvIJj+7AJJHaPn/36uDrqH+Gbg QC4Xpyri39pI5hPgMQbDcuGjSaUdI+IUuA== X-Google-Smtp-Source: ABdhPJzGfExcyEzBTqT2c1yhn2GYKZeDXriQpNhaE68D/XaNMVMP3oOM31h06oE1yCn4oOGwXB7rVg== X-Received: by 2002:a05:651c:491:: with SMTP id s17mr9015050ljc.300.1610918933681; Sun, 17 Jan 2021 13:28:53 -0800 (PST) Received: from localhost.localdomain (h-158-174-22-164.NA.cust.bahnhof.se. [158.174.22.164]) by smtp.gmail.com with ESMTPSA id s19sm1678858lfc.41.2021.01.17.13.28.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Jan 2021 13:28:53 -0800 (PST) From: Rikard Falkeborn To: Will Deacon , Mark Rutland , Shaokun Zhang Cc: Frank Li , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Andy Gross , Bjorn Andersson , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Rikard Falkeborn Subject: [PATCH 3/4] perf: hisi: Constify static struct attribute_group Date: Sun, 17 Jan 2021 22:28:46 +0100 Message-Id: <20210117212847.21319-4-rikard.falkeborn@gmail.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210117212847.21319-1-rikard.falkeborn@gmail.com> References: <20210117212847.21319-1-rikard.falkeborn@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org The only usage is to put their addresses in an array of pointers to const struct attribute group. Make them const to allow the compiler to put them in read-only memory. Signed-off-by: Rikard Falkeborn --- drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c | 2 +- drivers/perf/hisilicon/hisi_uncore_hha_pmu.c | 2 +- drivers/perf/hisilicon/hisi_uncore_l3c_pmu.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c b/drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c index 5ac6c9113767..ac1a8c120a00 100644 --- a/drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c +++ b/drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c @@ -319,7 +319,7 @@ static struct attribute *hisi_ddrc_pmu_identifier_attrs[] = { NULL }; -static struct attribute_group hisi_ddrc_pmu_identifier_group = { +static const struct attribute_group hisi_ddrc_pmu_identifier_group = { .attrs = hisi_ddrc_pmu_identifier_attrs, }; diff --git a/drivers/perf/hisilicon/hisi_uncore_hha_pmu.c b/drivers/perf/hisilicon/hisi_uncore_hha_pmu.c index 41b2dceb5f26..3402f1a395a8 100644 --- a/drivers/perf/hisilicon/hisi_uncore_hha_pmu.c +++ b/drivers/perf/hisilicon/hisi_uncore_hha_pmu.c @@ -331,7 +331,7 @@ static struct attribute *hisi_hha_pmu_identifier_attrs[] = { NULL }; -static struct attribute_group hisi_hha_pmu_identifier_group = { +static const struct attribute_group hisi_hha_pmu_identifier_group = { .attrs = hisi_hha_pmu_identifier_attrs, }; diff --git a/drivers/perf/hisilicon/hisi_uncore_l3c_pmu.c b/drivers/perf/hisilicon/hisi_uncore_l3c_pmu.c index 705501d18d03..7d792435c2aa 100644 --- a/drivers/perf/hisilicon/hisi_uncore_l3c_pmu.c +++ b/drivers/perf/hisilicon/hisi_uncore_l3c_pmu.c @@ -321,7 +321,7 @@ static struct attribute *hisi_l3c_pmu_identifier_attrs[] = { NULL }; -static struct attribute_group hisi_l3c_pmu_identifier_group = { +static const struct attribute_group hisi_l3c_pmu_identifier_group = { .attrs = hisi_l3c_pmu_identifier_attrs, }; From patchwork Sun Jan 17 21:28:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rikard Falkeborn X-Patchwork-Id: 12025767 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 85AE0C433E6 for ; Sun, 17 Jan 2021 21:30:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5F77122597 for ; Sun, 17 Jan 2021 21:30:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730284AbhAQV3y (ORCPT ); Sun, 17 Jan 2021 16:29:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730243AbhAQV3g (ORCPT ); Sun, 17 Jan 2021 16:29:36 -0500 Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25C55C0613C1; Sun, 17 Jan 2021 13:28:56 -0800 (PST) Received: by mail-lf1-x12b.google.com with SMTP id o17so21234542lfg.4; Sun, 17 Jan 2021 13:28:56 -0800 (PST) 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=h6Tqi57B6RKHeZ0yWkHDNRYTp7U/zAAwGfhZbemk/DI=; b=HS1x5paSr5K+/dQlSjCDkild4v2Sv9ob8aFZ/hjMJqgUNnQJso5WedHR+RseaV44mi QbLOIW7jLei2KjOcAN6C1hYft0GsmrtigDzywXTePeFEjnpjDJk7VEafIpq3ygOlH4lz gLzJy1jxHf0X2AUC8rDzyTpPSfwkclsAOnjKxfdkmJ1o8LP0iPl/JTUOd79P8vBbZfoV 95ABuLvtPvKodB9JtRvJCFTg+Dogi+zJPrA+DoJynGYJNABKyy/ZnUC5ZWH2VNaM9iBj 2hr+j0gPk0PDpLdF7GtR07xSldK/vdwCplrVLdm02C7+LIurF48Xx36Lki13/sr9fHAQ hA5w== 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=h6Tqi57B6RKHeZ0yWkHDNRYTp7U/zAAwGfhZbemk/DI=; b=SmIwGAimxIeFAtZ47EKVz+Yv4qr5Su5/4SNYkORIpwzjbrcPTQwEPm7h5MJrtQ6GAz vs6i/fQO386o99IprNif6ZOazsNFRNK/4pBiBbDfprQVP84att97eufLQHH8TtccM1lj vYmybTIJGaK7xYql6KJF00Exa4ESDXK+njPMzsx2ucg/AKKx8De1kcXzHvmU/4cu2+sI NSonYA7H7M5QBTTTG67fjLCEX7CJARJKS7QJ9uvwDpzuCyf9RZH20oAl1c0mpdGb4RBn APx90pJadjGgFpkcxkSZ8wxq668fM1OlO0i8O+f3Zs/NuzmFDs9xxaoZgoVDEx2JpIFt vq3w== X-Gm-Message-State: AOAM530jzkYuAIKgU2DpNTx6+8VEWbO+6PDllVhwN11BtqcbBn2mrDR+ XV2U5ShH6EYjRgchn9Z1OuQ= X-Google-Smtp-Source: ABdhPJw49HItQhOm8x60XeJ/atvSx2qDxh85kxU2yV8mCQsKvCMxJMq8uFF8X78TVOHEG8t9ODBYxg== X-Received: by 2002:a19:4841:: with SMTP id v62mr9236467lfa.607.1610918934685; Sun, 17 Jan 2021 13:28:54 -0800 (PST) Received: from localhost.localdomain (h-158-174-22-164.NA.cust.bahnhof.se. [158.174.22.164]) by smtp.gmail.com with ESMTPSA id s19sm1678858lfc.41.2021.01.17.13.28.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Jan 2021 13:28:54 -0800 (PST) From: Rikard Falkeborn To: Will Deacon , Mark Rutland Cc: Frank Li , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Shaokun Zhang , Andy Gross , Bjorn Andersson , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Rikard Falkeborn Subject: [PATCH 4/4] perf: Constify static struct attribute_group Date: Sun, 17 Jan 2021 22:28:47 +0100 Message-Id: <20210117212847.21319-5-rikard.falkeborn@gmail.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210117212847.21319-1-rikard.falkeborn@gmail.com> References: <20210117212847.21319-1-rikard.falkeborn@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org The only usage is to put their addresses in an array of pointers to const struct attribute group. Make them const to allow the compiler to put them in read-only memory. Signed-off-by: Rikard Falkeborn --- drivers/perf/arm-cci.c | 2 +- drivers/perf/arm-cmn.c | 2 +- drivers/perf/arm_dmc620_pmu.c | 4 ++-- drivers/perf/arm_pmu.c | 2 +- drivers/perf/arm_smmuv3_pmu.c | 8 ++++---- drivers/perf/arm_spe_pmu.c | 6 +++--- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/perf/arm-cci.c b/drivers/perf/arm-cci.c index 87c4be9dd412..a75cf77c4de4 100644 --- a/drivers/perf/arm-cci.c +++ b/drivers/perf/arm-cci.c @@ -1376,7 +1376,7 @@ static struct attribute *pmu_attrs[] = { NULL, }; -static struct attribute_group pmu_attr_group = { +static const struct attribute_group pmu_attr_group = { .attrs = pmu_attrs, }; diff --git a/drivers/perf/arm-cmn.c b/drivers/perf/arm-cmn.c index a76ff594f3ca..f30fcd330899 100644 --- a/drivers/perf/arm-cmn.c +++ b/drivers/perf/arm-cmn.c @@ -616,7 +616,7 @@ static struct attribute *arm_cmn_cpumask_attrs[] = { NULL, }; -static struct attribute_group arm_cmn_cpumask_attr_group = { +static const struct attribute_group arm_cmn_cpumask_attr_group = { .attrs = arm_cmn_cpumask_attrs, }; diff --git a/drivers/perf/arm_dmc620_pmu.c b/drivers/perf/arm_dmc620_pmu.c index 004930eb4bbb..27f54c0afc3b 100644 --- a/drivers/perf/arm_dmc620_pmu.c +++ b/drivers/perf/arm_dmc620_pmu.c @@ -159,7 +159,7 @@ static struct attribute *dmc620_pmu_events_attrs[] = { NULL, }; -static struct attribute_group dmc620_pmu_events_attr_group = { +static const struct attribute_group dmc620_pmu_events_attr_group = { .name = "events", .attrs = dmc620_pmu_events_attrs, }; @@ -222,7 +222,7 @@ static struct attribute *dmc620_pmu_formats_attrs[] = { NULL, }; -static struct attribute_group dmc620_pmu_format_attr_group = { +static const struct attribute_group dmc620_pmu_format_attr_group = { .name = "format", .attrs = dmc620_pmu_formats_attrs, }; diff --git a/drivers/perf/arm_pmu.c b/drivers/perf/arm_pmu.c index cb2f55f450e4..2d10d84fb79c 100644 --- a/drivers/perf/arm_pmu.c +++ b/drivers/perf/arm_pmu.c @@ -577,7 +577,7 @@ static struct attribute *armpmu_common_attrs[] = { NULL, }; -static struct attribute_group armpmu_common_attr_group = { +static const struct attribute_group armpmu_common_attr_group = { .attrs = armpmu_common_attrs, }; diff --git a/drivers/perf/arm_smmuv3_pmu.c b/drivers/perf/arm_smmuv3_pmu.c index 74474bb322c3..8ff7a67f691c 100644 --- a/drivers/perf/arm_smmuv3_pmu.c +++ b/drivers/perf/arm_smmuv3_pmu.c @@ -493,7 +493,7 @@ static struct attribute *smmu_pmu_cpumask_attrs[] = { NULL }; -static struct attribute_group smmu_pmu_cpumask_group = { +static const struct attribute_group smmu_pmu_cpumask_group = { .attrs = smmu_pmu_cpumask_attrs, }; @@ -548,7 +548,7 @@ static umode_t smmu_pmu_event_is_visible(struct kobject *kobj, return 0; } -static struct attribute_group smmu_pmu_events_group = { +static const struct attribute_group smmu_pmu_events_group = { .name = "events", .attrs = smmu_pmu_events, .is_visible = smmu_pmu_event_is_visible, @@ -583,7 +583,7 @@ static struct attribute *smmu_pmu_identifier_attrs[] = { NULL }; -static struct attribute_group smmu_pmu_identifier_group = { +static const struct attribute_group smmu_pmu_identifier_group = { .attrs = smmu_pmu_identifier_attrs, .is_visible = smmu_pmu_identifier_attr_visible, }; @@ -602,7 +602,7 @@ static struct attribute *smmu_pmu_formats[] = { NULL }; -static struct attribute_group smmu_pmu_format_group = { +static const struct attribute_group smmu_pmu_format_group = { .name = "format", .attrs = smmu_pmu_formats, }; diff --git a/drivers/perf/arm_spe_pmu.c b/drivers/perf/arm_spe_pmu.c index cc00915ad6d1..7593caf12555 100644 --- a/drivers/perf/arm_spe_pmu.c +++ b/drivers/perf/arm_spe_pmu.c @@ -146,7 +146,7 @@ static struct attribute *arm_spe_pmu_cap_attr[] = { NULL, }; -static struct attribute_group arm_spe_pmu_cap_group = { +static const struct attribute_group arm_spe_pmu_cap_group = { .name = "caps", .attrs = arm_spe_pmu_cap_attr, }; @@ -227,7 +227,7 @@ static struct attribute *arm_spe_pmu_formats_attr[] = { NULL, }; -static struct attribute_group arm_spe_pmu_format_group = { +static const struct attribute_group arm_spe_pmu_format_group = { .name = "format", .attrs = arm_spe_pmu_formats_attr, }; @@ -247,7 +247,7 @@ static struct attribute *arm_spe_pmu_attrs[] = { NULL, }; -static struct attribute_group arm_spe_pmu_group = { +static const struct attribute_group arm_spe_pmu_group = { .attrs = arm_spe_pmu_attrs, };