Re: [PATCH 0/2] nand: Remove BUG abuse

Ezequiel Garcia
2016-04-02T15:37:30Z

On 2 April 2016 at 10:55, Boris Brezillon
<boris.brezillon@free-electrons.com> wrote:
> Hi Ezequiel,
>
> On Fri, 1 Apr 2016 18:29:22 -0300
> Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> wrote:
>
>> Hi,
>>
>> While using nandsim to debug an issue with an UBI image,
>> I hit a BUG() when passing some crazy ID values to nandsim.
>>
>> I've always felt that nand_base.c is sort of abusing the
>> BUG() macro, so decided to fix it.
>>
>> There are other BUG() uses, but they aren't in the nand_scan
>> path, so I'm not touching them.
>
> Now that you've opened the door to this rework, can you also patch other
> locations where BUG() is employed? :)
>

Well, it's true that BUG() is abused all over the place, but most of them
should be of the "not reached" type.

So, I fixed these two because they *are* reached and they are in the core.
--
Ezequiel García, VanguardiaSur