Home
last modified time | relevance | path

Searched hist:"3 f83aa6b" (Results 1 – 1 of 1) sorted by relevance

/openbmc/linux/drivers/media/dvb-frontends/
H A Dtda10021.c3f83aa6b Tue Sep 01 06:22:46 CDT 2020 Mauro Carvalho Chehab <mchehab+huawei@kernel.org> media: tda10021: avoid casts when using symbol_rate

The usage of castings and float point when checking for
the setup based at the symbol_rate cause those warnings
with smatch:

drivers/media/dvb-frontends/tda10021.c:153 tda10021_set_symbolrate() warn: unsigned 'symbolrate' is never less than zero.
drivers/media/dvb-frontends/tda10021.c:155 tda10021_set_symbolrate() warn: unsigned 'symbolrate' is never less than zero.
drivers/media/dvb-frontends/tda10021.c:157 tda10021_set_symbolrate() warn: unsigned 'symbolrate' is never less than zero.
drivers/media/dvb-frontends/tda10021.c:159 tda10021_set_symbolrate() warn: unsigned 'symbolrate' is never less than zero.

While the code should work with gcc, as it will evaluate the
values into a constant before compiling, other compilers
could do otherwise. So, get rid of float pointing math on it,
avoiding the need of doing typecasts.

While here, cleanup some coding style issues at the related
code.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3f83aa6b Tue Sep 01 06:22:46 CDT 2020 Mauro Carvalho Chehab <mchehab+huawei@kernel.org> media: tda10021: avoid casts when using symbol_rate

The usage of castings and float point when checking for
the setup based at the symbol_rate cause those warnings
with smatch:

drivers/media/dvb-frontends/tda10021.c:153 tda10021_set_symbolrate() warn: unsigned 'symbolrate' is never less than zero.
drivers/media/dvb-frontends/tda10021.c:155 tda10021_set_symbolrate() warn: unsigned 'symbolrate' is never less than zero.
drivers/media/dvb-frontends/tda10021.c:157 tda10021_set_symbolrate() warn: unsigned 'symbolrate' is never less than zero.
drivers/media/dvb-frontends/tda10021.c:159 tda10021_set_symbolrate() warn: unsigned 'symbolrate' is never less than zero.

While the code should work with gcc, as it will evaluate the
values into a constant before compiling, other compilers
could do otherwise. So, get rid of float pointing math on it,
avoiding the need of doing typecasts.

While here, cleanup some coding style issues at the related
code.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>