<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/lib/vsprintf.c, branch linux-3.7.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-3.7.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-3.7.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2012-10-05T18:04:58Z</updated>
<entry>
<title>lib/vsprintf.c: improve standard conformance of sscanf()</title>
<updated>2012-10-05T18:04:58Z</updated>
<author>
<name>Jan Beulich</name>
<email>JBeulich@suse.com</email>
</author>
<published>2012-10-05T00:13:24Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=da99075c1d368315e1508b6143226c0d27b621e0'/>
<id>urn:sha1:da99075c1d368315e1508b6143226c0d27b621e0</id>
<content type='text'>
Xen's pciback points out a couple of deficiencies with vsscanf()'s
standard conformance:

- Trailing character matching cannot be checked by the caller: With a
  format string of "(%x:%x.%x) %n" absence of the closing parenthesis
  cannot be checked, as input of "(00:00.0)" doesn't cause the %n to be
  evaluated (because of the code not skipping white space before the
  trailing %n).

- The parameter corresponding to a trailing %n could get filled even if
  there was a matching error: With a format string of "(%x:%x.%x)%n",
  input of "(00:00.0]" would still fill the respective variable pointed to
  (and hence again make the mismatch non-detectable by the caller).

This patch aims at fixing those, but leaves other non-conforming aspects
of it untouched, among them these possibly relevant ones:

- improper handling of the assignment suppression character '*' (blindly
  discarding all succeeding non-white space from the format and input
  strings),

- not honoring conversion specifiers for %n, - not recognizing the C99
  conversion specifier 't' (recognized by vsprintf()).

Signed-off-by: Jan Beulich &lt;jbeulich@suse.com&gt;
Cc: Konrad Rzeszutek Wilk &lt;konrad.wilk@oracle.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>lib/vsprintf: update documentation to cover all of %p[Mm][FR]</title>
<updated>2012-10-05T18:04:50Z</updated>
<author>
<name>Andy Shevchenko</name>
<email>andriy.shevchenko@linux.intel.com</email>
</author>
<published>2012-10-05T00:12:33Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=7c59154e7548429ff80384803577176466d2ab9a'/>
<id>urn:sha1:7c59154e7548429ff80384803577176466d2ab9a</id>
<content type='text'>
Acked-by: Andrei Emeltchenko &lt;andrei.emeltchenko@intel.com&gt;
Signed-off-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>lib: vsprintf: fix broken comments</title>
<updated>2012-10-05T18:04:49Z</updated>
<author>
<name>George Spelvin</name>
<email>linux@horizon.com</email>
</author>
<published>2012-10-05T00:12:32Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=f40005165f7f0bda6cc268bdbcaad98a8f26fb1a'/>
<id>urn:sha1:f40005165f7f0bda6cc268bdbcaad98a8f26fb1a</id>
<content type='text'>
Numbering the 8 potential digits 2 though 9 never did make a lot of sense.

Signed-off-by: George Spelvin &lt;linux@horizon.com&gt;
Cc: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
Cc: Michal Nazarewicz &lt;mina86@mina86.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>lib: vsprintf: optimize put_dec_trunc8()</title>
<updated>2012-10-05T18:04:49Z</updated>
<author>
<name>George Spelvin</name>
<email>linux@horizon.com</email>
</author>
<published>2012-10-05T00:12:30Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=cb239d0a97d573150d6106a92c0641da0d03f6a1'/>
<id>urn:sha1:cb239d0a97d573150d6106a92c0641da0d03f6a1</id>
<content type='text'>
If you're going to have a conditional branch after each 32x32-&gt;64-bit
multiply, might as well shrink the code and make it a loop.

This also avoids using the long multiply for small integers.

(This leaves the comments in a confusing state, but that's a separate
patch to make review easier.)

Signed-off-by: George Spelvin &lt;linux@horizon.com&gt;
Cc: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
Cc: Michal Nazarewicz &lt;mina86@mina86.com&gt;
Cc: Rabin Vincent &lt;rabin@rab.in&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>lib: vsprintf: optimize division by 10000</title>
<updated>2012-10-05T18:04:48Z</updated>
<author>
<name>George Spelvin</name>
<email>linux@horizon.com</email>
</author>
<published>2012-10-05T00:12:29Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=2359172a75986359ce9cf041a9aca6a32cdf8779'/>
<id>urn:sha1:2359172a75986359ce9cf041a9aca6a32cdf8779</id>
<content type='text'>
The same multiply-by-inverse technique can be used to convert division by
10000 to a 32x32-&gt;64-bit multiply.

Signed-off-by: George Spelvin &lt;linux@horizon.com&gt;
Cc: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
Cc: Michal Nazarewicz &lt;mina86@mina86.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>lib: vsprintf: optimize division by 10 for small integers</title>
<updated>2012-10-05T18:04:48Z</updated>
<author>
<name>George Spelvin</name>
<email>linux@horizon.com</email>
</author>
<published>2012-10-05T00:12:27Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=e49317d415f5a44bad8377a208d61902d752303e'/>
<id>urn:sha1:e49317d415f5a44bad8377a208d61902d752303e</id>
<content type='text'>
Shrink the reciprocal approximations used in put_dec_full4() based on the
comments in put_dec_full9().

Signed-off-by: George Spelvin &lt;linux@horizon.com&gt;
Cc: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
Cc: Michal Nazarewicz &lt;mina86@mina86.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>vsprintf: add support of '%*ph[CDN]'</title>
<updated>2012-07-31T00:25:14Z</updated>
<author>
<name>Andy Shevchenko</name>
<email>andriy.shevchenko@linux.intel.com</email>
</author>
<published>2012-07-30T21:40:27Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=31550a16a5d2af859e8a11839e8c6c6c9c92dfa7'/>
<id>urn:sha1:31550a16a5d2af859e8a11839e8c6c6c9c92dfa7</id>
<content type='text'>
There are many places in the kernel where the drivers print small buffers
as a hex string.  This patch adds a support of the variable width buffer
to print it as a hex string with a delimiter.  The idea came from Pavel
Roskin here: http://www.digipedia.pl/usenet/thread/18835/17449/

Sample output of
	pr_info("buf[%d:%d] %*phC\n", from, len, len, &amp;buf[from]);
could be look like this:
	[ 0.726130] buf[51:8] e8:16:b6:ef:e3:74:45:6e
	[ 0.750736] buf[59:15] 31:81:b8:3f:35:49:06:ae:df:32:06:05:4a:af:55
	[ 0.757602] buf[17:5] ac:16:d5:2c:ef

Signed-off-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Cc: Joe Perches &lt;joe@perches.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>lib/vsprintf.c: kptr_restrict: fix pK-error in SysRq show-all-timers(Q)</title>
<updated>2012-07-31T00:25:14Z</updated>
<author>
<name>Dan Rosenberg</name>
<email>drosenberg@vsecurity.com</email>
</author>
<published>2012-07-30T21:40:26Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=3715c5309f6d175c3053672b73fd4f73be16fd07'/>
<id>urn:sha1:3715c5309f6d175c3053672b73fd4f73be16fd07</id>
<content type='text'>
When using ALT+SysRq+Q all the pointers are replaced with "pK-error" like
this:

	[23153.208033]   .base:               pK-error

with echo h &gt; /proc/sysrq-trigger it works:

	[23107.776363]   .base:       ffff88023e60d540

The intent behind this behavior was to return "pK-error" in cases where
the %pK format specifier was used in interrupt context, because the
CAP_SYSLOG check wouldn't be meaningful.  Clearly this should only apply
when kptr_restrict is actually enabled though.

Reported-by: Stevie Trujillo &lt;stevie.trujillo@gmail.com&gt;
Signed-off-by: Dan Rosenberg &lt;dan.j.rosenberg@gmail.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>lib/vsprintf.c: remind people to update Documentation/printk-formats.txt when adding printk formats</title>
<updated>2012-07-31T00:25:14Z</updated>
<author>
<name>Andrew Morton</name>
<email>akpm@linux-foundation.org</email>
</author>
<published>2012-07-30T21:40:25Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=80f548e04d0b1d67d4fa8f59dbecc247f7b71c92'/>
<id>urn:sha1:80f548e04d0b1d67d4fa8f59dbecc247f7b71c92</id>
<content type='text'>
Cc: Randy Dunlap &lt;rdunlap@xenotime.net&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>vsprintf: add %pMR for Bluetooth MAC address</title>
<updated>2012-07-31T00:25:14Z</updated>
<author>
<name>Andrei Emeltchenko</name>
<email>andrei.emeltchenko@intel.com</email>
</author>
<published>2012-07-30T21:40:23Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=76597ff989a1fbaa9b9a1e54007cd759bf257ab7'/>
<id>urn:sha1:76597ff989a1fbaa9b9a1e54007cd759bf257ab7</id>
<content type='text'>
Bluetooth uses mostly LE byte order which is reversed for visual
interpretation.  Currently in Bluetooth in use unsafe batostr function.

This is a slightly modified version of Joe's patch (sent Sat, Dec 4,
2010).

Signed-off-by: Andrei Emeltchenko &lt;andrei.emeltchenko@intel.com&gt;
Cc: Joe Perches &lt;joe@perches.com&gt;
Cc: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
</feed>
