From patchwork Sat Jul 27 03:00:49 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hanjun Guo X-Patchwork-Id: 18615 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f71.google.com (mail-qa0-f71.google.com [209.85.216.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 883C425DFF for ; Sat, 27 Jul 2013 03:03:27 +0000 (UTC) Received: by mail-qa0-f71.google.com with SMTP id bq6sf1517067qab.2 for ; Fri, 26 Jul 2013 20:03:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-beenthere:x-forwarded-to:x-forwarded-for :delivered-to:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=WQcQtBqOmpPQdZ1muA2TrQd2fppBrBFPrZRKlc7A8a0=; b=SMCE6Vyb2vmoikKtgGo1EAA86c3vBKnCDLA69fPpcCUdcKNRnUofDw8q1ASIq09gw7 90voork8RYRRlspEdhEWgl8lOYzRXWoVLX3IBOutuPKgeVwhUSNKX+1JbJ+Go+D0KM7R THHgmCt/d4vNybspBilOscsxJ17tQ3ytHSq/jg1b+DIO8AlYKNUETfG1XSD+QR79A5XR p6ZUBucxkKObFq1rLE3ApCr0jKcDqHdWewKmJMlHzswvpBkPNDZM5+JFWkoECgzsBK63 aTKw0mkwljDIBCRgLZNNaTtgwbGc0nTdo7HUuzxQMvL8VF74GmtpOoZqw7i1WXfAIJm/ r9ag== X-Received: by 10.236.127.108 with SMTP id c72mr25200909yhi.16.1374894206902; Fri, 26 Jul 2013 20:03:26 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.122.74 with SMTP id lq10ls1427141qeb.30.gmail; Fri, 26 Jul 2013 20:03:26 -0700 (PDT) X-Received: by 10.58.34.69 with SMTP id x5mr22080248vei.11.1374894206760; Fri, 26 Jul 2013 20:03:26 -0700 (PDT) Received: from mail-vb0-f50.google.com (mail-vb0-f50.google.com [209.85.212.50]) by mx.google.com with ESMTPS id na3si3042318vcb.57.2013.07.26.20.03.26 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 26 Jul 2013 20:03:26 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.50 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.50; Received: by mail-vb0-f50.google.com with SMTP id x13so1259387vbb.37 for ; Fri, 26 Jul 2013 20:03:26 -0700 (PDT) X-Received: by 10.52.160.197 with SMTP id xm5mr1058790vdb.48.1374894206411; Fri, 26 Jul 2013 20:03:26 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.221.11.8 with SMTP id pc8csp12347vcb; Fri, 26 Jul 2013 20:03:25 -0700 (PDT) X-Received: by 10.66.222.1 with SMTP id qi1mr58237113pac.53.1374894205321; Fri, 26 Jul 2013 20:03:25 -0700 (PDT) Received: from mail-pd0-f182.google.com (mail-pd0-f182.google.com [209.85.192.182]) by mx.google.com with ESMTPS id g9si4541183pac.242.2013.07.26.20.03.24 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 26 Jul 2013 20:03:25 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.182 is neither permitted nor denied by best guess record for domain of hanjun.guo@linaro.org) client-ip=209.85.192.182; Received: by mail-pd0-f182.google.com with SMTP id r10so3536853pdi.13 for ; Fri, 26 Jul 2013 20:03:24 -0700 (PDT) X-Received: by 10.68.52.10 with SMTP id p10mr57231628pbo.92.1374894204729; Fri, 26 Jul 2013 20:03:24 -0700 (PDT) Received: from localhost ([218.17.215.175]) by mx.google.com with ESMTPSA id xe9sm63123514pbc.21.2013.07.26.20.01.32 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 26 Jul 2013 20:03:24 -0700 (PDT) From: Hanjun Guo To: Greg Kroah-Hartman , Thomas Gleixner , Chris Metcalf Cc: patches@linaro.org, linaro-kernel@lists.linaro.org, Mike Travis , Rusty Russell , Ingo Molnar , "H. Peter Anvin" , linux-kernel@vger.kernel.org, x86@kernel.org, linaro-acpi@lists.linaro.org, Al Stone , Graeme Gregory , Naresh Bhat , Tomasz Nowicki , Hanjun Guo Subject: [PATCH 1/3] cpu topology: remove stale arch_provides_topology_pointers and define_siblings_show_map/list() Date: Sat, 27 Jul 2013 11:00:49 +0800 Message-Id: <1374894051-31634-1-git-send-email-hanjun.guo@linaro.org> X-Mailer: git-send-email 1.7.9.5 X-Gm-Message-State: ALoCoQlNGOF/P52R2lvxI9IgxglnnVxBBahyiIOejXhqIyfPF+Z1RUuBwKUqQ0bayTJJEsy480Aa X-Original-Sender: hanjun.guo@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.50 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , arch_provides_topology_pointers was introduced in commit 23ca4bba3 (x86: cleanup early per cpu variables/accesses v4) to indicate pointers to the topology cpumask_t maps are valid to avoid copying data on to/off of the stack. But later in commit fbd59a8d (cpumask: Use topology_core_cpumask()/ topology_thread_cpumask()), the pointers to the topology struct cpumask maps are always valid. After that commit, the only difference is that there is a redundant "unsigned int cpu = dev->id;" if arch_provides_topology_pointers defined, but dev->id is type 'u32' which devolves to 'unsigned int' on all supported arches. So this arch_provides_topology_pointers define is pointless and only cause obfuscation now, remove it. Tested on x86 machine, topology information in sys/devices/system/cpu/ cpuX/topology/ is the same after appling this patch set. Signed-off-by: Hanjun Guo --- drivers/base/topology.c | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/drivers/base/topology.c b/drivers/base/topology.c index 2f5919e..94ffee3 100644 --- a/drivers/base/topology.c +++ b/drivers/base/topology.c @@ -62,25 +62,6 @@ static ssize_t show_cpumap(int type, const struct cpumask *mask, char *buf) } #endif -#ifdef arch_provides_topology_pointers -#define define_siblings_show_map(name) \ -static ssize_t show_##name(struct device *dev, \ - struct device_attribute *attr, char *buf) \ -{ \ - unsigned int cpu = dev->id; \ - return show_cpumap(0, topology_##name(cpu), buf); \ -} - -#define define_siblings_show_list(name) \ -static ssize_t show_##name##_list(struct device *dev, \ - struct device_attribute *attr, \ - char *buf) \ -{ \ - unsigned int cpu = dev->id; \ - return show_cpumap(1, topology_##name(cpu), buf); \ -} - -#else #define define_siblings_show_map(name) \ static ssize_t show_##name(struct device *dev, \ struct device_attribute *attr, char *buf) \ @@ -95,7 +76,6 @@ static ssize_t show_##name##_list(struct device *dev, \ { \ return show_cpumap(1, topology_##name(dev->id), buf); \ } -#endif #define define_siblings_show_func(name) \ define_siblings_show_map(name); define_siblings_show_list(name)