Re: [PATCH 4/4] rtl8192u: fix printk calls in r8192U_core.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, May 23, 2013 at 05:14:49AM +0300, Xenia Ragiadakou wrote:
> @@ -706,17 +706,17 @@ void print_buffer(u32 *buffer, int len)
>  	int i;
>  	u8 *buf = (u8 *)buffer;
>  
> -	printk("ASCII BUFFER DUMP (len: %x):\n", len);
> +	pr_devel("ASCII BUFFER DUMP (len: %x):\n", len);
>  
>  	for (i = 0; i < len; i++)
> -		printk("%c", buf[i]);
> +		pr_devel("%c", buf[i]);
>  
> -	printk("\nBINARY BUFFER DUMP (len: %x):\n", len);
> +	pr_devel("\nBINARY BUFFER DUMP (len: %x):\n", len);
>  
>  	for (i = 0; i < len; i++)
> -		printk("%x", buf[i]);
> +		pr_devel("%x", buf[i]);
>  
> -	printk("\n");
> +	pr_devel("\n");
>  }

I suspect that these should actually be pr_info() but I can't say
for sure because the function is never used.  Just delete it so we
don't have to debate the printk level.

>  
>  //short check_nic_enough_desc(struct net_device *dev, priority_t priority)
> @@ -757,11 +757,11 @@ void rtl8192_dump_reg(struct net_device *dev)
>  
>  	for (n = 0; n <= max;)
>  	{
> -		printk("\nD: %2x> ", n);
> +		pr_devel("\nD: %2x> ", n);
>  		for (i = 0; i < 16 && n <= max; i++, n++)
> -			printk("%2x ", read_nic_byte(dev, n));
> +			pr_devel("%2x ", read_nic_byte(dev, n));
>  	}
> -	printk("\n");
> +	pr_devel("\n");
>  }
>  

Delete this function as well to avoid the debate.  pr_devel() makes
me nervous.

>  /****************************************************************************
> @@ -999,7 +999,7 @@ void rtl8192_rtx_disable(struct net_device *dev)
>  	}
>  
>  	if (skb_queue_len(&priv->skb_queue)) {
> -		printk(KERN_WARNING "skb_queue not empty\n");
> +		pr_warn("skb_queue not empty\n");
>  	}
>  
>  	skb_queue_purge(&priv->skb_queue);
> @@ -1080,7 +1080,7 @@ static void rtl8192_rx_isr(struct urb *urb)
>  	skb = dev_alloc_skb(RX_URB_SIZE);
>  	if (unlikely(!skb)) {
>  		usb_free_urb(urb);
> -		printk("%s():can,t alloc skb\n", __func__);
> +		pr_err("%s():can,t alloc skb\n", __func__);
                             ^^^^^

Btw, feel free to fix these small obvious typos in the printk if you
are already changing something on that line.  Mention it in the
changelog, "Oh, and I also fixed a few small related typos."

>  		/* TODO check rx queue length and refill *somewhere* */
>  		return;
>  	}
> @@ -1099,7 +1099,7 @@ static void rtl8192_rx_isr(struct urb *urb)
>  	skb_queue_tail(&priv->rx_queue, skb);
>  	err = usb_submit_urb(urb, GFP_ATOMIC);
>  	if (err && err != EPERM)
> -		printk("can not submit rxurb, err is %x,URB status is %x\n", err, urb->status);
> +		pr_err("can not submit rxurb, err is %x,URB status is %x\n", err, urb->status);
>  }
>  
>  u32
> @@ -1257,7 +1257,7 @@ struct sk_buff *DrvAggr_Aggregation(struct net_device *dev, struct ieee80211_drv
>  	tcb_desc->drv_agg_enable = 1;
>  	tcb_desc->pkt_size = skb->len;
>  	tcb_desc->DrvAggrNum = pSendList->nr_drv_agg_frames;
> -	printk("DrvAggNum = %d\n", tcb_desc->DrvAggrNum);
> +	pr_devel("DrvAggNum = %d\n", tcb_desc->DrvAggrNum);

Use netdev_dbg() here.  If you are tempted to use pr_devel() then
just delete the whole line.


>  //	RT_DEBUG_DATA(COMP_SEND, skb->cb, sizeof(skb->cb));
>  //	printk("========>skb->data ======> \n");
>  //	RT_DEBUG_DATA(COMP_SEND, skb->data, skb->len);
> @@ -1794,10 +1794,10 @@ short rtl819xU_tx_cmd(struct net_device *dev, struct sk_buff *skb)
>  #endif
>  #ifdef JOHN_DUMP_TXDESC
>  	int i;
> -	printk("<Tx descriptor>--rate %x---", rate);
> +	pr_devel("<Tx descriptor>--rate %x---", rate);
>  	for (i = 0; i < 8; i++)
> -		printk("%8x ", tx[i]);
> -	printk("\n");
> +		pr_devel("%8x ", tx[i]);
> +	pr_devel("\n");
>  #endif

Delete everything inside JOHN_DUMP_TXDESC.

>  	usb_fill_bulk_urb(tx_urb, priv->udev, usb_sndbulkpipe(priv->udev, idx_pipe), \
>  			skb->data, skb->len, rtl8192_tx_isr, skb);
> @@ -1951,7 +1951,7 @@ short rtl8192_tx(struct net_device *dev, struct sk_buff *skb)
>  	 * !!! For debug purpose
>  	 */
>  	if (pend > MAX_TX_URB){
> -		printk("To discard skb packet!\n");
> +		pr_devel("To discard skb packet!\n");

netdev_dbg() or delete.

>  		dev_kfree_skb_any(skb);
>  		return -1;
>  	}
> @@ -2191,7 +2191,7 @@ short rtl8192_usb_initendpoints(struct net_device *dev)
>  		return -ENOMEM;
>  	}
>  
> -	printk("End of initendpoints\n");
> +	pr_devel("End of initendpoints\n");

Same.

>  	return 0;
>  
>  }
> @@ -3074,7 +3074,7 @@ short rtl8192_get_channel_map(struct net_device *dev)
>  {
>  	struct r8192_priv *priv = ieee80211_priv(dev);
>  	if (priv->ChannelPlan > COUNTRY_CODE_GLOBAL_DOMAIN){
> -		printk("rtl8180_init:Error channel plan! Set to default.\n");
> +		pr_err("rtl8180_init:Error channel plan! Set to default.\n");
>  		priv->ChannelPlan = 0;
>  	}
>  	RT_TRACE(COMP_INIT, "Channel plan is %d\n", priv->ChannelPlan);
> @@ -3886,7 +3886,7 @@ RESET_START:
>  		if (ieee->state == IEEE80211_LINKED)
>  		{
>  			down(&ieee->wx_sem);
> -			printk("ieee->state is IEEE80211_LINKED\n");
> +			pr_devel("ieee->state is IEEE80211_LINKED\n");

netdev_dbg()

>  			ieee80211_stop_send_beacons(priv->ieee80211);
>  			del_timer_sync(&ieee->associate_timer);
>  			cancel_delayed_work(&ieee->associate_retry_wq);
> @@ -3895,7 +3895,7 @@ RESET_START:
>  			up(&ieee->wx_sem);
>  		}
>  		else{
> -			printk("ieee->state is NOT LINKED\n");
> +			pr_devel("ieee->state is NOT LINKED\n");
>  			ieee80211_softmac_stop_protocol(priv->ieee80211);			}
>  		up(&priv->wx_sem);
>  		RT_TRACE(COMP_RESET, "%s():<==========down process is finished\n", __func__);
> @@ -3989,7 +3989,7 @@ void CAM_read_entry(
>  		RT_TRACE(COMP_SEC, "CAM_read_entry(): WRITE A8: %x \n", target_content);
>  	 //	printk("CAM_read_entry(): WRITE A8: %lx \n",target_content);
>  	}
> -	printk("\n");
> +	pr_devel("\n");

pr_cont() or something.

Anyway, please fix the rest of this along the same lines.  I think
you have the idea now.

regards,
dan carpenter

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux