All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wang Weidong <weidong1991.wang@gmail.com>
To: Ben Hutchings <ben@decadent.org.uk>,
	Wang Weidong <wangweidong1@huawei.com>
Cc: David Miller <davem@davemloft.net>, netdev@vger.kernel.org
Subject: Re: [PATCH net-next] 8139cp: remove a won't occurred BUG_ON
Date: Mon, 27 Jan 2014 20:57:37 +0800	[thread overview]
Message-ID: <52E657C1.3000002@gmail.com> (raw)
In-Reply-To: <1390823686.2735.138.camel@deadeye.wl.decadent.org.uk>

From: Wang Weidong <wangweidong1@huawei.com>

On 2014/1/27 19:54, Ben Hutchings wrote:
> On Mon, 2014-01-27 at 09:14 +0800, Wang Weidong wrote:
>> On 2014/1/27 7:23, Ben Hutchings wrote:
>>> On Sun, 2014-01-26 at 16:33 +0800, Wang Weidong wrote:
>>>> when variable i go to the BUG_ON the value is equal to the CP_NUM_STATS,
>>>> so the BUG_ON won't occur, so remove it
>>>
>>> We hope that every BUG_ON() does not occur, but that doesn't mean they
>>> should be removed.  This check is meant to catch mistakes when adding
>>> new statistics.
>>>
>>> Ben.
>>>
>> Hi, Ben.
>>
>> Yeah, but I think If someone would add new statistics, he should take into account
>> it instead the BUG_ON helper.
>>
>> And that, I found some other drivers' get_ethtool_stats no have BUG_ON. Should we
>> add the BUG_ON into them?
> [...]
>
> The important thing is that the get_stats, get_sset_count and
> get_strings operations are consistent.  Depending on how they are
> implemented, a BUG_ON or BUILD_BUG_ON may be useful to check that.  I
> don't think there's any universal best practice.
>
> Ben.
>
Ok, Got it.
Thanks for your answers.

Regards,
Wang

      reply	other threads:[~2014-01-27 12:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-26  8:33 [PATCH net-next] 8139cp: remove a won't occurred BUG_ON Wang Weidong
2014-01-26 23:23 ` Ben Hutchings
2014-01-27  1:14   ` Wang Weidong
2014-01-27 11:54     ` Ben Hutchings
2014-01-27 12:57       ` Wang Weidong [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52E657C1.3000002@gmail.com \
    --to=weidong1991.wang@gmail.com \
    --cc=ben@decadent.org.uk \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=wangweidong1@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.