Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1421048 > unrolled thread

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

Started byDavid Binderman <linuxdev.baldrick@gmail.com>
First post2016-06-13 18:50 +0200
Last post2016-06-13 18:50 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  linux-4.7-rc3/drivers/net/wireless/ath/ath9k/htc_drv_main.c: 2 *  strange tests ? David Binderman <linuxdev.baldrick@gmail.com> - 2016-06-13 18:50 +0200

#1421048 — linux-4.7-rc3/drivers/net/wireless/ath/ath9k/htc_drv_main.c: 2 * strange tests ?

FromDavid Binderman <linuxdev.baldrick@gmail.com>
Date2016-06-13 18:50 +0200
Subjectlinux-4.7-rc3/drivers/net/wireless/ath/ath9k/htc_drv_main.c: 2 * strange tests ?
Message-ID<rJDdM-ph-3@gated-at.bofh.it>
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

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web