treewide: Use pr_fmt and pr_<level>
authorJoe Perches <joe@perches.com>
Mon, 30 Aug 2010 07:24:54 +0000 (00:24 -0700)
committerJesse Gross <jesse@nicira.com>
Mon, 30 Aug 2010 20:23:08 +0000 (13:23 -0700)
Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Simon Horman <horms@verge.net.au>
[Jesse: Added missing pr_fmt in vport-gre.c and dp_sysfs_dp.c]
Signed-off-by: Jesse Gross <jesse@nicira.com>
datapath/brc_procfs.c
datapath/brcompat.c
datapath/datapath.c
datapath/dp_sysfs_dp.c
datapath/linux-2.6/compat-2.6/skbuff-openvswitch.c
datapath/vport-capwap.c
datapath/vport-gre.c
datapath/vport.c

index cfe0175b3e57c327832ec141eb0de35da853abcb..bf328c9b8d264c10da549689077723b6b6508224 100644 (file)
@@ -6,6 +6,8 @@
  * kernel, by Linus Torvalds and others.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/netdevice.h>
@@ -69,9 +71,9 @@ static struct proc_dir_entry *brc_open_dir(const char *dir_name,
        if (!*dirp) {
                struct proc_dir_entry *dir;
                if (brc_lookup_entry(parent, dir_name)) {
-                       printk(KERN_WARNING "%s proc directory exists, can't "
-                              "simulate--probably its real module is "
-                              "loaded\n", dir_name);
+                       pr_warn("%s proc directory exists, can't simulate--"
+                               "probably its real module is loaded\n",
+                               dir_name);
                        return NULL;
                }
                dir = *dirp = proc_mkdir(dir_name, parent);
index f68b698c47b4d8d95228a1fe42293a9585910ff2..3e840115427af7a3f29644a550349c2b5218f3f0 100644 (file)
@@ -6,6 +6,8 @@
  * kernel, by Linus Torvalds and others.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/kernel.h>
 #include <asm/uaccess.h>
 #include <linux/completion.h>
@@ -481,7 +483,7 @@ static struct sk_buff *brc_send_command(struct sk_buff *request,
        /* Wait for reply. */
        error = -ETIMEDOUT;
        if (!wait_for_completion_timeout(&brc_done, BRC_TIMEOUT)) {
-               printk(KERN_WARNING "brcompat: timed out waiting for userspace\n");
+               pr_warn("timed out waiting for userspace\n");
                goto error;
     }
 
@@ -551,7 +553,7 @@ static int __init brc_init(void)
 err_unregister:
        genl_unregister_family(&brc_genl_family);
 error:
-       printk(KERN_EMERG "brcompat: failed to install!");
+       pr_emerg("failed to install!\n");
        return err;
 }
 
index 4f15ea0ca8f744d6eee41e767ef06a928fd417e6..5ee915740db43a40df31a54b2eac7b25913b9171 100644 (file)
@@ -8,6 +8,8 @@
 
 /* Functions for managing the dp interface/device. */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/fs.h>
@@ -531,8 +533,8 @@ out:
 static void suppress_loop(struct datapath *dp, struct sw_flow_actions *actions)
 {
        if (net_ratelimit())
-               printk(KERN_WARNING "%s: flow looped %d times, dropping\n",
-                      dp_name(dp), DP_MAX_LOOPS);
+               pr_warn("%s: flow looped %d times, dropping\n",
+                       dp_name(dp), DP_MAX_LOOPS);
        actions->n_actions = 0;
 }
 
@@ -645,9 +647,9 @@ int vswitch_skb_checksum_setup(struct sk_buff *skb)
                break;
        default:
                if (net_ratelimit())
-                       printk(KERN_ERR "Attempting to checksum a non-"
-                              "TCP/UDP packet, dropping a protocol"
-                              " %d packet", iph->protocol);
+                       pr_err("Attempting to checksum a non-TCP/UDP packet, "
+                              "dropping a protocol %d packet",
+                              iph->protocol);
                goto out;
        }
 
@@ -750,8 +752,7 @@ void compute_ip_summed(struct sk_buff *skb, bool xmit)
                break;
 #endif
        default:
-               printk(KERN_ERR "openvswitch: unknown checksum type %d\n",
-                      skb->ip_summed);
+               pr_err("unknown checksum type %d\n", skb->ip_summed);
                /* None seems the safest... */
                OVS_CB(skb)->ip_summed = OVS_CSUM_NONE;
        }
index 9f0c0adb1e376c61ee495f0c35179e8e4c705544..4abe4fb6338f58c4942e675da2da19f82f6d4ebe 100644 (file)
@@ -6,6 +6,8 @@
  * kernel, by Linus Torvalds and others.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/version.h>
 
 /*
index e639b5a183b44100909ee800126a4dd550503390..ef43ba90089cd4911d33a9cbd18dfab6c9bd710f 100644 (file)
@@ -1,12 +1,14 @@
 #if !defined(HAVE_SKB_WARN_LRO) && defined(NETIF_F_LRO)
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/netdevice.h>
 
 void __skb_warn_lro_forwarding(const struct sk_buff *skb)
 {
        if (net_ratelimit())
-               printk(KERN_WARNING "%s: received packets cannot be forwarded"
-                                   " while LRO is enabled\n", skb->dev->name);
+               pr_warn("%s: received packets cannot be forwarded while LRO is enabled\n",
+                       skb->dev->name);
 }
 
 #endif
index 59fb05100a085535f1c2da6d6b2a02dd9f041ead..ce8cc43e24bb277b58a6db714a8f7fedc9a01d36 100644 (file)
@@ -6,6 +6,8 @@
  * kernel, by Linus Torvalds and others.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/version.h>
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)
 
@@ -160,7 +162,7 @@ static inline struct sk_buff *process_capwap_proto(struct sk_buff *skb)
                return defrag(skb, true);
        else {
                if (net_ratelimit())
-                       printk(KERN_WARNING "openvswitch: unparsable packet receive on capwap socket\n");
+                       pr_warn("unparsable packet receive on capwap socket\n");
 
                kfree_skb(skb);
                return NULL;
@@ -243,7 +245,7 @@ static int capwap_init(void)
 error_sock:
        sock_release(capwap_rcv_socket);
 error:
-       printk(KERN_WARNING "openvswitch: cannot register capwap protocol handler\n");
+       pr_warn("cannot register capwap protocol handler\n");
        return err;
 }
 
@@ -288,7 +290,7 @@ static struct sk_buff *fragment(struct sk_buff *skb, const struct vport *vport,
 
        if (hlen + ~FRAG_OFF_MASK + 1 > dst_mtu(dst)) {
                if (net_ratelimit())
-                       printk(KERN_WARNING "openvswitch: capwap link mtu (%d) is less than minimum packet (%d)\n",
+                       pr_warn("capwap link mtu (%d) is less than minimum packet (%d)\n",
                                dst_mtu(dst), hlen + ~FRAG_OFF_MASK + 1);
                goto error;
        }
index 223644e27194fecbe8e918300554102d765816c0..0a7092f96646c885a4920acaeb2a570b8c60d857 100644 (file)
@@ -6,6 +6,8 @@
  * kernel, by Linus Torvalds and others.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/if.h>
 #include <linux/skbuff.h>
 #include <linux/ip.h>
@@ -345,7 +347,7 @@ static int gre_init(void)
 
        err = inet_add_protocol(&gre_protocol_handlers, IPPROTO_GRE);
        if (err) {
-               printk(KERN_WARNING "openvswitch: cannot register gre protocol handler\n");
+               pr_warn("cannot register gre protocol handler\n");
                goto out;
        }
 
index 4dd6cfe9e0e0a1f1e615f715f00b7f150d15d1c9..91b650e54695f751b26dcec98e526b8282eb2159 100644 (file)
@@ -6,6 +6,8 @@
  * kernel, by Linus Torvalds and others.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/dcache.h>
 #include <linux/etherdevice.h>
 #include <linux/if.h>
@@ -76,13 +78,14 @@ void vport_unlock(void)
        mutex_unlock(&vport_mutex);
 }
 
-#define ASSERT_VPORT() do { \
-       if (unlikely(!mutex_is_locked(&vport_mutex))) { \
-               printk(KERN_ERR "openvswitch: vport lock not held at %s (%d)\n", \
-                       __FILE__, __LINE__); \
-               dump_stack(); \
-       } \
-} while(0)
+#define ASSERT_VPORT()                                         \
+do {                                                           \
+       if (unlikely(!mutex_is_locked(&vport_mutex))) {         \
+               pr_err("vport lock not held at %s (%d)\n",      \
+                      __FILE__, __LINE__);                     \
+               dump_stack();                                   \
+       }                                                       \
+} while (0)
 
 /**
  *     vport_init - initialize vport subsystem
@@ -616,7 +619,7 @@ struct vport *vport_locate(const char *name)
        struct hlist_node *node;
 
        if (unlikely(!mutex_is_locked(&vport_mutex) && !rtnl_is_locked())) {
-               printk(KERN_ERR "openvswitch: neither RTNL nor vport lock held in vport_locate\n");
+               pr_err("neither RTNL nor vport lock held in vport_locate\n");
                dump_stack();
        }
 
@@ -1247,8 +1250,9 @@ int vport_send(struct vport *vport, struct sk_buff *skb)
        mtu = vport_get_mtu(vport);
        if (unlikely(packet_length(skb) > mtu && !skb_is_gso(skb))) {
                if (net_ratelimit())
-                       printk(KERN_WARNING "%s: dropped over-mtu packet: %d > %d\n",
-                              dp_name(vport_get_dp_port(vport)->dp), packet_length(skb), mtu);
+                       pr_warn("%s: dropped over-mtu packet: %d > %d\n",
+                               dp_name(vport_get_dp_port(vport)->dp),
+                               packet_length(skb), mtu);
                goto error;
        }