aboutsummaryrefslogtreecommitdiff
path: root/include/linux/string_helpers.h
AgeCommit message (Collapse)AuthorFilesLines
2013-04-30lib/string_helpers: introduce generic string_unescapeAndy Shevchenko1-0/+58
There are several places in kernel where modules unescapes input to convert C-Style Escape Sequences into byte codes. The patch provides generic implementation of such approach. Test cases are also included into the patch. [[email protected]: clarify comment] [[email protected]: export get_random_int() to modules] Signed-off-by: Andy Shevchenko <[email protected]> Cc: Samuel Thibault <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Jason Baron <[email protected]> Cc: Alexander Viro <[email protected]> Cc: William Hubbs <[email protected]> Cc: Chris Brannon <[email protected]> Cc: Kirk Reiser <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2008-10-03[SCSI] lib: add generic helper to print sizes rounded to the correct SI rangeJames Bottomley1-0/+16
This patch adds the ability to print sizes in either units of 10^3 (SI) or 2^10 (Binary) units. It rounds up to three significant figures and can be used for either memory or storage capacities. Oh, and I'm fully aware that 64 bits is only 16EiB ... the Zetta and Yotta units are added for future proofing against the day we have 128 bit computers ... [[email protected]: fix missed unsigned long long cast] Signed-off-by: James Bottomley <[email protected]>