Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp354134pxb; Wed, 14 Apr 2021 17:37:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyDhm+NaoHkNJKu0LFNiIwcZzKK9NiuDsJ6AXa/+oWuBTvpCzlLdYXj6dUmPl0Hf7/nDn2z X-Received: by 2002:a17:906:3111:: with SMTP id 17mr678386ejx.403.1618447034621; Wed, 14 Apr 2021 17:37:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618447034; cv=none; d=google.com; s=arc-20160816; b=DeZ4OdK3ORDSRz5I3Se024Iq7eEWaK1s1ayKnOUZZnlsaGmokU6RfAt+/wlHiGgVAW GbTHsa/IsieVR5wBE08KbMWKODrwPSR4EiFn//FF9VYoWRC9AwmjS/0vnKRh7QG+IS2Z qGByZuqkYdHjo6PeqU0Ey5qplLBYYSJe/UT1b1PYQVI0mrx53RskUh18DRG4Tj0FaGXh zu69lnL4k2HVFUzmK5gMoSItba62r0BAlk00CYYkb3g6pFU1id+5aLaDtjAEWcfZR5jf hBuFINm54mK1/cHR5r2ltK6xxNmDLKZy1tp88OGoBJ0pP6hAHLUOzf2HHUIruUphPzLh 9zmQ== 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 :ironport-sdr:ironport-sdr; bh=Wyjqa+GgqqqsKYZOdBwMvj12TaaNp0jTCMKuKMiptb8=; b=MhRu/oTwJ4BLiPbwnKrdTUqlSVpO2RuQ0Qn/n3cOM/s4ZqKBrF2BlpETZhvwwvK0wP kGMwYU8fFZN3iAY8KdKB9cRGIeGkgri44JV/6LV3wvM2Bf3bky8dtPDJ+yL4lOTrEQUV i9msWKW0djhwTACCbxLDzOUfK9ZGp2JxMrXAS+1sbBt2A0gY6OHcTcAeT9wGGVesIODb 6ub1UAQVihHGLFFkkBFQ++seMz9YlGriQzHXr98yJad5ahtufm6wgaZBM1LPnu6WoCUH pWyx4FFFhOQ2GKoCJ0q8oRbNaC8V2Wfshls/Man88znnh+EfoXAyx1G8U9v5EtswSypY Ev6w== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b5si952815edz.154.2021.04.14.17.36.51; Wed, 14 Apr 2021 17:37:14 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346651AbhDNRNK (ORCPT + 99 others); Wed, 14 Apr 2021 13:13:10 -0400 Received: from mga02.intel.com ([134.134.136.20]:3013 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345473AbhDNRNI (ORCPT ); Wed, 14 Apr 2021 13:13:08 -0400 IronPort-SDR: rVSufdc29H2i1nVLggKWvbaw/1qYlSHVIo6ZDd/uV+Nc2zmJxFnbTcOeVHcJhhSB2Q0wm5WKYM btNIBKYoi6Hw== X-IronPort-AV: E=McAfee;i="6200,9189,9954"; a="181811930" X-IronPort-AV: E=Sophos;i="5.82,222,1613462400"; d="scan'208";a="181811930" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Apr 2021 10:12:46 -0700 IronPort-SDR: m0pMUeCiSNJiP3uI9MFOjORxwthq8g1scpsCCDSzopp76+FOLPsXy1SiRLIlVpMA1ec0JoYeef r0CIPLkJRruA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,222,1613462400"; d="scan'208";a="382427969" Received: from black.fi.intel.com (HELO black.fi.intel.com.) ([10.237.72.28]) by orsmga003.jf.intel.com with ESMTP; 14 Apr 2021 10:12:44 -0700 From: Alexander Shishkin To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, Rikard Falkeborn , Alexander Shishkin , Andy Shevchenko Subject: [PATCH 4/7] intel_th: Constify attribute_group structs Date: Wed, 14 Apr 2021 20:12:48 +0300 Message-Id: <20210414171251.14672-5-alexander.shishkin@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210414171251.14672-1-alexander.shishkin@linux.intel.com> References: <20210414171251.14672-1-alexander.shishkin@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rikard Falkeborn The only usage of them is to pass their address to sysfs_create_group() and sysfs_remove_group(), both which have pointers to const attribute_group structs as input. Make them const to allow the compiler to put them in read-only memory. Signed-off-by: Rikard Falkeborn Signed-off-by: Alexander Shishkin Reviewed-by: Andy Shevchenko --- drivers/hwtracing/intel_th/intel_th.h | 2 +- drivers/hwtracing/intel_th/msu.c | 2 +- drivers/hwtracing/intel_th/pti.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/hwtracing/intel_th/intel_th.h b/drivers/hwtracing/intel_th/intel_th.h index 05fa2dab37d1..89c67e0e1d34 100644 --- a/drivers/hwtracing/intel_th/intel_th.h +++ b/drivers/hwtracing/intel_th/intel_th.h @@ -178,7 +178,7 @@ struct intel_th_driver { /* file_operations for those who want a device node */ const struct file_operations *fops; /* optional attributes */ - struct attribute_group *attr_group; + const struct attribute_group *attr_group; /* source ops */ int (*set_output)(struct intel_th_device *thdev, diff --git a/drivers/hwtracing/intel_th/msu.c b/drivers/hwtracing/intel_th/msu.c index 7d95242db900..2edc4666633d 100644 --- a/drivers/hwtracing/intel_th/msu.c +++ b/drivers/hwtracing/intel_th/msu.c @@ -2095,7 +2095,7 @@ static struct attribute *msc_output_attrs[] = { NULL, }; -static struct attribute_group msc_output_group = { +static const struct attribute_group msc_output_group = { .attrs = msc_output_attrs, }; diff --git a/drivers/hwtracing/intel_th/pti.c b/drivers/hwtracing/intel_th/pti.c index 0da6b787f553..09132ab8bc23 100644 --- a/drivers/hwtracing/intel_th/pti.c +++ b/drivers/hwtracing/intel_th/pti.c @@ -142,7 +142,7 @@ static struct attribute *pti_output_attrs[] = { NULL, }; -static struct attribute_group pti_output_group = { +static const struct attribute_group pti_output_group = { .attrs = pti_output_attrs, }; @@ -295,7 +295,7 @@ static struct attribute *lpp_output_attrs[] = { NULL, }; -static struct attribute_group lpp_output_group = { +static const struct attribute_group lpp_output_group = { .attrs = lpp_output_attrs, }; -- 2.30.2