]> www.infradead.org Git - users/dwmw2/linux.git/commit
media: tda10021: avoid casts when using symbol_rate
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Tue, 1 Sep 2020 11:22:46 +0000 (13:22 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Thu, 3 Sep 2020 09:11:03 +0000 (11:11 +0200)
commit3f83aa6b4bae3bf16dcb84f5ac74f4b881f4a3ea
tree2f9241f6da1e8da99e6020076d093eaee631dce8
parent10f07a6b2a0e2df63e7159554a47d674c4c9fb16
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>
drivers/media/dvb-frontends/tda10021.c