Thread (13 messages) 13 messages, 3 authors, 2012-09-27

Re: [PATCH 5/5] smsc95xx: enable power saving mode during system suspend

flat view

From: Bjørn Mork <bjorn@mork.no>
Date: 2012-09-26 16:17:54

Steve Glendinning [off-list ref] writes:
quoted
quoted
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!
Yes, but you are a lot less likely to know about it if you BUG out.  The
user will be left with no other choice than hitting reset or poweroff.
What's the point of that?

If your driver crashes but the machine is left running, then the user
may forward the Oops to you.  That's much more useful.


Bjørn
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help