From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932839AbdCaJPf (ORCPT ); Fri, 31 Mar 2017 05:15:35 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:40214 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932648AbdCaJPd (ORCPT ); Fri, 31 Mar 2017 05:15:33 -0400 Date: Fri, 31 Mar 2017 11:15:22 +0200 (CEST) From: Thomas Gleixner To: Fenghua Yu cc: Jiri Olsa , Peter Zijlstra , Mike Galbraith , Shaohua Li , lkml , Ingo Molnar , Peter Zijlstra Subject: Re: [PATCH] x86/intel_rdt: Add cpus_list rdtgroup file In-Reply-To: <20170329160825.GA24537@linux.intel.com> Message-ID: References: <20170329150948.4981-1-jolsa@kernel.org> <20170329160825.GA24537@linux.intel.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; Thanks, tglx