Merge tag 'docs-for-linus' of git://git.lwn.net/linux-2.6
[pandora-kernel.git] / Documentation / printk-formats.txt
index 87f1042..2216eb1 100644 (file)
@@ -8,6 +8,21 @@ If variable is of Type,                use printk format specifier:
                unsigned long long      %llu or %llx
                size_t                  %zu or %zx
                ssize_t                 %zd or %zx
+               s32                     %d or %x
+               u32                     %u or %x
+               s64                     %lld or %llx
+               u64                     %llu or %llx
+
+If <type> is dependent on a config option for its size (e.g., sector_t,
+blkcnt_t) or is architecture-dependent for its size (e.g., tcflag_t), use a
+format specifier of its largest possible type and explicitly cast to it.
+Example:
+
+       printk("test: sector number/total blocks: %llu/%llu\n",
+               (unsigned long long)sector, (unsigned long long)blockcount);
+
+Reminder: sizeof() result is of type size_t.
+
 
 Raw pointer value SHOULD be printed with %p. The kernel supports
 the following extended format specifiers for pointer types:
@@ -54,6 +69,7 @@ Struct Resources:
 
        For printing struct resources. The 'R' and 'r' specifiers result in a
        printed resource with ('R') or without ('r') a decoded flags member.
+       Passed by reference.
 
 Physical addresses types phys_addr_t:
 
@@ -132,6 +148,8 @@ MAC/FDDI addresses:
        specifier to use reversed byte order suitable for visual interpretation
        of Bluetooth addresses which are in the little endian order.
 
+       Passed by reference.
+
 IPv4 addresses:
 
        %pI4    1.2.3.4
@@ -146,6 +164,8 @@ IPv4 addresses:
        host, network, big or little endian order addresses respectively. Where
        no specifier is provided the default network/big endian order is used.
 
+       Passed by reference.
+
 IPv6 addresses:
 
        %pI6    0001:0002:0003:0004:0005:0006:0007:0008
@@ -160,6 +180,8 @@ IPv6 addresses:
        print a compressed IPv6 address as described by
        http://tools.ietf.org/html/rfc5952
 
+       Passed by reference.
+
 IPv4/IPv6 addresses (generic, with port, flowinfo, scope):
 
        %pIS    1.2.3.4         or 0001:0002:0003:0004:0005:0006:0007:0008
@@ -186,6 +208,8 @@ IPv4/IPv6 addresses (generic, with port, flowinfo, scope):
        specifiers can be used as well and are ignored in case of an IPv6
        address.
 
+       Passed by reference.
+
        Further examples:
 
        %pISfc          1.2.3.4         or [1:2:3:4:5:6:7:8]/123456789
@@ -207,6 +231,8 @@ UUID/GUID addresses:
        Where no additional specifiers are used the default big endian
        order with lower case hex characters will be printed.
 
+       Passed by reference.
+
 dentry names:
        %pd{,2,3,4}
        %pD{,2,3,4}
@@ -216,6 +242,8 @@ dentry names:
        equivalent of %s dentry->d_name.name we used to use, %pd<n> prints
        n last components.  %pD does the same thing for struct file.
 
+       Passed by reference.
+
 struct va_format:
 
        %pV
@@ -231,13 +259,19 @@ struct va_format:
        Do not use this feature without some mechanism to verify the
        correctness of the format string and va_list arguments.
 
-u64 SHOULD be printed with %llu/%llx:
+       Passed by reference.
+
+struct clk:
 
-       printk("%llu", u64_var);
+       %pC     pll1
+       %pCn    pll1
+       %pCr    1560000000
 
-s64 SHOULD be printed with %lld/%llx:
+       For printing struct clk structures. '%pC' and '%pCn' print the name
+       (Common Clock Framework) or address (legacy clock framework) of the
+       structure; '%pCr' prints the current clock rate.
 
-       printk("%lld", s64_var);
+       Passed by reference.
 
 bitmap and its derivatives such as cpumask and nodemask:
 
@@ -248,15 +282,7 @@ bitmap and its derivatives such as cpumask and nodemask:
        %*pb output the bitmap with field width as the number of bits and %*pbl
        output the bitmap as range list with field width as the number of bits.
 
-If <type> is dependent on a config option for its size (e.g., sector_t,
-blkcnt_t) or is architecture-dependent for its size (e.g., tcflag_t), use a
-format specifier of its largest possible type and explicitly cast to it.
-Example:
-
-       printk("test: sector number/total blocks: %llu/%llu\n",
-               (unsigned long long)sector, (unsigned long long)blockcount);
-
-Reminder: sizeof() result is of type size_t.
+       Passed by reference.
 
 Thank you for your cooperation and attention.