Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S941751AbcKQSKk (ORCPT ); Thu, 17 Nov 2016 13:10:40 -0500 Received: from foss.arm.com ([217.140.101.70]:58398 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933965AbcKQSKi (ORCPT ); Thu, 17 Nov 2016 13:10:38 -0500 Date: Thu, 17 Nov 2016 18:10:37 +0000 From: Will Deacon To: Jan Glauber Cc: Mark Rutland , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v4 1/5] arm64: perf: Basic uncore counter support for Cavium ThunderX SOC Message-ID: <20161117181036.GS22855@arm.com> References: <73173d6ad2430eead5e9da40564a90a60961b6d9.1477741719.git.jglauber@cavium.com> <20161108235010.GC17771@arm.com> <20161111103029.GD16907@hardcore> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161111103029.GD16907@hardcore> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 733 Lines: 19 On Fri, Nov 11, 2016 at 11:30:29AM +0100, Jan Glauber wrote: > On Tue, Nov 08, 2016 at 11:50:10PM +0000, Will Deacon wrote: > > On Sat, Oct 29, 2016 at 01:55:29PM +0200, Jan Glauber wrote: > > > +/* node attribute depending on number of NUMA nodes */ > > > +static ssize_t node_show(struct device *dev, struct device_attribute *attr, > > > + char *page) > > > +{ > > > + if (NODES_SHIFT) > > > + return sprintf(page, "config:16-%d\n", 16 + NODES_SHIFT - 1); > > > > If NODES_SHIFT is 1, you'll end up with "config:16-16", which might confuse > > userspace. > > So should I use "config:16" in that case? Is it OK to use this also for > NODES_SHIFT=0 ? If you only need one bit, then "config:16" is the right thing to do. Will