qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH for-2.9? v4] ipmi: Fix macro issues


From: Corey Minyard
Subject: Re: [Qemu-devel] [PATCH for-2.9? v4] ipmi: Fix macro issues
Date: Fri, 31 Mar 2017 10:09:18 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0

On 03/31/2017 10:04 AM, Eric Blake wrote:
On 03/31/2017 09:33 AM, address@hidden wrote:
From: Corey Minyard <address@hidden>

Macro parameters should almost always have () around them when used.
llvm reported an error on this.

Remove redundant parenthesis and put parenthesis around the entire
macros with assignments in case they are used in an expression.

The macros were doing ((v) & 1) for a binary input, but that only works
if v == 0 or if v & 1.  Changed to !!(v) so they work for all values.
s/&/==/


I originally wrote v == 1, but I realized that it worked with anything where the
bottom bit of v was set.  Thus, v & 1.

Remove some unused macros.

Reported in https://bugs.launchpad.net/bugs/1651167
Might also be worth adding that an audit of the code finds no semantic
change, that this is just cleaning up the compiler warning.

Will do.

Thanks,

-corey

Signed-off-by: Corey Minyard <address@hidden>
---

Changes since the last revision:

   * Added the !!(v) change

  hw/ipmi/isa_ipmi_bt.c | 34 ++++++++++++----------------------
  1 file changed, 12 insertions(+), 22 deletions(-)
Reviewed-by: Eric Blake <address@hidden>





reply via email to

[Prev in Thread] Current Thread [Next in Thread]