aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorGerrit Renker <gerrit@erg.abdn.ac.uk>2006-12-03 11:52:01 -0500
committerArnaldo Carvalho de Melo <acme@mandriva.com>2006-12-03 11:52:01 -0500
commit90fb0e60dd9178dbca2e42c682c483cdb7ea9f2d (patch)
tree09e750ded7fb3b34a0b146ef96a03a9495a9c37f /net
parent50ab46c790a3408c441ba4c2faa9555cacc20028 (diff)
[DCCP] tfrc: Fix small error in reverse lookup of p for given f(p)
This fixes the following small error in tfrc_calc_x_reverse_lookup. 1) The table is generated by the following equations: lookup[index][0] = g((index+1) * 1000000/TFRC_CALC_X_ARRSIZE); lookup[index][1] = g((index+1) * TFRC_CALC_X_SPLIT/TFRC_CALC_X_ARRSIZE); where g(q) is 1E6 * f(q/1E6) 2) The reverse lookup assigns an entry in lookup[index][small] 3) This index needs to match the above, i.e. * if small=0 then p = (index + 1) * 1000000/TFRC_CALC_X_ARRSIZE * if small=1 then p = (index+1) * TFRC_CALC_X_SPLIT/TFRC_CALC_X_ARRSIZE These are exactly the changes that the patch makes; previously the code did not conform to the way the lookup table was generated (this difference resulted in a mean error of about 1.12%). Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk> Acked-by: Ian McDonald <ian.mcdonald@jandi.co.nz> Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
Diffstat (limited to 'net')
-rw-r--r--net/dccp/ccids/lib/tfrc_equation.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/dccp/ccids/lib/tfrc_equation.c b/net/dccp/ccids/lib/tfrc_equation.c
index 57665e979308..78bdf3489162 100644
--- a/net/dccp/ccids/lib/tfrc_equation.c
+++ b/net/dccp/ccids/lib/tfrc_equation.c
@@ -667,9 +667,9 @@ u32 tfrc_calc_x_reverse_lookup(u32 fvalue)
667 ctr++; 667 ctr++;
668 668
669 if (small) 669 if (small)
670 return TFRC_CALC_X_SPLIT * ctr / TFRC_CALC_X_ARRSIZE; 670 return (ctr + 1) * TFRC_CALC_X_SPLIT / TFRC_CALC_X_ARRSIZE;
671 else 671 else
672 return 1000000 * ctr / TFRC_CALC_X_ARRSIZE; 672 return (ctr + 1) * 1000000 / TFRC_CALC_X_ARRSIZE;
673} 673}
674 674
675EXPORT_SYMBOL_GPL(tfrc_calc_x_reverse_lookup); 675EXPORT_SYMBOL_GPL(tfrc_calc_x_reverse_lookup);
l opt">; void __iomem *mmio_base; struct pxafb_dma_buff *dma_buff; size_t dma_buff_size; dma_addr_t dma_buff_phys; dma_addr_t fdadr[DMA_MAX * 2]; void __iomem *video_mem; /* virtual address of frame buffer */ unsigned long video_mem_phys; /* physical address of frame buffer */ size_t video_mem_size; /* size of the frame buffer */ u16 * palette_cpu; /* virtual address of palette memory */ u_int palette_size; u_int lccr0; u_int lccr3; u_int lccr4; u_int cmap_inverse:1, cmap_static:1, unused:30; u_int reg_lccr0; u_int reg_lccr1; u_int reg_lccr2; u_int reg_lccr3; u_int reg_lccr4; u_int reg_cmdcr; unsigned long hsync_time; volatile u_char state; volatile u_char task_state; struct mutex ctrlr_lock; wait_queue_head_t ctrlr_wait; struct work_struct task; struct completion disable_done; #ifdef CONFIG_FB_PXA_SMARTPANEL uint16_t *smart_cmds; size_t n_smart_cmds; struct completion command_done; struct completion refresh_done; struct task_struct *smart_thread; #endif #ifdef CONFIG_FB_PXA_OVERLAY struct pxafb_layer overlay[2]; #endif #ifdef CONFIG_CPU_FREQ struct notifier_block freq_transition; struct notifier_block freq_policy; #endif void (*lcd_power)(int, struct fb_var_screeninfo *); void (*backlight_power)(int); }; #define TO_INF(ptr,member) container_of(ptr,struct pxafb_info,member) /* * These are the actions for set_ctrlr_state */ #define C_DISABLE (0) #define C_ENABLE (1) #define C_DISABLE_CLKCHANGE (2) #define C_ENABLE_CLKCHANGE (3) #define C_REENABLE (4) #define C_DISABLE_PM (5) #define C_ENABLE_PM (6) #define C_STARTUP (7) #define PXA_NAME "PXA" /* * Minimum X and Y resolutions */ #define MIN_XRES 64 #define MIN_YRES 64 /* maximum X and Y resolutions - note these are limits from the register * bits length instead of the real ones */ #define MAX_XRES 1024 #define MAX_YRES 1024 #endif /* __PXAFB_H__ */