Re: drivers/pci/search.c:85:2: warning: suggest parentheses around assignment used as truth value

Yinghai Lu
2012-09-25T20:02:39Z

On Tue, Sep 25, 2012 at 12:49 PM, Dan Carpenter
<dan.carpenter@oracle.com> wrote:
>> > drivers/edac/i7core_edac.c: In function 'i7core_pci_lastbus':
>> > drivers/edac/i7core_edac.c:1299:2: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
>>
>> for checkpatch.pl ?

> GCC.

gcc in opensuse 12.1 does not complain about that:

gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib64/gcc/x86_64-suse-linux/4.6/lto-wrapper
Target: x86_64-suse-linux
Configured with: ../configure --prefix=/usr --infodir=/usr/share/info
--mandir=/usr/share/man --libdir=/usr/lib64 --libexecdir=/usr/lib64
--enable-languages=c,c++,objc,fortran,obj-c++,java,ada
--enable-checking=release --with-gxx-include-dir=/usr/include/c++/4.6
--enable-ssp --disable-libssp --disable-plugin
--with-bugurl=http://bugs.opensuse.org/ --with-pkgversion='SUSE Linux'
--disable-libgcj --disable-libmudflap --with-slibdir=/lib64
--with-system-zlib --enable-__cxa_atexit
--enable-libstdcxx-allocator=new --disable-libstdcxx-pch
--enable-version-specific-runtime-libs --program-suffix=-4.6
--enable-linux-futex --without-system-libunwind --with-arch-32=i586
--with-tune=generic --build=x86_64-suse-linux
Thread model: posix
gcc version 4.6.2 (SUSE Linux)

>
>> the code is like:
>>
>> #define for_each_pci_host_bridge(d) while ((d >> pci_get_next_host_bridge(d)) != NULL)

-Yinghai