Skip to contentSkip to conversation

Remove unnecessary FreeBSD #include

PATCH Applied Ed Maste 3 participants 4 messages Apr 25, 2013

lore
Share & tools
lore

Ed Maste

author
#0 lore raw

PATCH 1/1 Remove unnecessary FreeBSD #include

sys/param.h was included to define __FreeBSD_version, but the conditional using it was removed by commit d05ef160453e98546a4197496dc8a3cb2defac53 (Brad Smith, "Allow clock_gettime() monotonic clock to be utilized on more OS's"), so the include is no longer needed here.

---
 include/qemu/timer.h | 4 ----
 1 file changed, 4 deletions(-)
include/qemu/timer.h +0 -4
index c363190..9dd206c 100644
@@ -5,10 +5,6 @@
 #include "qemu/main-loop.h"
 #include "qemu/notify.h"
 
-#ifdef __FreeBSD__
-#include <sys/param.h>
-#endif
-
 /* timers */
 
 #define SCALE_MS 1000000
Signature · 1 line
1.7.11.5
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Ed Maste

sys/param.h was included to define __FreeBSD_version, but the conditional using it was removed by commit d05ef160453e98546a4197496dc8a3cb2defac53 (Brad Smith, "Allow clock_gettime() monotonic clock to be utilized on more OS's"), so the include is no longer needed here.

CCing qemu-trivial for this.

(Our other use of __FreeBSD_version is preceded by a direct include of sys/param.h in translate-all.c.)

thanks
-- PMM

Quoted 22 lines
---
 include/qemu/timer.h | 4 ----
 1 file changed, 4 deletions(-)
include/qemu/timer.h +0 -5
index c363190..9dd206c 100644
@@ -5,10 +5,6 @@
 #include "qemu/main-loop.h"
 #include "qemu/notify.h"
 
-#ifdef __FreeBSD__
-#include <sys/param.h>
-#endif
-
 /* timers */
 
 #define SCALE_MS 1000000
--

1.7.11.5

author
#2 lore raw
Quoted 2 lines · Peter Maydell

(Our other use of __FreeBSD_version is preceded by a direct include of sys/param.h in translate-all.c.)

I noticed that one. It's checking for __FreeBSD_version >= 700104, which corresponds to a point in time a little before the 7.1 release. Since that's no longer supported the conditional can be removed at some point, although there's no urgency as it doesn't cause any trouble. The timer.h one resulted in a broken build, since it ended up bringing in a round_page macro definition which conflicted with a function of the same name in mac_{old,new}world.c.