From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933292AbdCaPzU (ORCPT ); Fri, 31 Mar 2017 11:55:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46888 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933098AbdCaPzT (ORCPT ); Fri, 31 Mar 2017 11:55:19 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com C9D5961D0C Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jolsa@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com C9D5961D0C Date: Fri, 31 Mar 2017 17:55:12 +0200 From: Jiri Olsa To: Thomas Gleixner Cc: Fenghua Yu , Jiri Olsa , Peter Zijlstra , Mike Galbraith , Shaohua Li , lkml , Ingo Molnar , Peter Zijlstra Subject: Re: [PATCH] x86/intel_rdt: Add cpus_list rdtgroup file Message-ID: <20170331155512.GB5707@krava> References: <20170329150948.4981-1-jolsa@kernel.org> <20170329160825.GA24537@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.8.0 (2017-02-23) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Fri, 31 Mar 2017 15:55:18 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 31, 2017 at 11:15:22AM +0200, Thomas Gleixner wrote: > On Wed, 29 Mar 2017, Fenghua Yu wrote: > > > static int rdtgroup_cpus_show(struct kernfs_open_file *of, > > > - struct seq_file *s, void *v) > > > + struct seq_file *s, void *v, > > > + unsigned long flags) > > > { > > > + const char *fmt = flags & RFTYPE_FLAGS_CPUS_LIST ? "%*pbl\n" : "%*pb\n"; > > > > Change to: > > + const char *fmt = strcmp(of->kn->priv, "cpus") ? "%*pbl\n" : "%*pb\n"; > > You couldn't come up with a more horrible hack, right? > > Jiri was right with adding the flag to the base files, just the propagation > through the callbacks sucks. What's wrong with: > > struct rftype *rft = of->kn->priv; > bool list = rtf->flags & RFTYPE_FLAGS_CPUS_LIST; ok, I'll post the change thanks, jirka