Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp132982imm; Fri, 10 Aug 2018 08:45:07 -0700 (PDT) X-Google-Smtp-Source: AA+uWPx9uzcMcDhJh0AajjLCT4egEl/JgvKUNrPay9dJfPsUAf3SSfr4ibJbPwe7rbYB7TDPaAY2 X-Received: by 2002:a17:902:530a:: with SMTP id b10-v6mr6749907pli.101.1533915907162; Fri, 10 Aug 2018 08:45:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533915907; cv=none; d=google.com; s=arc-20160816; b=iw8kOu5G/LVJUFTrc7xuB4jmEQQrB/bF6UVPX2SJ+4Ar9x36KNBDwnAJCPAtP1OxKx SaVwJWvsJTKXVQi1J4L1jKjBRqDJuDywpe5L8ZjFXP19EyZ2CYkKkgeb6nABRwIzbbN+ qxk8uN/mHRshcbx5R9VfSjvvhGoSOwC86hIttevz+MOBbAwy8lRK+ZgeoYFGN9a5X7zl o5PyNqk02ul8ecyCKDhbfnY30AMuy1Q2K8zbOVNZIr8kaAcgewDvBwnKyG3mRJJltOJe 3KZ8x8MO4IdUwIqMhTXBMwmfSTk4FM1wW5kRi7d0YbE7UJOHPeMP+hykJpZK77qHhLFz JdlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=eCT/GwwzGvav606l3FZtyMu5qhBDgzLqJDAQv26V9/w=; b=nbOJojIzUMErBoSn0lPgvpoWwetcopKjQ9fPMI4zpdYzWMEMP8Jf4RftgBCB9ewSjv qRjDR+xQ8VZG72S8MfHsn+KrP+IiHuAk2A0ii8DZ2B+ImUnsDPx5x3VN3uLjIAgMJk8D nlycqzE4uxFEioLEtdI8BjYd1EYEIb/BzrvPz8JwSHezc5XTR9o0XzXoi6wFB77EuGoV TzXDn1lrJml/CO9qZmksQg4cn/3YDfywQanxW3PIOvEiO/C2foFvBQNgVQY+Im9+5Jt2 0qzF3NMS8OuIjp8vXlKmQO7KSBM5nJLeirVmMma1vl3cYWqfU089JUfT6tLzCzrfoT8d nvzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=TXCNWwRL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v1-v6si8110394plb.387.2018.08.10.08.44.50; Fri, 10 Aug 2018 08:45:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=TXCNWwRL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728011AbeHJSNs (ORCPT + 99 others); Fri, 10 Aug 2018 14:13:48 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:45355 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727381AbeHJSNs (ORCPT ); Fri, 10 Aug 2018 14:13:48 -0400 Received: by mail-pf1-f196.google.com with SMTP id i26-v6so4696942pfo.12 for ; Fri, 10 Aug 2018 08:43:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=eCT/GwwzGvav606l3FZtyMu5qhBDgzLqJDAQv26V9/w=; b=TXCNWwRLsVTR585466zVpWIQdWZ2CWzLxtHalahHoxiCac9yuaIJ64iSrIN50N3mE6 04dpUHGRkVIYZowiuA+Rcvd/oRSlHVKrGtlNfQAIlPOqqRvsrJktyvarP0b8YkDXWqgM uHN0vNIpOqM5s8LJB5/4j8kzTM/ihnoHdqB/s= 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:mime-version :content-transfer-encoding; bh=eCT/GwwzGvav606l3FZtyMu5qhBDgzLqJDAQv26V9/w=; b=qDcvE856YD+IwWjPIixqIc+ARvCmQ03o+0CdgZSmd0kK8q/q62hhlPixJSGH1KKQ02 D5kBlPXppOJTHawVcWU6FHMapIACOyWrn3bGsWwNmXvBU/Mw7T7c4Bx0aVS7M/B9j3K2 dU4xYyqen0aem8jFITVMNM8PAKKRA3ng1jH5GBwI2CqqtAYJYNY5h+LJDE1iF/Vb5qmM E7TBXvrJLwdvLj6Q4QZSebIMmN89652nQQOlXI3MQLgw1Igh1wJKemCwzhMZjcNSO9/b bg0gIN+7hEv/nDCIzbxawxADbeq39NcxXPo21q1w2qJgUcfOTsVfMyZM3SybOlA7h93z KnOQ== X-Gm-Message-State: AOUpUlFqbpufcNRhqQy/St6bbrRgZMdCPaoT0RJuPaWGJ44f0EXrCMfa V5r5tM27LrT3Zm8+R4AhWg5yGA== X-Received: by 2002:a62:d842:: with SMTP id e63-v6mr7704211pfg.88.1533915805587; Fri, 10 Aug 2018 08:43:25 -0700 (PDT) Received: from zsm-linux.mtv.corp.google.com ([2620:15c:202:201:1b7c:8280:c835:b226]) by smtp.googlemail.com with ESMTPSA id 2-v6sm22192424pfs.58.2018.08.10.08.43.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Aug 2018 08:43:24 -0700 (PDT) From: Zubin Mithra To: peterz@infradead.org, mingo@redhat.com, acme@kernel.org, alexander.shishkin@linux.intel.com, x86@kernel.org Cc: linux-kernel@vger.kernel.org, groeck@chromium.org, keescook@chromium.org, zsm@chromium.org Subject: [PATCH] perf/x86: Add __ro_after_init annotations Date: Fri, 10 Aug 2018 08:43:14 -0700 Message-Id: <20180810154314.96710-1-zsm@chromium.org> X-Mailer: git-send-email 2.18.0.597.ga71716f1ad-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org x86_pmu_{format,events,attr,caps}_group is written to in init_hw_perf_events and not modified after. This makes them suitable candidates for annotating as __ro_after_init. Signed-off-by: Zubin Mithra --- arch/x86/events/core.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c index 5f4829f10129..88e5f67f5d4c 100644 --- a/arch/x86/events/core.c +++ b/arch/x86/events/core.c @@ -1584,7 +1584,7 @@ static void __init pmu_check_apic(void) } -static struct attribute_group x86_pmu_format_group = { +static struct attribute_group x86_pmu_format_group __ro_after_init = { .name = "format", .attrs = NULL, }; @@ -1715,7 +1715,7 @@ static struct attribute *events_attr[] = { NULL, }; -static struct attribute_group x86_pmu_events_group = { +static struct attribute_group x86_pmu_events_group __ro_after_init = { .name = "events", .attrs = events_attr, }; @@ -2230,7 +2230,7 @@ static struct attribute *x86_pmu_attrs[] = { NULL, }; -static struct attribute_group x86_pmu_attr_group = { +static struct attribute_group x86_pmu_attr_group __ro_after_init = { .attrs = x86_pmu_attrs, }; @@ -2248,7 +2248,7 @@ static struct attribute *x86_pmu_caps_attrs[] = { NULL }; -static struct attribute_group x86_pmu_caps_group = { +static struct attribute_group x86_pmu_caps_group __ro_after_init = { .name = "caps", .attrs = x86_pmu_caps_attrs, }; -- 2.18.0.597.ga71716f1ad-goog