[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKh2mn4XLCPfTFySEvtZc56J+WM863JtnsjF2D-RyDJatoyAww@mail.gmail.com>
Date: Wed, 26 Sep 2012 16:58:13 +0100
From: Steve Glendinning <steve@...well.net>
To: Bjørn Mork <bjorn@...k.no>
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH 5/5] smsc95xx: enable power saving mode during system suspend
>> I hadn't thought that was a situation that could arise, is it? Would
>> this happen if the USB device was removed during suspend?
>
> No, it should not happen. But then, why test at all?
I thought it was common practice to add these tests to document an
assumption the developer made that later code relies on? I had
assumed that the !dev condition should not be possible, hence the
simple BUG test. If it is possible then I agree - I definitely need
to handle this more gracefully.
In this case, asserting that dev is not NULL will make the code fail
loudly there instead of a few lines down when the netdev_info call
dereferences dev->net. Either way something bad will happen!
-Steve
--
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