[PATCH] staging: brcm80211: simplify pci_config_read/write osl routines.

Greg KH greg at kroah.com
Sat Nov 13 02:07:51 UTC 2010


On Fri, Nov 12, 2010 at 05:56:08PM -0800, Brett Rudley wrote:
> > Heh, that's funny.  Someone went through a lot of work for no reason.
> 
> Not really...  that was to workaround problems we were seeing years
> ago with a buggy 02Micro 0Z6912 Cardbus Controller in HP laptops that
> would occasionally corrupt pci config accesses.  I'm assuming this
> just isn't a problem any longer that this driver needs to worry about.

Yes, that should not be an issue anymore.

> > Do you really want to read every write that happens here for one
> > specific offset?  Why?
> 
> No not particularly ;-)  It was part of the above.  I'll fix this quickly.
> 
> > 
> > And ASSERTs should be removed anyway, right?
> 
> Any tips on which is the right macro to use? (I'm assuming you mean we
> are using the wrong macros not that we shouldn't check)

No, you probably shouldn't be checking most of these.  If you really do
need to check, then just do a simple "if()" check and handle it with
"real" code that way.

> I see some drivers with BUG, BUG_ON, BUILD_BUG, BUILD_BUG_ON_ZERO,
> etc. 

No driver should ever add a BUG or BUG_ON as you never want to take a
machine down for a reason you just detected.

WARN or WARN_ON is fine though.  And build issues are also ok, but I
doubt you would ever need one in a driver.

thanks,

greg k-h



More information about the devel mailing list