[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5578B160.1070501@gmail.com>
Date: Wed, 10 Jun 2015 15:51:28 -0600
From: David Ahern <dsahern@...il.com>
To: Scott Feldman <sfeldma@...il.com>
CC: Netdev <netdev@...r.kernel.org>,
Jiří Pírko <jiri@...nulli.us>,
Brenden Blanco <bblanco@...mgrid.com>
Subject: Re: [PATCH net-next] switchdev: fix BUG when port driver doesn't
support set attr op
On 6/10/15 3:47 PM, Scott Feldman wrote:
>> Should that be WARN_ON instead of BUG_ON?
>
> I think I had it as WARN when we were working on the initial patches,
> but we changed it to BUG_ON because we should only get an error here
> if the driver screwed something up between PREPARE phase and COMMIT
> phase, so it should be considered a driver bug which needs fixing.
>
Linus rants from time to time about the prolific use of BUG_ON. e.g.,
https://lkml.org/lkml/2015/4/28/528
'BUG_ON() is for things where our internal data structures are so
corrupted that we don't know what to do, and there's no way to continue.
Not for "I want to sprinkle these things around and this should not
happen".'
David
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists