lkml.org 
[lkml]   [2017]   [Mar]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] x86/intel_rdt: Add cpus_list rdtgroup file
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

\
 
 \ /
  Last update: 2017-03-31 17:38    [W:0.135 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site