From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933504AbdCaPiP (ORCPT ); Fri, 31 Mar 2017 11:38:15 -0400 Received: from mga02.intel.com ([134.134.136.20]:39207 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933200AbdCaPiO (ORCPT ); Fri, 31 Mar 2017 11:38:14 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,252,1486454400"; d="scan'208";a="81418673" Date: Fri, 31 Mar 2017 08:40:12 -0700 From: Fenghua Yu 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: <20170331154012.GC24537@linux.intel.com> 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.5.21 (2010-09-15) 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; You are absolutely correct. Thanks. -Fenghua