[DCCP]: Simplified conditions due to use of enum:8 states
This reaps the benefit of the earlier patch, which changed the type of CCID 3 states to use enums, in that many conditions are now simplified and the number of possible (unexpected) values is greatly reduced. In a few instances, this also allowed to simplify pre-conditions; where care has been taken to retain logical equivalence. [DCCP]: Introduce a consistent BUG/WARN message scheme This refines the existing set of DCCP messages so that * BUG(), BUG_ON(), WARN_ON() have meaningful DCCP-specific counterparts * DCCP_CRIT (for severe warnings) is not rate-limited * DCCP_WARN() is introduced as rate-limited wrapper Using these allows a faster and cleaner transition to their original counterparts once the code has matured into a full DCCP implementation. Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk> Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
This commit is contained in:
committed by
David S. Miller
parent
b1308dc015
commit
59348b19ef
@ -13,9 +13,8 @@
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
|
||||
#include <asm/div64.h>
|
||||
|
||||
#include "../../dccp.h"
|
||||
#include "tfrc.h"
|
||||
|
||||
#define TFRC_CALC_X_ARRSIZE 500
|
||||
@ -588,8 +587,10 @@ u32 tfrc_calc_x(u16 s, u32 R, u32 p)
|
||||
/* p should be 0 unless there is a bug in my code */
|
||||
index = 0;
|
||||
|
||||
if (R == 0)
|
||||
if (R == 0) {
|
||||
DCCP_WARN("RTT==0, setting to 1\n");
|
||||
R = 1; /* RTT can't be zero or else divide by zero */
|
||||
}
|
||||
|
||||
BUG_ON(index >= TFRC_CALC_X_ARRSIZE);
|
||||
|
||||
|
Reference in New Issue
Block a user