[ath9k-devel] linux-4.7-rc3/drivers/net/wireless/ath/ath9k/htc_drv_main.c: 2 * strange tests ?

David Binderman <[email protected]>
Newsgroups org.ath9k.lists.ath9k-devel,org.kernel.vger.linux-kernel,org.kernel.vger.linux-wireless,org.kernel.vger.netdev
Message-ID <CAMzoamZjA4XfL1b5Hqo7F+97PY-MEaijJ24iY+53L9ntNZromw@mail.gmail.com>
Hello there,

1.

linux-4.7-rc3/drivers/net/wireless/ath/ath9k/htc_drv_main.c:798]:
(warning) Comparison of a boolean expression with an integer other
than 0 or 1.

Source code is

   if (common->ani.caldone <= 0) {

but

drivers/net/wireless/ath/ath.h:    bool caldone;

Maybe better code

  if (!(common->ani.caldone)) {

2.

linux-4.7-rc3/drivers/net/wireless/ath/ath9k/htc_drv_main.c:851]:
(warning) Comparison of a boolean expression with an integer other
than 0 or 1.

   if (common->ani.caldone <= 0)

Duplicate. Also in the same file:

drivers/net/wireless/ath/ath9k/htc_drv_main.c:228]: (style) Variable
'ret' is assigned a value that is never used.

This might be a case where a function return value is not checked.

Regards

David Binderman
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.