lkml.org 
[lkml]   [2013]   [Jun]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v4] ethernet/arc/arc_emac - Add new driver
Date
On 06/16/2013 12:37 AM, Joe Perches wrote:
> On Sun, 2013-06-16 at 00:20 +0400, Alexey Brodkin wrote:
>> Driver for non-standard on-chip ethernet device ARC EMAC 10/100,
>> instantiated in some legacy ARC (Synopsys) FPGA Boards such as
>> ARCAngel4/ML50x.
>
>> diff --git a/drivers/net/ethernet/arc/emac_main.c b/drivers/net/ethernet/arc/emac_main.c
> []
>> + if (DUPLEX_FULL == phy_dev->duplex)
>
> Most all kernel code uses "if (var == constant)"
> as that's how most people think.

Makes sense.

> []
>
>> +static int arc_emac_rx(struct net_device *ndev, int budget)
> []
>> + /* Prepare the BD for next cycle */
>> + rx_buff->skb = netdev_alloc_skb_ip_align(ndev, buflen);
>> + if (unlikely(!rx_buff->skb)) {
>> + if (net_ratelimit())
>> + netdev_err(ndev, "cannot allocate skb\n");
>
> Unnecessary OOM message, might as well remove it.
> rx_dropped gives the same info.

With all those error messages I wanted to make life easier (especially
for me) if errors appear. User will immediately know where problem
happened. Indeed "rx_dropped" (when it is used only once in driver) may
show where issue happened, but if later at some point "rx_dropped" will
be incremented in other locations then user won't understand immediately
where error happened.

-Alexey


\
 
 \ /
  Last update: 2013-06-15 23:01    [W:0.086 / U:0.512 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site