Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758113AbcJHR1e (ORCPT ); Sat, 8 Oct 2016 13:27:34 -0400 Received: from mail-io0-f196.google.com ([209.85.223.196]:32790 "EHLO mail-io0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756722AbcJHR10 (ORCPT ); Sat, 8 Oct 2016 13:27:26 -0400 MIME-Version: 1.0 In-Reply-To: <1475894763-64683-3-git-send-email-fenghua.yu@intel.com> References: <1475894763-64683-1-git-send-email-fenghua.yu@intel.com> <1475894763-64683-3-git-send-email-fenghua.yu@intel.com> From: Nilay Vaish Date: Sat, 8 Oct 2016 12:10:47 -0500 Message-ID: Subject: Re: [PATCH v3 02/18] cacheinfo: Introduce cache id To: Fenghua Yu Cc: Thomas Gleixner , "H. Peter Anvin" , Ingo Molnar , Tony Luck , Peter Zijlstra , Stephane Eranian , Borislav Petkov , Dave Hansen , Shaohua Li , David Carrillo-Cisneros , Ravi V Shankar , Sai Prakhya , Vikas Shivappa , linux-kernel , x86 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1616 Lines: 44 On 7 October 2016 at 21:45, Fenghua Yu wrote: > From: Fenghua Yu > > diff --git a/drivers/base/cacheinfo.c b/drivers/base/cacheinfo.c > index e9fd32e..2a21c15 100644 > --- a/drivers/base/cacheinfo.c > +++ b/drivers/base/cacheinfo.c > @@ -233,6 +233,7 @@ static ssize_t file_name##_show(struct device *dev, \ > return sprintf(buf, "%u\n", this_leaf->object); \ > } > > +show_one(id, id); > show_one(level, level); > show_one(coherency_line_size, coherency_line_size); > show_one(number_of_sets, number_of_sets); > @@ -314,6 +315,7 @@ static ssize_t write_policy_show(struct device *dev, > return n; > } > > +static DEVICE_ATTR_RO(id); > static DEVICE_ATTR_RO(level); > static DEVICE_ATTR_RO(type); > static DEVICE_ATTR_RO(coherency_line_size); > @@ -327,6 +329,7 @@ static DEVICE_ATTR_RO(shared_cpu_list); > static DEVICE_ATTR_RO(physical_line_partition); > > static struct attribute *cache_default_attrs[] = { > + &dev_attr_id.attr, > &dev_attr_type.attr, > &dev_attr_level.attr, > &dev_attr_shared_cpu_map.attr, > @@ -350,6 +353,8 @@ cache_default_attrs_is_visible(struct kobject *kobj, > const struct cpumask *mask = &this_leaf->shared_cpu_map; > umode_t mode = attr->mode; > > + if ((attr == &dev_attr_id.attr) && this_leaf->attributes & CACHE_ID) Can you put parentheses around 'this_leaf->attributes & CACHE_ID'? Whenever I look at expressions using bitwise operators without parentheses, I have to lookup the precedence table to make sure everything is fine. -- Nilay