]> git.hungrycats.org Git - linux/commit
[PATCH] ppc64: Fix rtas file mess
authorAlexander Viro <viro@parcelfarce.linux.theplanet.co.uk>
Thu, 5 Aug 2004 13:37:01 +0000 (06:37 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Thu, 5 Aug 2004 13:37:01 +0000 (06:37 -0700)
commitca4a69853b12f29c5fe2bf97480f255750d96677
treee6a79168894a360f57d2c76adc97267637214d5a
parentb5a68cfc62b33df8566a10b9abb82fc86c65f0c7
[PATCH] ppc64: Fix rtas file mess

This does the seq_file conversion + annotation + cleanup + race fixes
for arch/ppc64/kernel/rtas-proc.c.

How the fuck did that file manage to get anywhere near the tree, anyway?
Take a look at guy's "implementation" of sprintf(buf, "%04d", num), for
example:

<vomit>
/* construct the sensor number like 0003 */
/* fill with zeros */
n = sprintf(tmp, "%d", s.token);
len = strlen(tmp);
while (strlen(tmp) < 4)
n += sprintf (tmp+n, "0");

/* invert the string */
while (tmp[i]) {
if (i<len)
tmp2[4-len+i] = tmp[i];
else
tmp2[3-i] = tmp[i];
i++;
}
tmp2[4] = '\0';
</vomit>

And it's full of that level of lusing ;-/
arch/ppc64/kernel/rtas-proc.c