kernel-ark/drivers/staging/dream
Justin Madru 8c172dde41 Staging: s5k3e2fx.c: simplify complexity by factoring
the code was looping, setting s_move[i] to the following calculations

if (actual_step>= 0)
         s_move[i] = ((((i + 1) * gain + 0x200) - (i * gain + 0x200)) / 0x400);
else
         s_move[i] = ((((i + 1) * gain - 0x200) - (i * gain - 0x200)) / 0x400);

but, this code reduces to the expression
	s_move[i] = gain>>  10;

The reason for the complexity was to generate a step function with
integer division and rounding to land on specific values. But these calculations
can be simplified to the following code:

	gain = ((actual_step<<  10) / 5)>>  10;
	for (i = 0; i<= 4; i++)
		s_move[i] = gain;

Signed-off-by: Justin Madru<jdm64@gawab.com>
Reviewed-by: Ray Lee<ray-lk@madrabbit.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03 16:42:33 -08:00
..
camera Staging: s5k3e2fx.c: simplify complexity by factoring 2010-03-03 16:42:33 -08:00
include Staging: dream: add missing include files 2010-03-03 16:42:26 -08:00
qdsp5 Staging: dream: add missing include files 2010-03-03 16:42:26 -08:00
smd Staging: dream: remove duplicated #include 2010-03-03 16:42:27 -08:00
generic_gpio.c Staging: dream: add gpio and pmem support 2009-12-11 12:23:21 -08:00
gpio_axis.c
gpio_event.c Staging: dream: remove wakelock support 2009-12-11 12:23:10 -08:00
gpio_input.c Staging: dream: remove wakelock support 2009-12-11 12:23:10 -08:00
gpio_matrix.c Staging: dream: remove wakelock support 2009-12-11 12:23:10 -08:00
gpio_output.c
Kconfig
Makefile
pmem.c Staging: dream: add gpio and pmem support 2009-12-11 12:23:21 -08:00
synaptics_i2c_rmi.c Staging: dream: Synaptics touchscreen for HTC Dream: check that smbus is available 2009-12-11 12:23:10 -08:00
synaptics_i2c_rmi.h
TODO Staging: dream: add TODO file 2009-12-11 12:23:21 -08:00