[media] gspca: ov534/topro: use a define for the default framerate
When writing the change in commit dcc7fdbec5
("[media] gspca:
ov534/topro: prevent a division by 0") I used magic numbers for the
default framerate to minimize the code footprint to make it easier to
backport the patch to the stable trees.
However it's better if the default framerate has its own define to avoid
risking using different values in different places, and for readability.
While at it also remove some trivial comments about the framerates which
don't add much to the code anymore.
Signed-off-by: Antonio Ospite <ao2@ao2.it>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Этот коммит содержится в:

коммит произвёл
Mauro Carvalho Chehab

родитель
1f6bcd0114
Коммит
8a074e860a
@@ -175,6 +175,8 @@ static const u8 jpeg_q[17] = {
|
||||
#error "USB buffer too small"
|
||||
#endif
|
||||
|
||||
#define DEFAULT_FRAME_RATE 30
|
||||
|
||||
static const u8 rates[] = {30, 20, 15, 10, 7, 5};
|
||||
static const struct framerates framerates[] = {
|
||||
{
|
||||
@@ -4020,7 +4022,7 @@ static int sd_config(struct gspca_dev *gspca_dev,
|
||||
gspca_dev->cam.mode_framerates = sd->bridge == BRIDGE_TP6800 ?
|
||||
framerates : framerates_6810;
|
||||
|
||||
sd->framerate = 30; /* default: 30 fps */
|
||||
sd->framerate = DEFAULT_FRAME_RATE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -4803,7 +4805,7 @@ static void sd_set_streamparm(struct gspca_dev *gspca_dev,
|
||||
int fr, i;
|
||||
|
||||
if (tpf->numerator == 0 || tpf->denominator == 0)
|
||||
sd->framerate = 30;
|
||||
sd->framerate = DEFAULT_FRAME_RATE;
|
||||
else
|
||||
sd->framerate = tpf->denominator / tpf->numerator;
|
||||
|
||||
|
Ссылка в новой задаче
Block a user