* [PATCH 1/3] tun: Convert logging messages to pr_<level> and tun_debug
@ 2011-03-02 17:18 Joe Perches
2011-03-02 17:18 ` [PATCH 2/3] mii: Convert printks to netdev_info Joe Perches
` (2 more replies)
0 siblings, 3 replies; 13+ messages in thread
From: Joe Perches @ 2011-03-02 17:18 UTC (permalink / raw)
To: netdev
Use the current logging forms with pr_fmt.
Convert DBG macro to tun_debug, use netdev_printk as well.
Add printf verification when TUN_DEBUG not defined.
Miscellaneous comment typo fix.
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/tun.c | 83 ++++++++++++++++++++++++++++++++--------------------
1 files changed, 51 insertions(+), 32 deletions(-)
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 55786a0..f5e9ac0 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -34,6 +34,8 @@
* Modifications for 2.3.99-pre5 kernel.
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#define DRV_NAME "tun"
#define DRV_VERSION "1.6"
#define DRV_DESCRIPTION "Universal TUN/TAP device driver"
@@ -76,11 +78,27 @@
#ifdef TUN_DEBUG
static int debug;
-#define DBG if(tun->debug)printk
-#define DBG1 if(debug==2)printk
+#define tun_debug(level, tun, fmt, args...) \
+do { \
+ if (tun->debug) \
+ netdev_printk(level, tun->dev, fmt, ##args); \
+} while (0)
+#define DBG1(level, fmt, args...) \
+do { \
+ if (debug == 2) \
+ printk(level fmt, ##args); \
+} while (0)
#else
-#define DBG( a... )
-#define DBG1( a... )
+#define tun_debug(level, tun, fmt, args...) \
+do { \
+ if (0) \
+ netdev_printk(level, tun->dev, fmt, ##args); \
+} while (0)
+#define DBG1(level, fmt, args...) \
+do { \
+ if (0) \
+ printk(level fmt, ##args); \
+} while (0)
#endif
#define FLT_EXACT_COUNT 8
@@ -205,7 +223,7 @@ static void tun_put(struct tun_struct *tun)
tun_detach(tfile->tun);
}
-/* TAP filterting */
+/* TAP filtering */
static void addr_hash_set(u32 *mask, const u8 *addr)
{
int n = ether_crc(ETH_ALEN, addr) >> 26;
@@ -360,7 +378,7 @@ static netdev_tx_t tun_net_xmit(struct sk_buff *skb, struct net_device *dev)
{
struct tun_struct *tun = netdev_priv(dev);
- DBG(KERN_INFO "%s: tun_net_xmit %d\n", tun->dev->name, skb->len);
+ tun_debug(KERN_INFO, tun, "tun_net_xmit %d\n", skb->len);
/* Drop packet if interface is not attached */
if (!tun->tfile)
@@ -499,7 +517,7 @@ static unsigned int tun_chr_poll(struct file *file, poll_table * wait)
sk = tun->socket.sk;
- DBG(KERN_INFO "%s: tun_chr_poll\n", tun->dev->name);
+ tun_debug(KERN_INFO, tun, "tun_chr_poll\n");
poll_wait(file, &tun->wq.wait, wait);
@@ -690,7 +708,7 @@ static ssize_t tun_chr_aio_write(struct kiocb *iocb, const struct iovec *iv,
if (!tun)
return -EBADFD;
- DBG(KERN_INFO "%s: tun_chr_write %ld\n", tun->dev->name, count);
+ tun_debug(KERN_INFO, tun, "tun_chr_write %ld\n", count);
result = tun_get_user(tun, iv, iov_length(iv, count),
file->f_flags & O_NONBLOCK);
@@ -739,7 +757,7 @@ static __inline__ ssize_t tun_put_user(struct tun_struct *tun,
else if (sinfo->gso_type & SKB_GSO_UDP)
gso.gso_type = VIRTIO_NET_HDR_GSO_UDP;
else {
- printk(KERN_ERR "tun: unexpected GSO type: "
+ pr_err("unexpected GSO type: "
"0x%x, gso_size %d, hdr_len %d\n",
sinfo->gso_type, gso.gso_size,
gso.hdr_len);
@@ -786,7 +804,7 @@ static ssize_t tun_do_read(struct tun_struct *tun,
struct sk_buff *skb;
ssize_t ret = 0;
- DBG(KERN_INFO "%s: tun_chr_read\n", tun->dev->name);
+ tun_debug(KERN_INFO, tun, "tun_chr_read\n");
add_wait_queue(&tun->wq.wait, &wait);
while (len) {
@@ -1083,7 +1101,7 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)
if (device_create_file(&tun->dev->dev, &dev_attr_tun_flags) ||
device_create_file(&tun->dev->dev, &dev_attr_owner) ||
device_create_file(&tun->dev->dev, &dev_attr_group))
- printk(KERN_ERR "Failed to create tun sysfs files\n");
+ pr_err("Failed to create tun sysfs files\n");
sk->sk_destruct = tun_sock_destruct;
@@ -1092,7 +1110,7 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)
goto failed;
}
- DBG(KERN_INFO "%s: tun_set_iff\n", tun->dev->name);
+ tun_debug(KERN_INFO, tun, "tun_set_iff\n");
if (ifr->ifr_flags & IFF_NO_PI)
tun->flags |= TUN_NO_PI;
@@ -1129,7 +1147,7 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)
static int tun_get_iff(struct net *net, struct tun_struct *tun,
struct ifreq *ifr)
{
- DBG(KERN_INFO "%s: tun_get_iff\n", tun->dev->name);
+ tun_debug(KERN_INFO, tun, "tun_get_iff\n");
strcpy(ifr->ifr_name, tun->dev->name);
@@ -1229,7 +1247,7 @@ static long __tun_chr_ioctl(struct file *file, unsigned int cmd,
if (!tun)
goto unlock;
- DBG(KERN_INFO "%s: tun_chr_ioctl cmd %d\n", tun->dev->name, cmd);
+ tun_debug(KERN_INFO, tun, "tun_chr_ioctl cmd %d\n", cmd);
ret = 0;
switch (cmd) {
@@ -1249,8 +1267,8 @@ static long __tun_chr_ioctl(struct file *file, unsigned int cmd,
else
tun->flags &= ~TUN_NOCHECKSUM;
- DBG(KERN_INFO "%s: checksum %s\n",
- tun->dev->name, arg ? "disabled" : "enabled");
+ tun_debug(KERN_INFO, tun, "checksum %s\n",
+ arg ? "disabled" : "enabled");
break;
case TUNSETPERSIST:
@@ -1260,33 +1278,34 @@ static long __tun_chr_ioctl(struct file *file, unsigned int cmd,
else
tun->flags &= ~TUN_PERSIST;
- DBG(KERN_INFO "%s: persist %s\n",
- tun->dev->name, arg ? "enabled" : "disabled");
+ tun_debug(KERN_INFO, tun, "persist %s\n",
+ arg ? "enabled" : "disabled");
break;
case TUNSETOWNER:
/* Set owner of the device */
tun->owner = (uid_t) arg;
- DBG(KERN_INFO "%s: owner set to %d\n", tun->dev->name, tun->owner);
+ tun_debug(KERN_INFO, tun, "owner set to %d\n", tun->owner);
break;
case TUNSETGROUP:
/* Set group of the device */
tun->group= (gid_t) arg;
- DBG(KERN_INFO "%s: group set to %d\n", tun->dev->name, tun->group);
+ tun_debug(KERN_INFO, tun, "group set to %d\n", tun->group);
break;
case TUNSETLINK:
/* Only allow setting the type when the interface is down */
if (tun->dev->flags & IFF_UP) {
- DBG(KERN_INFO "%s: Linktype set failed because interface is up\n",
- tun->dev->name);
+ tun_debug(KERN_INFO, tun,
+ "Linktype set failed because interface is up\n");
ret = -EBUSY;
} else {
tun->dev->type = (int) arg;
- DBG(KERN_INFO "%s: linktype set to %d\n", tun->dev->name, tun->dev->type);
+ tun_debug(KERN_INFO, tun, "linktype set to %d\n",
+ tun->dev->type);
ret = 0;
}
break;
@@ -1318,8 +1337,8 @@ static long __tun_chr_ioctl(struct file *file, unsigned int cmd,
case SIOCSIFHWADDR:
/* Set hw address */
- DBG(KERN_DEBUG "%s: set hw address: %pM\n",
- tun->dev->name, ifr.ifr_hwaddr.sa_data);
+ tun_debug(KERN_DEBUG, tun, "set hw address: %pM\n",
+ ifr.ifr_hwaddr.sa_data);
ret = dev_set_mac_address(tun->dev, &ifr.ifr_hwaddr);
break;
@@ -1433,7 +1452,7 @@ static int tun_chr_fasync(int fd, struct file *file, int on)
if (!tun)
return -EBADFD;
- DBG(KERN_INFO "%s: tun_chr_fasync %d\n", tun->dev->name, on);
+ tun_debug(KERN_INFO, tun, "tun_chr_fasync %d\n", on);
if ((ret = fasync_helper(fd, file, on, &tun->fasync)) < 0)
goto out;
@@ -1455,7 +1474,7 @@ static int tun_chr_open(struct inode *inode, struct file * file)
{
struct tun_file *tfile;
- DBG1(KERN_INFO "tunX: tun_chr_open\n");
+ DBG1(KERN_INFO, "tunX: tun_chr_open\n");
tfile = kmalloc(sizeof(*tfile), GFP_KERNEL);
if (!tfile)
@@ -1476,7 +1495,7 @@ static int tun_chr_close(struct inode *inode, struct file *file)
if (tun) {
struct net_device *dev = tun->dev;
- DBG(KERN_INFO "%s: tun_chr_close\n", dev->name);
+ tun_debug(KERN_INFO, tun, "tun_chr_close\n");
__tun_detach(tun);
@@ -1607,18 +1626,18 @@ static int __init tun_init(void)
{
int ret = 0;
- printk(KERN_INFO "tun: %s, %s\n", DRV_DESCRIPTION, DRV_VERSION);
- printk(KERN_INFO "tun: %s\n", DRV_COPYRIGHT);
+ pr_info("%s, %s\n", DRV_DESCRIPTION, DRV_VERSION);
+ pr_info("%s\n", DRV_COPYRIGHT);
ret = rtnl_link_register(&tun_link_ops);
if (ret) {
- printk(KERN_ERR "tun: Can't register link_ops\n");
+ pr_err("Can't register link_ops\n");
goto err_linkops;
}
ret = misc_register(&tun_miscdev);
if (ret) {
- printk(KERN_ERR "tun: Can't register misc device %d\n", TUN_MINOR);
+ pr_err("Can't register misc device %d\n", TUN_MINOR);
goto err_misc;
}
return 0;
--
1.7.4.2.g597a6.dirty
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 2/3] mii: Convert printks to netdev_info
2011-03-02 17:18 [PATCH 1/3] tun: Convert logging messages to pr_<level> and tun_debug Joe Perches
@ 2011-03-02 17:18 ` Joe Perches
2011-03-03 20:21 ` David Miller
2011-03-02 17:18 ` [PATCH 3/3] eql: Convert printks to pr_<level> and netdev_<level> Joe Perches
2011-03-03 20:21 ` [PATCH 1/3] tun: Convert logging messages to pr_<level> and tun_debug David Miller
2 siblings, 1 reply; 13+ messages in thread
From: Joe Perches @ 2011-03-02 17:18 UTC (permalink / raw)
To: netdev
Add a bit more data to the output.
Convert string speeds to integer.
Object size reduced a tiny bit.
$ size drivers/net/mii.o*
text data bss dec hex filename
4155 56 1000 5211 145b drivers/net/mii.o.new
4184 56 1000 5240 1478 drivers/net/mii.o.old
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/tun.c | 83 ++++++++++++++++++++--------------------------------
1 files changed, 32 insertions(+), 51 deletions(-)
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index f5e9ac0..55786a0 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -34,8 +34,6 @@
* Modifications for 2.3.99-pre5 kernel.
*/
-#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-
#define DRV_NAME "tun"
#define DRV_VERSION "1.6"
#define DRV_DESCRIPTION "Universal TUN/TAP device driver"
@@ -78,27 +76,11 @@
#ifdef TUN_DEBUG
static int debug;
-#define tun_debug(level, tun, fmt, args...) \
-do { \
- if (tun->debug) \
- netdev_printk(level, tun->dev, fmt, ##args); \
-} while (0)
-#define DBG1(level, fmt, args...) \
-do { \
- if (debug == 2) \
- printk(level fmt, ##args); \
-} while (0)
+#define DBG if(tun->debug)printk
+#define DBG1 if(debug==2)printk
#else
-#define tun_debug(level, tun, fmt, args...) \
-do { \
- if (0) \
- netdev_printk(level, tun->dev, fmt, ##args); \
-} while (0)
-#define DBG1(level, fmt, args...) \
-do { \
- if (0) \
- printk(level fmt, ##args); \
-} while (0)
+#define DBG( a... )
+#define DBG1( a... )
#endif
#define FLT_EXACT_COUNT 8
@@ -223,7 +205,7 @@ static void tun_put(struct tun_struct *tun)
tun_detach(tfile->tun);
}
-/* TAP filtering */
+/* TAP filterting */
static void addr_hash_set(u32 *mask, const u8 *addr)
{
int n = ether_crc(ETH_ALEN, addr) >> 26;
@@ -378,7 +360,7 @@ static netdev_tx_t tun_net_xmit(struct sk_buff *skb, struct net_device *dev)
{
struct tun_struct *tun = netdev_priv(dev);
- tun_debug(KERN_INFO, tun, "tun_net_xmit %d\n", skb->len);
+ DBG(KERN_INFO "%s: tun_net_xmit %d\n", tun->dev->name, skb->len);
/* Drop packet if interface is not attached */
if (!tun->tfile)
@@ -517,7 +499,7 @@ static unsigned int tun_chr_poll(struct file *file, poll_table * wait)
sk = tun->socket.sk;
- tun_debug(KERN_INFO, tun, "tun_chr_poll\n");
+ DBG(KERN_INFO "%s: tun_chr_poll\n", tun->dev->name);
poll_wait(file, &tun->wq.wait, wait);
@@ -708,7 +690,7 @@ static ssize_t tun_chr_aio_write(struct kiocb *iocb, const struct iovec *iv,
if (!tun)
return -EBADFD;
- tun_debug(KERN_INFO, tun, "tun_chr_write %ld\n", count);
+ DBG(KERN_INFO "%s: tun_chr_write %ld\n", tun->dev->name, count);
result = tun_get_user(tun, iv, iov_length(iv, count),
file->f_flags & O_NONBLOCK);
@@ -757,7 +739,7 @@ static __inline__ ssize_t tun_put_user(struct tun_struct *tun,
else if (sinfo->gso_type & SKB_GSO_UDP)
gso.gso_type = VIRTIO_NET_HDR_GSO_UDP;
else {
- pr_err("unexpected GSO type: "
+ printk(KERN_ERR "tun: unexpected GSO type: "
"0x%x, gso_size %d, hdr_len %d\n",
sinfo->gso_type, gso.gso_size,
gso.hdr_len);
@@ -804,7 +786,7 @@ static ssize_t tun_do_read(struct tun_struct *tun,
struct sk_buff *skb;
ssize_t ret = 0;
- tun_debug(KERN_INFO, tun, "tun_chr_read\n");
+ DBG(KERN_INFO "%s: tun_chr_read\n", tun->dev->name);
add_wait_queue(&tun->wq.wait, &wait);
while (len) {
@@ -1101,7 +1083,7 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)
if (device_create_file(&tun->dev->dev, &dev_attr_tun_flags) ||
device_create_file(&tun->dev->dev, &dev_attr_owner) ||
device_create_file(&tun->dev->dev, &dev_attr_group))
- pr_err("Failed to create tun sysfs files\n");
+ printk(KERN_ERR "Failed to create tun sysfs files\n");
sk->sk_destruct = tun_sock_destruct;
@@ -1110,7 +1092,7 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)
goto failed;
}
- tun_debug(KERN_INFO, tun, "tun_set_iff\n");
+ DBG(KERN_INFO "%s: tun_set_iff\n", tun->dev->name);
if (ifr->ifr_flags & IFF_NO_PI)
tun->flags |= TUN_NO_PI;
@@ -1147,7 +1129,7 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)
static int tun_get_iff(struct net *net, struct tun_struct *tun,
struct ifreq *ifr)
{
- tun_debug(KERN_INFO, tun, "tun_get_iff\n");
+ DBG(KERN_INFO "%s: tun_get_iff\n", tun->dev->name);
strcpy(ifr->ifr_name, tun->dev->name);
@@ -1247,7 +1229,7 @@ static long __tun_chr_ioctl(struct file *file, unsigned int cmd,
if (!tun)
goto unlock;
- tun_debug(KERN_INFO, tun, "tun_chr_ioctl cmd %d\n", cmd);
+ DBG(KERN_INFO "%s: tun_chr_ioctl cmd %d\n", tun->dev->name, cmd);
ret = 0;
switch (cmd) {
@@ -1267,8 +1249,8 @@ static long __tun_chr_ioctl(struct file *file, unsigned int cmd,
else
tun->flags &= ~TUN_NOCHECKSUM;
- tun_debug(KERN_INFO, tun, "checksum %s\n",
- arg ? "disabled" : "enabled");
+ DBG(KERN_INFO "%s: checksum %s\n",
+ tun->dev->name, arg ? "disabled" : "enabled");
break;
case TUNSETPERSIST:
@@ -1278,34 +1260,33 @@ static long __tun_chr_ioctl(struct file *file, unsigned int cmd,
else
tun->flags &= ~TUN_PERSIST;
- tun_debug(KERN_INFO, tun, "persist %s\n",
- arg ? "enabled" : "disabled");
+ DBG(KERN_INFO "%s: persist %s\n",
+ tun->dev->name, arg ? "enabled" : "disabled");
break;
case TUNSETOWNER:
/* Set owner of the device */
tun->owner = (uid_t) arg;
- tun_debug(KERN_INFO, tun, "owner set to %d\n", tun->owner);
+ DBG(KERN_INFO "%s: owner set to %d\n", tun->dev->name, tun->owner);
break;
case TUNSETGROUP:
/* Set group of the device */
tun->group= (gid_t) arg;
- tun_debug(KERN_INFO, tun, "group set to %d\n", tun->group);
+ DBG(KERN_INFO "%s: group set to %d\n", tun->dev->name, tun->group);
break;
case TUNSETLINK:
/* Only allow setting the type when the interface is down */
if (tun->dev->flags & IFF_UP) {
- tun_debug(KERN_INFO, tun,
- "Linktype set failed because interface is up\n");
+ DBG(KERN_INFO "%s: Linktype set failed because interface is up\n",
+ tun->dev->name);
ret = -EBUSY;
} else {
tun->dev->type = (int) arg;
- tun_debug(KERN_INFO, tun, "linktype set to %d\n",
- tun->dev->type);
+ DBG(KERN_INFO "%s: linktype set to %d\n", tun->dev->name, tun->dev->type);
ret = 0;
}
break;
@@ -1337,8 +1318,8 @@ static long __tun_chr_ioctl(struct file *file, unsigned int cmd,
case SIOCSIFHWADDR:
/* Set hw address */
- tun_debug(KERN_DEBUG, tun, "set hw address: %pM\n",
- ifr.ifr_hwaddr.sa_data);
+ DBG(KERN_DEBUG "%s: set hw address: %pM\n",
+ tun->dev->name, ifr.ifr_hwaddr.sa_data);
ret = dev_set_mac_address(tun->dev, &ifr.ifr_hwaddr);
break;
@@ -1452,7 +1433,7 @@ static int tun_chr_fasync(int fd, struct file *file, int on)
if (!tun)
return -EBADFD;
- tun_debug(KERN_INFO, tun, "tun_chr_fasync %d\n", on);
+ DBG(KERN_INFO "%s: tun_chr_fasync %d\n", tun->dev->name, on);
if ((ret = fasync_helper(fd, file, on, &tun->fasync)) < 0)
goto out;
@@ -1474,7 +1455,7 @@ static int tun_chr_open(struct inode *inode, struct file * file)
{
struct tun_file *tfile;
- DBG1(KERN_INFO, "tunX: tun_chr_open\n");
+ DBG1(KERN_INFO "tunX: tun_chr_open\n");
tfile = kmalloc(sizeof(*tfile), GFP_KERNEL);
if (!tfile)
@@ -1495,7 +1476,7 @@ static int tun_chr_close(struct inode *inode, struct file *file)
if (tun) {
struct net_device *dev = tun->dev;
- tun_debug(KERN_INFO, tun, "tun_chr_close\n");
+ DBG(KERN_INFO "%s: tun_chr_close\n", dev->name);
__tun_detach(tun);
@@ -1626,18 +1607,18 @@ static int __init tun_init(void)
{
int ret = 0;
- pr_info("%s, %s\n", DRV_DESCRIPTION, DRV_VERSION);
- pr_info("%s\n", DRV_COPYRIGHT);
+ printk(KERN_INFO "tun: %s, %s\n", DRV_DESCRIPTION, DRV_VERSION);
+ printk(KERN_INFO "tun: %s\n", DRV_COPYRIGHT);
ret = rtnl_link_register(&tun_link_ops);
if (ret) {
- pr_err("Can't register link_ops\n");
+ printk(KERN_ERR "tun: Can't register link_ops\n");
goto err_linkops;
}
ret = misc_register(&tun_miscdev);
if (ret) {
- pr_err("Can't register misc device %d\n", TUN_MINOR);
+ printk(KERN_ERR "tun: Can't register misc device %d\n", TUN_MINOR);
goto err_misc;
}
return 0;
--
1.7.4.2.g597a6.dirty
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH 2/3] mii: Convert printks to netdev_info
2011-03-02 17:18 ` [PATCH 2/3] mii: Convert printks to netdev_info Joe Perches
@ 2011-03-03 20:21 ` David Miller
2011-03-03 20:29 ` Joe Perches
0 siblings, 1 reply; 13+ messages in thread
From: David Miller @ 2011-03-03 20:21 UTC (permalink / raw)
To: joe; +Cc: netdev
From: Joe Perches <joe@perches.com>
Date: Wed, 2 Mar 2011 09:18:11 -0800
> Add a bit more data to the output.
> Convert string speeds to integer.
> Object size reduced a tiny bit.
>
> $ size drivers/net/mii.o*
> text data bss dec hex filename
> 4155 56 1000 5211 145b drivers/net/mii.o.new
> 4184 56 1000 5240 1478 drivers/net/mii.o.old
>
> Signed-off-by: Joe Perches <joe@perches.com>
Applied.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 2/3] mii: Convert printks to netdev_info
2011-03-03 20:21 ` David Miller
@ 2011-03-03 20:29 ` Joe Perches
2011-03-03 20:32 ` David Miller
0 siblings, 1 reply; 13+ messages in thread
From: Joe Perches @ 2011-03-03 20:29 UTC (permalink / raw)
To: David Miller; +Cc: netdev
On Thu, 2011-03-03 at 12:21 -0800, David Miller wrote:
> From: Joe Perches <joe@perches.com>
> > Add a bit more data to the output.
> > Convert string speeds to integer.
> > Object size reduced a tiny bit.
> > $ size drivers/net/mii.o*
> > text data bss dec hex filename
> > 4155 56 1000 5211 145b drivers/net/mii.o.new
> > 4184 56 1000 5240 1478 drivers/net/mii.o.old
> > Signed-off-by: Joe Perches <joe@perches.com>
> Applied.
David, please don't push this yet.
This change is stuffed up somehow, it's
a reversion of the tun.c change.
Let me send you a new/correct patch right now.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 2/3] mii: Convert printks to netdev_info
2011-03-03 20:29 ` Joe Perches
@ 2011-03-03 20:32 ` David Miller
2011-03-03 20:46 ` [PATCH 2/3 v2] " Joe Perches
0 siblings, 1 reply; 13+ messages in thread
From: David Miller @ 2011-03-03 20:32 UTC (permalink / raw)
To: joe; +Cc: netdev
From: Joe Perches <joe@perches.com>
Date: Thu, 03 Mar 2011 12:29:41 -0800
> On Thu, 2011-03-03 at 12:21 -0800, David Miller wrote:
>> From: Joe Perches <joe@perches.com>
>> > Add a bit more data to the output.
>> > Convert string speeds to integer.
>> > Object size reduced a tiny bit.
>> > $ size drivers/net/mii.o*
>> > text data bss dec hex filename
>> > 4155 56 1000 5211 145b drivers/net/mii.o.new
>> > 4184 56 1000 5240 1478 drivers/net/mii.o.old
>> > Signed-off-by: Joe Perches <joe@perches.com>
>> Applied.
>
> David, please don't push this yet.
Reverted.
> This change is stuffed up somehow, it's
> a reversion of the tun.c change.
Oops.
> Let me send you a new/correct patch right now.
Ok.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 2/3 v2] mii: Convert printks to netdev_info
2011-03-03 20:32 ` David Miller
@ 2011-03-03 20:46 ` Joe Perches
2011-03-03 20:56 ` David Miller
0 siblings, 1 reply; 13+ messages in thread
From: Joe Perches @ 2011-03-03 20:46 UTC (permalink / raw)
To: David Miller; +Cc: netdev
Add a bit more data to the output.
Convert string speeds to integer.
Object size reduced a tiny bit.
$ size drivers/net/mii.o*
text data bss dec hex filename
4155 56 1000 5211 145b drivers/net/mii.o.new
4184 56 1000 5240 1478 drivers/net/mii.o.old
Signed-off-by: Joe Perches <joe@perches.com>
---
On Thu, 2011-03-03 at 12:32 -0800, David Miller wrote:
> > This change is stuffed up somehow, it's
> > a reversion of the tun.c change.
> Oops.
> > Let me send you a new/correct patch right now.
> Ok.
Sorry about that. Here's the appropriate patch.
It seems apparent I don't know how to use git properly.
I commited the change, then thought I should see
what the size difference was and add that to the
changelog.
I believe I did this:
<edits drivers/net/mii.c>
make drivers/net/mii.o
git commit -s drivers/net/mii.c
mv drivers/net/mii.o drivers/net/mii.o.new
git checkout master -- drivers/net/mii.c
make drivers/net/mii.o
mv drivers/net/mii.o drivers/net/mii.i.old
git checkout <branch> -- drivers/net/mii.c
size drivers/net/mii.o.*
etc...
git commit --amend drivers/net/mii.c (add etc...)
tun revert? No mii change? huh?
drivers/net/mii.c | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/net/mii.c b/drivers/net/mii.c
index 210b2b1..0a6c6a2 100644
--- a/drivers/net/mii.c
+++ b/drivers/net/mii.c
@@ -354,7 +354,7 @@ unsigned int mii_check_media (struct mii_if_info *mii,
if (!new_carrier) {
netif_carrier_off(mii->dev);
if (ok_to_print)
- printk(KERN_INFO "%s: link down\n", mii->dev->name);
+ netdev_info(mii->dev, "link down\n");
return 0; /* duplex did not change */
}
@@ -381,12 +381,12 @@ unsigned int mii_check_media (struct mii_if_info *mii,
duplex = 1;
if (ok_to_print)
- printk(KERN_INFO "%s: link up, %sMbps, %s-duplex, lpa 0x%04X\n",
- mii->dev->name,
- lpa2 & (LPA_1000FULL | LPA_1000HALF) ? "1000" :
- media & (ADVERTISE_100FULL | ADVERTISE_100HALF) ? "100" : "10",
- duplex ? "full" : "half",
- lpa);
+ netdev_info(mii->dev, "link up, %uMbps, %s-duplex, lpa 0x%04X\n",
+ lpa2 & (LPA_1000FULL | LPA_1000HALF) ? 1000 :
+ media & (ADVERTISE_100FULL | ADVERTISE_100HALF) ?
+ 100 : 10,
+ duplex ? "full" : "half",
+ lpa);
if ((init_media) || (mii->full_duplex != duplex)) {
mii->full_duplex = duplex;
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH 2/3 v2] mii: Convert printks to netdev_info
2011-03-03 20:46 ` [PATCH 2/3 v2] " Joe Perches
@ 2011-03-03 20:56 ` David Miller
0 siblings, 0 replies; 13+ messages in thread
From: David Miller @ 2011-03-03 20:56 UTC (permalink / raw)
To: joe; +Cc: netdev
From: Joe Perches <joe@perches.com>
Date: Thu, 03 Mar 2011 12:46:30 -0800
> Add a bit more data to the output.
> Convert string speeds to integer.
> Object size reduced a tiny bit.
> $ size drivers/net/mii.o*
> text data bss dec hex filename
> 4155 56 1000 5211 145b drivers/net/mii.o.new
> 4184 56 1000 5240 1478 drivers/net/mii.o.old
>
> Signed-off-by: Joe Perches <joe@perches.com>
Applied.
> I believe I did this:
>
> <edits drivers/net/mii.c>
> make drivers/net/mii.o
> git commit -s drivers/net/mii.c
> mv drivers/net/mii.o drivers/net/mii.o.new
> git checkout master -- drivers/net/mii.c
> make drivers/net/mii.o
> mv drivers/net/mii.o drivers/net/mii.i.old
> git checkout <branch> -- drivers/net/mii.c
> size drivers/net/mii.o.*
> etc...
> git commit --amend drivers/net/mii.c (add etc...)
>
> tun revert? No mii change? huh?
I think the definition of "last commit" used by --amend might be the
issue in this case.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 3/3] eql: Convert printks to pr_<level> and netdev_<level>
2011-03-02 17:18 [PATCH 1/3] tun: Convert logging messages to pr_<level> and tun_debug Joe Perches
2011-03-02 17:18 ` [PATCH 2/3] mii: Convert printks to netdev_info Joe Perches
@ 2011-03-02 17:18 ` Joe Perches
2011-03-03 20:21 ` David Miller
2011-03-03 20:21 ` [PATCH 1/3] tun: Convert logging messages to pr_<level> and tun_debug David Miller
2 siblings, 1 reply; 13+ messages in thread
From: Joe Perches @ 2011-03-02 17:18 UTC (permalink / raw)
To: netdev
Add pr_fmt
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/eql.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/net/eql.c b/drivers/net/eql.c
index 0cb1cf9..ffda358 100644
--- a/drivers/net/eql.c
+++ b/drivers/net/eql.c
@@ -111,6 +111,8 @@
* Sorry, I had to rewrite most of this for 2.5.x -DaveM
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/capability.h>
#include <linux/module.h>
#include <linux/kernel.h>
@@ -204,8 +206,8 @@ static int eql_open(struct net_device *dev)
equalizer_t *eql = netdev_priv(dev);
/* XXX We should force this off automatically for the user. */
- printk(KERN_INFO "%s: remember to turn off Van-Jacobson compression on "
- "your slave devices.\n", dev->name);
+ netdev_info(dev,
+ "remember to turn off Van-Jacobson compression on your slave devices\n");
BUG_ON(!list_empty(&eql->queue.all_slaves));
@@ -591,7 +593,7 @@ static int __init eql_init_module(void)
{
int err;
- printk(version);
+ pr_info(version);
dev_eql = alloc_netdev(sizeof(equalizer_t), "eql", eql_setup);
if (!dev_eql)
--
1.7.4.2.g597a6.dirty
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH 3/3] eql: Convert printks to pr_<level> and netdev_<level>
2011-03-02 17:18 ` [PATCH 3/3] eql: Convert printks to pr_<level> and netdev_<level> Joe Perches
@ 2011-03-03 20:21 ` David Miller
2011-03-03 20:59 ` David Miller
0 siblings, 1 reply; 13+ messages in thread
From: David Miller @ 2011-03-03 20:21 UTC (permalink / raw)
To: joe; +Cc: netdev
From: Joe Perches <joe@perches.com>
Date: Wed, 2 Mar 2011 09:18:12 -0800
> Add pr_fmt
>
> Signed-off-by: Joe Perches <joe@perches.com>
Applied.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 3/3] eql: Convert printks to pr_<level> and netdev_<level>
2011-03-03 20:21 ` David Miller
@ 2011-03-03 20:59 ` David Miller
2011-03-03 21:08 ` [PATCH 3/3 v2] " Joe Perches
0 siblings, 1 reply; 13+ messages in thread
From: David Miller @ 2011-03-03 20:59 UTC (permalink / raw)
To: joe; +Cc: netdev
From: David Miller <davem@davemloft.net>
Date: Thu, 03 Mar 2011 12:21:53 -0800 (PST)
> From: Joe Perches <joe@perches.com>
> Date: Wed, 2 Mar 2011 09:18:12 -0800
>
>> Add pr_fmt
>>
>> Signed-off-by: Joe Perches <joe@perches.com>
>
> Applied.
Something is busted with this change, although I can't quite figure it
out myself:
drivers/net/eql.c: In function ‘eql_init_module’:
drivers/net/eql.c:596:2: error: expected ‘)’ before ‘version’
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 3/3 v2] eql: Convert printks to pr_<level> and netdev_<level>
2011-03-03 20:59 ` David Miller
@ 2011-03-03 21:08 ` Joe Perches
2011-03-03 21:30 ` David Miller
0 siblings, 1 reply; 13+ messages in thread
From: Joe Perches @ 2011-03-03 21:08 UTC (permalink / raw)
To: David Miller; +Cc: netdev
Add pr_fmt.
Removed trailing "\n" from version,
add back via pr_info("%s\n", version);
Signed-off-by: Joe Perches <joe@perches.com>
---
> Something is busted with this change, although I can't quite figure it
> out myself:
Joined of a fixed string with an __initconst string.
drivers/net/eql.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/net/eql.c b/drivers/net/eql.c
index 0cb1cf9..a59cf96 100644
--- a/drivers/net/eql.c
+++ b/drivers/net/eql.c
@@ -111,6 +111,8 @@
* Sorry, I had to rewrite most of this for 2.5.x -DaveM
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/capability.h>
#include <linux/module.h>
#include <linux/kernel.h>
@@ -162,7 +164,7 @@ static void eql_timer(unsigned long param)
}
static const char version[] __initconst =
- "Equalizer2002: Simon Janes (simon@ncm.com) and David S. Miller (davem@redhat.com)\n";
+ "Equalizer2002: Simon Janes (simon@ncm.com) and David S. Miller (davem@redhat.com)";
static const struct net_device_ops eql_netdev_ops = {
.ndo_open = eql_open,
@@ -204,8 +206,8 @@ static int eql_open(struct net_device *dev)
equalizer_t *eql = netdev_priv(dev);
/* XXX We should force this off automatically for the user. */
- printk(KERN_INFO "%s: remember to turn off Van-Jacobson compression on "
- "your slave devices.\n", dev->name);
+ netdev_info(dev,
+ "remember to turn off Van-Jacobson compression on your slave devices\n");
BUG_ON(!list_empty(&eql->queue.all_slaves));
@@ -591,7 +593,7 @@ static int __init eql_init_module(void)
{
int err;
- printk(version);
+ pr_info("%s\n", version);
dev_eql = alloc_netdev(sizeof(equalizer_t), "eql", eql_setup);
if (!dev_eql)
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH 3/3 v2] eql: Convert printks to pr_<level> and netdev_<level>
2011-03-03 21:08 ` [PATCH 3/3 v2] " Joe Perches
@ 2011-03-03 21:30 ` David Miller
0 siblings, 0 replies; 13+ messages in thread
From: David Miller @ 2011-03-03 21:30 UTC (permalink / raw)
To: joe; +Cc: netdev
From: Joe Perches <joe@perches.com>
Date: Thu, 03 Mar 2011 13:08:12 -0800
> Add pr_fmt.
>
> Removed trailing "\n" from version,
> add back via pr_info("%s\n", version);
>
> Signed-off-by: Joe Perches <joe@perches.com>
Applied, thanks.
> Joined of a fixed string with an __initconst string.
Aha, I see.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 1/3] tun: Convert logging messages to pr_<level> and tun_debug
2011-03-02 17:18 [PATCH 1/3] tun: Convert logging messages to pr_<level> and tun_debug Joe Perches
2011-03-02 17:18 ` [PATCH 2/3] mii: Convert printks to netdev_info Joe Perches
2011-03-02 17:18 ` [PATCH 3/3] eql: Convert printks to pr_<level> and netdev_<level> Joe Perches
@ 2011-03-03 20:21 ` David Miller
2 siblings, 0 replies; 13+ messages in thread
From: David Miller @ 2011-03-03 20:21 UTC (permalink / raw)
To: joe; +Cc: netdev
From: Joe Perches <joe@perches.com>
Date: Wed, 2 Mar 2011 09:18:10 -0800
> Use the current logging forms with pr_fmt.
> Convert DBG macro to tun_debug, use netdev_printk as well.
> Add printf verification when TUN_DEBUG not defined.
> Miscellaneous comment typo fix.
>
> Signed-off-by: Joe Perches <joe@perches.com>
Applied.
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2011-03-03 21:30 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-02 17:18 [PATCH 1/3] tun: Convert logging messages to pr_<level> and tun_debug Joe Perches
2011-03-02 17:18 ` [PATCH 2/3] mii: Convert printks to netdev_info Joe Perches
2011-03-03 20:21 ` David Miller
2011-03-03 20:29 ` Joe Perches
2011-03-03 20:32 ` David Miller
2011-03-03 20:46 ` [PATCH 2/3 v2] " Joe Perches
2011-03-03 20:56 ` David Miller
2011-03-02 17:18 ` [PATCH 3/3] eql: Convert printks to pr_<level> and netdev_<level> Joe Perches
2011-03-03 20:21 ` David Miller
2011-03-03 20:59 ` David Miller
2011-03-03 21:08 ` [PATCH 3/3 v2] " Joe Perches
2011-03-03 21:30 ` David Miller
2011-03-03 20:21 ` [PATCH 1/3] tun: Convert logging messages to pr_<level> and tun_debug David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).