Skip to contentSkip to conversation

hw/ssi/xilinx_spips.c:52:1: warning: "CS" redefined

Qemu-devel Michael Tokarev 2 participants 2 messages Jun 14, 2013

lore
Share & tools
lore
#0 lore raw

This warning is produced when compiling qemu on solaris (openindiana).

/usr/include/sys/regset.h:98:1: warning: this is the location
of the previous definition

(I don't know how regset.h is included)

The code reads:

...

#define MANUAL_CS           (1 << 14)
#define CS                  (0xF << 10)
#define CS_SHIFT            (10)

...

And other than the #define, this constant is never used. There are a few usages of CS_SHIFT (shouldn't it be used when defining CS too?) and MANUAL_CS. A few other constants defined in there, like, for example, IFMODE, are not used too.

Can we get rid of this so-likely-to-clash-with-something definition?

Thanks,

/mjt

#1 lore raw

Hi Michael,

Quoted 14 lines · Michael Tokarev

This warning is produced when compiling qemu on solaris (openindiana).

/usr/include/sys/regset.h:98:1: warning: this is the location
of the previous definition

(I don't know how regset.h is included)

The code reads:

...

#define MANUAL_CS           (1 << 14)
#define CS                  (0xF << 10)
#define CS_SHIFT            (10)
Quoted 9 lines

...

And other than the #define, this constant is never used. There are a few usages of CS_SHIFT (shouldn't it be used when defining CS too?) and MANUAL_CS. A few other constants defined in there, like, for example, IFMODE, are not used too.

I prefer to keep the macro definition set complete to match the TRM as it makes the device model closer to self documenting.

Quoted 3 lines

Can we get rid of this so-likely-to-clash-with-something definition?

CS_MASK would probably be the best short term substitution. Longer term we should preface field macros with their reg names which will make them more bullet proof.

Regards,
Peter

Quoted 3 lines

Thanks,

/mjt