From: Joe Perches Date: Mon, 30 Aug 2010 07:24:54 +0000 (-0700) Subject: treewide: Use pr_fmt and pr_ X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dfffaef1eb2c0156432a3cf203fd8348651da912;p=openvswitch treewide: Use pr_fmt and pr_ Signed-off-by: Joe Perches Acked-by: Simon Horman [Jesse: Added missing pr_fmt in vport-gre.c and dp_sysfs_dp.c] Signed-off-by: Jesse Gross --- diff --git a/datapath/brc_procfs.c b/datapath/brc_procfs.c index cfe0175b..bf328c9b 100644 --- a/datapath/brc_procfs.c +++ b/datapath/brc_procfs.c @@ -6,6 +6,8 @@ * kernel, by Linus Torvalds and others. */ +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + #include #include #include @@ -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); diff --git a/datapath/brcompat.c b/datapath/brcompat.c index f68b698c..3e840115 100644 --- a/datapath/brcompat.c +++ b/datapath/brcompat.c @@ -6,6 +6,8 @@ * kernel, by Linus Torvalds and others. */ +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + #include #include #include @@ -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; } diff --git a/datapath/datapath.c b/datapath/datapath.c index 4f15ea0c..5ee91574 100644 --- a/datapath/datapath.c +++ b/datapath/datapath.c @@ -8,6 +8,8 @@ /* Functions for managing the dp interface/device. */ +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + #include #include #include @@ -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; } diff --git a/datapath/dp_sysfs_dp.c b/datapath/dp_sysfs_dp.c index 9f0c0adb..4abe4fb6 100644 --- a/datapath/dp_sysfs_dp.c +++ b/datapath/dp_sysfs_dp.c @@ -6,6 +6,8 @@ * kernel, by Linus Torvalds and others. */ +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + #include /* diff --git a/datapath/linux-2.6/compat-2.6/skbuff-openvswitch.c b/datapath/linux-2.6/compat-2.6/skbuff-openvswitch.c index e639b5a1..ef43ba90 100644 --- a/datapath/linux-2.6/compat-2.6/skbuff-openvswitch.c +++ b/datapath/linux-2.6/compat-2.6/skbuff-openvswitch.c @@ -1,12 +1,14 @@ #if !defined(HAVE_SKB_WARN_LRO) && defined(NETIF_F_LRO) +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + #include 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 diff --git a/datapath/vport-capwap.c b/datapath/vport-capwap.c index 59fb0510..ce8cc43e 100644 --- a/datapath/vport-capwap.c +++ b/datapath/vport-capwap.c @@ -6,6 +6,8 @@ * kernel, by Linus Torvalds and others. */ +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + #include #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; } diff --git a/datapath/vport-gre.c b/datapath/vport-gre.c index 223644e2..0a7092f9 100644 --- a/datapath/vport-gre.c +++ b/datapath/vport-gre.c @@ -6,6 +6,8 @@ * kernel, by Linus Torvalds and others. */ +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + #include #include #include @@ -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; } diff --git a/datapath/vport.c b/datapath/vport.c index 4dd6cfe9..91b650e5 100644 --- a/datapath/vport.c +++ b/datapath/vport.c @@ -6,6 +6,8 @@ * kernel, by Linus Torvalds and others. */ +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + #include #include #include @@ -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; }