All of lore.kernel.org
 help / color / mirror / Atom feed
* V4L2 drivers: potentially dangerous and inefficient msecs_to_jiffies() calculation
@ 2009-09-14 21:07 Andreas Mohr
  2009-09-14 21:34 ` Jiri Slaby
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Andreas Mohr @ 2009-09-14 21:07 UTC (permalink / raw)
  To: Guennadi Liakhovetski, Mauro Carvalho Chehab
  Cc: Luca Risolia, linux-media, linux-kernel

Hi all,

./drivers/media/video/sn9c102/sn9c102_core.c
,
./drivers/media/video/et61x251/et61x251_core.c
and
./drivers/media/video/zc0301/zc0301_core.c
do
                            cam->module_param.frame_timeout *
                            1000 * msecs_to_jiffies(1) );
multiple times each.
What they should do instead is
frame_timeout * msecs_to_jiffies(1000), I'd think.
msecs_to_jiffies(1) is quite a bit too boldly assuming
that all of the msecs_to_jiffies(x) implementation branches
always round up.

Not to mention that the current implementation needs one additional
multiplication operation as opposed to constant-aggregating it into the
msecs_to_jiffies() argument and thus nicely evaporating it into nirvana.

HTH,

Andreas Mohr

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2009-09-19 10:08 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-14 21:07 V4L2 drivers: potentially dangerous and inefficient msecs_to_jiffies() calculation Andreas Mohr
2009-09-14 21:34 ` Jiri Slaby
2009-09-14 21:39   ` Andreas Mohr
2009-09-14 21:50     ` Jiri Slaby
2009-09-14 22:13       ` Andreas Mohr
2009-09-14 21:47 ` Trent Piepho
2009-09-15 19:14 ` Marcin Slusarz
2009-09-15 19:21   ` Andreas Mohr
2009-09-19 10:08     ` Andreas Mohr

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.