From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752146AbbEFWyS (ORCPT ); Wed, 6 May 2015 18:54:18 -0400 Received: from mail-lb0-f169.google.com ([209.85.217.169]:34552 "EHLO mail-lb0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751766AbbEFWxU (ORCPT ); Wed, 6 May 2015 18:53:20 -0400 From: Rasmus Villemoes To: Ingo Molnar , "Rafael J. Wysocki" , "Paul E. McKenney" Cc: Rasmus Villemoes , linux-kernel@vger.kernel.org Subject: [PATCH 3/5] drivers/base/cpu.c: use __cpu_xyz_mask directly Date: Thu, 7 May 2015 00:52:52 +0200 Message-Id: <1430952775-4266-4-git-send-email-linux@rasmusvillemoes.dk> X-Mailer: git-send-email 2.1.3 In-Reply-To: <1430952775-4266-1-git-send-email-linux@rasmusvillemoes.dk> References: <1430952775-4266-1-git-send-email-linux@rasmusvillemoes.dk> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The only user of the lvalue-ness of the cpu_xyz_mask variables is in drivers/base/cpu.c, and that is mostly a work-around for the fact that not even const variables can be used in static initialization. Now that the underlying struct cpumasks are exposed we can take their address. Signed-off-by: Rasmus Villemoes --- drivers/base/cpu.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c index f160ea44a86d..f21b08601a19 100644 --- a/drivers/base/cpu.c +++ b/drivers/base/cpu.c @@ -199,7 +199,7 @@ static const struct attribute_group *hotplugable_cpu_attr_groups[] = { struct cpu_attr { struct device_attribute attr; - const struct cpumask *const * const map; + const struct cpumask *const map; }; static ssize_t show_cpus_attr(struct device *dev, @@ -208,7 +208,7 @@ static ssize_t show_cpus_attr(struct device *dev, { struct cpu_attr *ca = container_of(attr, struct cpu_attr, attr); - return cpumap_print_to_pagebuf(true, buf, *ca->map); + return cpumap_print_to_pagebuf(true, buf, ca->map); } #define _CPU_ATTR(name, map) \ @@ -216,9 +216,9 @@ static ssize_t show_cpus_attr(struct device *dev, /* Keep in sync with cpu_subsys_attrs */ static struct cpu_attr cpu_attrs[] = { - _CPU_ATTR(online, &cpu_online_mask), - _CPU_ATTR(possible, &cpu_possible_mask), - _CPU_ATTR(present, &cpu_present_mask), + _CPU_ATTR(online, &__cpu_online_mask), + _CPU_ATTR(possible, &__cpu_possible_mask), + _CPU_ATTR(present, &__cpu_present_mask), }; /* -- 2.1.3