On Thu, 2006-03-09 at 15:18 -0800, Roland Dreier wrote:
> > +static ssize_t show_version(struct device_driver *dev, char *buf)
> > +{
> > + return scnprintf(buf, PAGE_SIZE, "%s", ipath_core_version);
> > +}
>
> Any reason you left a "\n" off of this attribute?
Nope, just a bogon.
> > +static ssize_t show_atomic_stats(struct device_driver *dev, char *buf)
> > +{
> > + memcpy(buf, &ipath_stats, sizeof(ipath_stats));
> > +
> > + return sizeof(ipath_stats);
> > +}
>
> I think putting a whole binary struct in a sysfs attribute is
> considered a no-no.
Grumble. it's a fairly small struct, much less than a page in length,
and userspace needs an atomic view of it, instead of reading each of the
umpteen broken-out files that we also provide for humean-readable access
to each counter.
I didn't see any point to implementing the sysfs binary file interface
in order to do exactly what this 6-line function does. Still don't, in
fact :-)
> Another missing "\n"
Thanks.
<b
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]