Thread (16 messages) 16 messages, 4 authors, 2021-01-15

Re: [PATCH v5 1/2] tpm: add sysfs exports for all banks of PCR registers

From: Joe Perches <joe@perches.com>
Date: 2021-01-15 21:14:55
Also in: linux-api

On Fri, 2021-01-15 at 13:06 -0800, James Bottomley wrote:
On Fri, 2021-01-15 at 12:48 -0800, Joe Perches wrote:
quoted
On Fri, 2021-01-15 at 10:07 -0800, James Bottomley wrote:
quoted
On Fri, 2021-01-15 at 09:26 -0800, James Bottomley wrote:
quoted
On Fri, 2021-01-15 at 14:54 +0100, Greg KH wrote:
quoted
On Thu, Jan 14, 2021 at 04:21:08PM -0800, James Bottomley
wrote:
[...]
quoted
quoted
It looks like we already have a couple of bugs in the kernel
introduced by this confusion ...  return sysfs_emit() vs
return
sysfs_emit_at() being the most tricky ...
Hm, Joe, you did the conversion to these functions (and wrote
the
api), care to review this?
A cursory glance tells me that summary_show in 
drivers/infiniband/hw/usnic/usnic_ib_sysfs.c has a problem, I
think the last = should be +=
No, it's correct and overwriting what would otherwise be a trailing
space.
The last two lines of summary_show() are

   len = sysfs_emit_at(buf, len, "\n");

   return len;

So that always returns 2, the length of "\n",
1 rather than 2, but you are otherwise correct.
rather than the length of
everything you just put into buf, which is what sysfs attributes are
supposed to return.
Ah, right.  My braino mistake.
This should not use the sysfs_emit_at return value at all.

Patch upcoming...
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help