On Dec 11, 2007 8:46 PM, bruno randolf <[EMAIL PROTECTED]> wrote: > On Tuesday 11 December 2007 21:38:25 Jiri Slaby wrote: > > > + if (unlikely(tx_tries0 == 0)) { > > > + ATH5K_ERR(ah->ah_sc, "zero retries\n"); > > > + WARN_ON(1); > > > return -EINVAL; > > > + } > > > > I would just do > > if (WARN_ON(tx_tries0 == 0)) > > return -EINVAL; > > > > Or maybe plus the ath error. Comments? > > i had it like this first. then i thought it would be nice to get a descriptive > error too, using ATH5K_ERR, but if we put it inside the if it will be printed > after the warn info, which is completely counter-intuitive. > > of course having a error message is not really that important, so i'm ok with > your more minimalistic version too.
I think your approach is more readable really. > it would be nice to have a WARN_ON(condition, message) macro. That would be nice. BTW -- If rate 0 can be used to make noise, I can find good uses for it. Perhaps we should just warn on it? The retries==0 should not be allowed, however, because IIRC the hardware doesn't like it, I remember playing with it only vaguely. Luis _______________________________________________ ath5k-devel mailing list ath5k-devel@lists.ath5k.org https://lists.ath5k.org/mailman/listinfo/ath5k-devel