Thread (1 message) 1 message, 1 author, 2014-06-11

Re: [PATCH] blkid: remove unnecessary header and comment

From: Andreas Dilger <hidden>
Date: 2014-06-11 19:00:17

I noticed there is more that could be cleaned up if we don't need
to check for the <sys/queue.h> header at all.  New patch follows.

Cheers, Andreas

On Jun 11, 2014, at 12:40 PM, Andreas Dilger [off-list ref] wrote:
quoted hunk
The LIST_HEAD macro is not directly used in getsize.c, so
<sys/queue.h> is not needed at all, and could cause confusion at
some later point if the Linux-style list macros are ever used.

Build was verified on MacOS which defined HAVE_SYS_DISK_H true.
I manually inspected the sources for recent *BSD headers to check
if this was needed there or not.  MacOS and FreeBSD <sys/disk.h>
do not use lists at all.  NetBSD and OpenBSD <sys/disk.h> include
<sys/queue.h> internally.

Signed-off-by: Andreas Dilger <redacted>
---
lib/blkid/getsize.c  | 4 ----
lib/ext2fs/getsize.c | 3 ---
2 files changed, 7 deletions(-)
diff --git a/lib/blkid/getsize.c b/lib/blkid/getsize.c
index c2a8f72..a5c40aa 100644
--- a/lib/blkid/getsize.c
+++ b/lib/blkid/getsize.c
@@ -12,7 +12,6 @@
#define _LARGEFILE_SOURCE
#define _LARGEFILE64_SOURCE

-/* include this before sys/queues.h! */
#include "config.h"
#include "blkidP.h"
@@ -34,9 +33,6 @@
#include <sys/disklabel.h>
#endif
#ifdef HAVE_SYS_DISK_H
-#ifdef HAVE_SYS_QUEUE_H
-#include <sys/queue.h> /* for LIST_HEAD */
-#endif
#include <sys/disk.h>
#endif
#ifdef __linux__
diff --git a/lib/ext2fs/getsize.c b/lib/ext2fs/getsize.c
index a9a4812..a227155 100644
--- a/lib/ext2fs/getsize.c
+++ b/lib/ext2fs/getsize.c
@@ -34,9 +34,6 @@
#include <sys/disklabel.h>
#endif
#ifdef HAVE_SYS_DISK_H
-#ifdef HAVE_SYS_QUEUE_H
-#include <sys/queue.h> /* for LIST_HEAD */
-#endif
#include <sys/disk.h>
#endif
#ifdef __linux__
-- 
1.8.0

Cheers, Andreas




Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help