Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp630560pxb; Thu, 19 Nov 2020 09:45:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJw7zc0bCh2v1d1ONgCdyYXxhGRLgWPy/wU/j6Rg3nyi/OwKNqY8lgtrHD2f20CToMWdGa/H X-Received: by 2002:a05:6402:a57:: with SMTP id bt23mr30290060edb.62.1605807928108; Thu, 19 Nov 2020 09:45:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605807928; cv=none; d=google.com; s=arc-20160816; b=SaDPriIfp01Lq4uOd01pOfch0/1CeacmXzcWEp3pbRqh+j8HnZ6jZMSi9LPr2X/JHE 2y6XColiExXjSfAV8vbyc2ghbSyGuMvShhvOecSP3+8trzS1oyuM2rTW7E53VcojeuIg 1TdooWUEQt9LwMKtsIG2I/qTiR67guqfelD83GUL6fH1FcAKyCk7NHVJalPLpBidBG6+ V5rk9ZM7T9JTuhiO2Iq99kuMxf9WkTm5L7UoCHJnBsqReNFvN9P5qf3durxlEHhZ4lWK ili/lHduCotiLauxuacwgUSCzwAo1WjWGCuvRlgA63bWbSFVzsFGPzxFHeeVUQatciTG TBAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=6EUwIaTvhKlhY/ECgSJd6ijmLm0pgbclTSXiBzlh9SU=; b=iWeX6buDiN94hYvHrh0euvztcziE/F/OWURzVW+SPmb6CnYzOPpmh1MYv9PlZwAuzs Bs+V8Rvw2ksVvmxw3QBTHi38/gL1nMf/y5KDu60wUMDq+gSLa6ELzDPzAoTzpkQUFgSu loBjtbUR2V+3MA2tdII/nIJF5leXdb6qpX+bZ2WnftcnudrwTnpYaNPVlU7r8engWAo5 HE+kXuGp+ncaQLAAia71aRd4aLsQYtM2yM/kytAovfEdHQNZmqzDR/XjjrpuwXt1GuiB 5ge3OSqtuJSj5hzDWWzn+BDxhfUvB2nB1kjPnSPH1kyCIoot4ig8ib5+7mN0grDyFEnY 84oQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="Elhl4/Dt"; dkim=neutral (no key) header.i=@linutronix.de; 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=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b18si248224ejk.164.2020.11.19.09.45.05; Thu, 19 Nov 2020 09:45:28 -0800 (PST) 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=@linutronix.de header.s=2020 header.b="Elhl4/Dt"; dkim=neutral (no key) header.i=@linutronix.de; 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=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729764AbgKSRkP (ORCPT + 99 others); Thu, 19 Nov 2020 12:40:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729761AbgKSRkM (ORCPT ); Thu, 19 Nov 2020 12:40:12 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9549AC0613CF; Thu, 19 Nov 2020 09:40:12 -0800 (PST) Date: Thu, 19 Nov 2020 17:40:09 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1605807610; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6EUwIaTvhKlhY/ECgSJd6ijmLm0pgbclTSXiBzlh9SU=; b=Elhl4/DtU3N1aQ4FpY9dwmuTN3hBCBxgWSFE6AIuxH/iUyJ74Ka83RrGDLzyKaP77F6OD1 k6NrMy4SCQs7T287vxoumi5R1Zqs0iTsBIkaupnuNVPiLrWfcjimWSzTnprvAuiP0B9cZx dSPAT7vjCII4TSdaRn4pxNZeswrSnRWDi/bfUBBpV8EVaSeO/UEbeta77sAnRF3H2c2Tw/ Orx2+nWzMWMpD/mM3efAKOt8Zc1RghooRqRsW5uzhgsBHW1BV973BGsb86P7gLvDj46lko kyfL02f0VD45J9DHXwFQE1mK4D+dfS1fHyw1vZwWeNEc8ICZJqzSqu6pTb+DuQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1605807610; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6EUwIaTvhKlhY/ECgSJd6ijmLm0pgbclTSXiBzlh9SU=; b=u11FErYZJrMx4VQAQKlzHoge0yDkqCzjNKL+3oT+ChT35+RXwzaCzG/NQCa6lIkhRsLceX 45ie+4bR/XUXGiAQ== From: "tip-bot2 for Rikard Falkeborn" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/cache] x86/resctrl: Constify kernfs_ops Cc: Rikard Falkeborn , Borislav Petkov , Reinette Chatre , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20201110230228.801785-1-rikard.falkeborn@gmail.com> References: <20201110230228.801785-1-rikard.falkeborn@gmail.com> MIME-Version: 1.0 Message-ID: <160580760905.11244.68091296565115435.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the x86/cache branch of tip: Commit-ID: 2002d2951398317d0f46e64ae6d8dd58ed541c6d Gitweb: https://git.kernel.org/tip/2002d2951398317d0f46e64ae6d8dd58ed541c6d Author: Rikard Falkeborn AuthorDate: Wed, 11 Nov 2020 00:02:28 +01:00 Committer: Borislav Petkov CommitterDate: Thu, 19 Nov 2020 18:23:45 +01:00 x86/resctrl: Constify kernfs_ops The only usage of the kf_ops field in the rftype struct is to pass it as argument to __kernfs_create_file(), which accepts a pointer to const. Make it a pointer to const. This makes it possible to make rdtgroup_kf_single_ops and kf_mondata_ops const, which allows the compiler to put them in read-only memory. Signed-off-by: Rikard Falkeborn Signed-off-by: Borislav Petkov Acked-by: Reinette Chatre Link: https://lkml.kernel.org/r/20201110230228.801785-1-rikard.falkeborn@gmail.com --- arch/x86/kernel/cpu/resctrl/internal.h | 2 +- arch/x86/kernel/cpu/resctrl/rdtgroup.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/kernel/cpu/resctrl/internal.h b/arch/x86/kernel/cpu/resctrl/internal.h index 6cb068f..5540b02 100644 --- a/arch/x86/kernel/cpu/resctrl/internal.h +++ b/arch/x86/kernel/cpu/resctrl/internal.h @@ -264,7 +264,7 @@ void __exit rdtgroup_exit(void); struct rftype { char *name; umode_t mode; - struct kernfs_ops *kf_ops; + const struct kernfs_ops *kf_ops; unsigned long flags; unsigned long fflags; diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c index af323e2..78dcbb8 100644 --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c @@ -240,13 +240,13 @@ static ssize_t rdtgroup_file_write(struct kernfs_open_file *of, char *buf, return -EINVAL; } -static struct kernfs_ops rdtgroup_kf_single_ops = { +static const struct kernfs_ops rdtgroup_kf_single_ops = { .atomic_write_len = PAGE_SIZE, .write = rdtgroup_file_write, .seq_show = rdtgroup_seqfile_show, }; -static struct kernfs_ops kf_mondata_ops = { +static const struct kernfs_ops kf_mondata_ops = { .atomic_write_len = PAGE_SIZE, .seq_show = rdtgroup_mondata_show, };