]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/net/arcnet/rfc1051.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
[karo-tx-linux.git] / drivers / net / arcnet / rfc1051.c
index 824d71fcfd5361f176846e3a8af5bfac60950657..4b1a75469cb10962f18f5958d94cb51fb51e18c9 100644 (file)
@@ -23,6 +23,9 @@
  *
  * **********************
  */
+
+#define pr_fmt(fmt) "arcnet:" KBUILD_MODNAME ": " fmt
+
 #include <linux/module.h>
 #include <linux/gfp.h>
 #include <linux/init.h>
@@ -30,9 +33,8 @@
 #include <net/arp.h>
 #include <linux/netdevice.h>
 #include <linux/skbuff.h>
-#include <linux/arcdevice.h>
 
-#define VERSION "arcnet: RFC1051 \"simple standard\" (`s') encapsulation support loaded.\n"
+#include "arcdevice.h"
 
 static __be16 type_trans(struct sk_buff *skb, struct net_device *dev);
 static void rx(struct net_device *dev, int bufnum,
@@ -55,7 +57,7 @@ static struct ArcProto rfc1051_proto = {
 
 static int __init arcnet_rfc1051_init(void)
 {
-       printk(VERSION);
+       pr_info("%s\n", "RFC1051 \"simple standard\" (`s') encapsulation support loaded");
 
        arc_proto_map[ARC_P_IP_RFC1051]
            = arc_proto_map[ARC_P_ARP_RFC1051]
@@ -124,7 +126,7 @@ static void rx(struct net_device *dev, int bufnum,
        struct archdr *pkt = pkthdr;
        int ofs;
 
-       BUGMSG(D_DURING, "it's a raw packet (length=%d)\n", length);
+       arc_printk(D_DURING, dev, "it's a raw packet (length=%d)\n", length);
 
        if (length >= MinTU)
                ofs = 512 - length;
@@ -132,8 +134,7 @@ static void rx(struct net_device *dev, int bufnum,
                ofs = 256 - length;
 
        skb = alloc_skb(length + ARC_HDR_SIZE, GFP_ATOMIC);
-       if (skb == NULL) {
-               BUGMSG(D_NORMAL, "Memory squeeze, dropping packet.\n");
+       if (!skb) {
                dev->stats.rx_dropped++;
                return;
        }
@@ -173,8 +174,8 @@ static int build_header(struct sk_buff *skb, struct net_device *dev,
                soft->proto = ARC_P_ARP_RFC1051;
                break;
        default:
-               BUGMSG(D_NORMAL, "RFC1051: I don't understand protocol %d (%Xh)\n",
-                      type, type);
+               arc_printk(D_NORMAL, dev, "RFC1051: I don't understand protocol %d (%Xh)\n",
+                          type, type);
                dev->stats.tx_errors++;
                dev->stats.tx_aborted_errors++;
                return 0;
@@ -210,15 +211,16 @@ static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length,
        struct arc_hardware *hard = &pkt->hard;
        int ofs;
 
-       BUGMSG(D_DURING, "prepare_tx: txbufs=%d/%d/%d\n",
-              lp->next_tx, lp->cur_tx, bufnum);
+       arc_printk(D_DURING, dev, "prepare_tx: txbufs=%d/%d/%d\n",
+                  lp->next_tx, lp->cur_tx, bufnum);
 
-       length -= ARC_HDR_SIZE; /* hard header is not included in packet length */
+       /* hard header is not included in packet length */
+       length -= ARC_HDR_SIZE;
 
        if (length > XMTU) {
                /* should never happen! other people already check for this. */
-               BUGMSG(D_NORMAL, "Bug!  prepare_tx with size %d (> %d)\n",
-                      length, XMTU);
+               arc_printk(D_NORMAL, dev, "Bug!  prepare_tx with size %d (> %d)\n",
+                          length, XMTU);
                length = XMTU;
        }
        if (length > MinTU) {