From: Duncan Haldane Gerd Knorr noticed a small use of floating point math in the cpia driver updates for 2.5.x I sent you a while ago, and this is not allowed in the kernel. This was in some code taken essentially verbatim from the Windows cpia driver released under the GPL by STM inc. that had been incorporated in the later versions of the cpia drivera sourceforge. It turns out that the use of floating point was quite inessential, and I've reimplemented the couple of lines of code involved in integer arithmetic. drivers/media/video/cpia.c | 10 ++++++++++ 1 files changed, 10 insertions(+) diff -puN drivers/media/video/cpia.c~cpia-fp-removal drivers/media/video/cpia.c --- 25/drivers/media/video/cpia.c~cpia-fp-removal 2003-05-21 21:39:35.000000000 -0700 +++ 25-akpm/drivers/media/video/cpia.c 2003-05-21 21:39:35.000000000 -0700 @@ -2427,10 +2427,20 @@ static void set_flicker(struct cam_param #define FIRMWARE_VERSION(x,y) (params->version.firmwareVersion == (x) && \ params->version.firmwareRevision == (y)) /* define for compgain calculation */ +#if 0 #define COMPGAIN(base, curexp, newexp) \ (u8) ((((float) base - 128.0) * ((float) curexp / (float) newexp)) + 128.5) #define EXP_FROM_COMP(basecomp, curcomp, curexp) \ (u16)((float)curexp * (float)(u8)(curcomp + 128) / (float)(u8)(basecomp - 128)) +#else + /* equivalent functions without floating point math */ +#define COMPGAIN(base, curexp, newexp) \ + (u8)(128 + (((u32)(2*(base-128)*curexp + newexp)) / (2* newexp)) ) +#define EXP_FROM_COMP(basecomp, curcomp, curexp) \ + (u16)(((u32)(curexp * (u8)(curcomp + 128)) / (u8)(basecomp - 128))) +#endif + + int currentexp = params->exposure.coarseExpLo + params->exposure.coarseExpHi*256; int startexp; _