From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754138AbcIILFP (ORCPT ); Fri, 9 Sep 2016 07:05:15 -0400 Received: from foss.arm.com ([217.140.101.70]:38720 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754077AbcIILFH (ORCPT ); Fri, 9 Sep 2016 07:05:07 -0400 Date: Fri, 9 Sep 2016 12:04:50 +0100 From: Mark Rutland To: Will Deacon Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, acme@kernel.org, alexander.shishkin@linux.intel.com, jolsa@kernel.org, mingo@redhat.com, peterz@infradead.org Subject: Re: [RFCv4 5/7] drivers/perf: arm_pmu: expose a cpumask in sysfs Message-ID: <20160909110450.GB10562@leverpostej> References: <1473330112-28528-1-git-send-email-mark.rutland@arm.com> <1473330112-28528-6-git-send-email-mark.rutland@arm.com> <20160909102443.GE20192@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160909102443.GE20192@arm.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 09, 2016 at 11:24:43AM +0100, Will Deacon wrote: > On Thu, Sep 08, 2016 at 11:21:50AM +0100, Mark Rutland wrote: > > +static ssize_t armpmu_cpumask_show(struct device *dev, > > + struct device_attribute *attr, char *buf) > > +{ > > + struct arm_pmu *armpmu = to_arm_pmu(dev_get_drvdata(dev)); > > + return cpumap_print_to_pagebuf(true, buf, &armpmu->supported_cpus); > > +} > > + > > +static struct device_attribute armpmu_cpumask_attr = > > + __ATTR(cpus, S_IRUGO, armpmu_cpumask_show, NULL); > > You can use the DEVICE_ATTR macro for this. Ok. I've made use of this locally. I'll send an updated version of the patches shortly, once I've given this a spin on HW Mark.