lkml.org 
[lkml]   [2021]   [Oct]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v9 2/2] x86/sgx: Add an attribute for the amount of SGX memory in a NUMA node
On Sun, Oct 31, 2021 at 07:39:32PM +0200, Jarkko Sakkinen wrote:
> > > +static ssize_t size_show(struct device *dev, struct device_attribute *attr, char *buf)
> > > +{
> > > +       unsigned long size = 0;
> > > +       int nid;
> > > +
> > > +       for (nid = 0; nid < num_possible_nodes(); nid++) {
> > > +               if (dev == sgx_numa_nodes[nid].dev) {
> > > +                       size = sgx_numa_nodes[nid].size;
> > > +                       break;
> > > +               }
> > > +       }
> > > +
> > > +       return sysfs_emit(buf, "%lu\n", size);
> > > +}
> > > +DEVICE_ATTR_RO(size);
> >
> > static?
>
> The named ("sgx") attribute group is exported:
>
> extern const struct attribute_group sgx_node_group;

That's fine, I am objecting to the fact that you now have added a global
symbol called device_attr_size. Please make that static as that is a
VERY generic name.

thanks,

greg k-h

\
 
 \ /
  Last update: 2021-10-31 20:31    [W:1.983 / U:1.296 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site