<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/lib/vsprintf.c, branch v3.9.7</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.9.7</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.9.7'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2013-02-22T01:22:20Z</updated>
<entry>
<title>lib/vsprintf.c: add %pa format specifier for phys_addr_t types</title>
<updated>2013-02-22T01:22:20Z</updated>
<author>
<name>Stepan Moskovchenko</name>
<email>stepanm@codeaurora.org</email>
</author>
<published>2013-02-22T00:43:09Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=7d7992108d02aa92ad4c77e5d9ce14088c942e75'/>
<id>urn:sha1:7d7992108d02aa92ad4c77e5d9ce14088c942e75</id>
<content type='text'>
Add the %pa format specifier for printing a phys_addr_t type and its
derivative types (such as resource_size_t), since the physical address
size on some platforms can vary based on build options, regardless of
the native integer type.

Signed-off-by: Stepan Moskovchenko &lt;stepanm@codeaurora.org&gt;
Cc: Rob Landley &lt;rob@landley.net&gt;
Cc: George Spelvin &lt;linux@horizon.com&gt;
Cc: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Cc: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
Cc: Andrei Emeltchenko &lt;andrei.emeltchenko@intel.com&gt;
Cc: Ingo Molnar &lt;mingo@elte.hu&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>simple_strto*: annotate function as obsolete</title>
<updated>2012-12-18T01:15:22Z</updated>
<author>
<name>Eldad Zack</name>
<email>eldad@fogrefinery.com</email>
</author>
<published>2012-12-18T00:03:05Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=462e471107624fe9bd8b6353ac13e06305c3f3fd'/>
<id>urn:sha1:462e471107624fe9bd8b6353ac13e06305c3f3fd</id>
<content type='text'>
Update the documentation for simple_strto* to reflect that it has been
obsoleted and advise the usage of kstrto*.

Signed-off-by: Eldad Zack &lt;eldad@fogrefinery.com&gt;
Cc: J. Bruce Fields &lt;bfields@fieldses.org&gt;
Cc: Joe Perches &lt;joe@perches.com&gt;
Cc: Randy Dunlap &lt;rdunlap@xenotime.net&gt;
Cc: Alexey Dobriyan &lt;adobriyan@gmail.com&gt;
Cc: Rob Landley &lt;rob@landley.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>sscanf: don't ignore field widths for numeric conversions</title>
<updated>2012-12-18T01:15:18Z</updated>
<author>
<name>Jan Beulich</name>
<email>JBeulich@suse.com</email>
</author>
<published>2012-12-18T00:01:31Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=53809751ac230a3611b5cdd375f3389f3207d471'/>
<id>urn:sha1:53809751ac230a3611b5cdd375f3389f3207d471</id>
<content type='text'>
This is another step towards better standard conformance.  Rather than
adding a local buffer to store the specified portion of the string (with
the need to enforce an arbitrary maximum supported width to limit the
buffer size), do a maximum width conversion and then drop as much of it as
is necessary to meet the caller's request.

Also fail on negative field widths.

Uses the deprecated simple_strto*() functions because kstrtoXX() fail on
non-zero terminated strings.

Signed-off-by: Jan Beulich &lt;jbeulich@suse.com&gt;
Cc: Alexey Dobriyan &lt;adobriyan@gmail.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: fix handling of %zd when using ssize_t</title>
<updated>2012-12-18T01:15:13Z</updated>
<author>
<name>Jason Gunthorpe</name>
<email>jgunthorpe@obsidianresearch.com</email>
</author>
<published>2012-12-17T23:59:58Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=ef12496022d5917cfe0b04cf8fd685fc6bc08400'/>
<id>urn:sha1:ef12496022d5917cfe0b04cf8fd685fc6bc08400</id>
<content type='text'>
Documentation/printk-formats.txt says to use %zd for a ssize_t argument
and some drivers do.  Unfortunately this prints a positive number for
negative values eg:

  tpm_tis 70030000.tpm_tis: tpm_transmit: tpm_send: error 4294967234

Add a case to va_args a ssize_t type if the interpretation should be
signed.

Tested on PPC32.

Signed-off-by: Jason Gunthorpe &lt;jgunthorpe@obsidianresearch.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: 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://git.stealer.net/cgit.cgi/user/sven/linux.git/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://git.stealer.net/cgit.cgi/user/sven/linux.git/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://git.stealer.net/cgit.cgi/user/sven/linux.git/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://git.stealer.net/cgit.cgi/user/sven/linux.git/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://git.stealer.net/cgit.cgi/user/sven/linux.git/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://git.stealer.net/cgit.cgi/user/sven/linux.git/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>
</feed>
