lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 27 Jan 2014 11:54:46 +0000
From:	Ben Hutchings <ben@...adent.org.uk>
To:	Wang Weidong <wangweidong1@...wei.com>
Cc:	David Miller <davem@...emloft.net>, netdev@...r.kernel.org
Subject: Re: [PATCH net-next] 8139cp: remove a won't occurred BUG_ON

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.

-- 
Ben Hutchings
If at first you don't succeed, you're doing about average.

Download attachment "signature.asc" of type "application/pgp-signature" (829 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ