[libvirt] [PATCH] Fixed build with clang.

Two unused global variables, and DBUS_TYPE_INVALID used as a const char*. --- src/phyp/phyp_driver.c | 1 - src/storage/storage_backend_scsi.c | 24 ------------------------ src/util/virdbus.c | 2 +- 3 files changed, 1 insertion(+), 26 deletions(-) diff --git a/src/phyp/phyp_driver.c b/src/phyp/phyp_driver.c index 20b5bd4..9adb6b0 100644 --- a/src/phyp/phyp_driver.c +++ b/src/phyp/phyp_driver.c @@ -66,7 +66,6 @@ * */ static unsigned const int HMC = 0; -static unsigned const int IVM = 127; static unsigned const int PHYP_IFACENAME_SIZE = 24; static unsigned const int PHYP_MAC_SIZE = 12; diff --git a/src/storage/storage_backend_scsi.c b/src/storage/storage_backend_scsi.c index b38e530..44f17c9 100644 --- a/src/storage/storage_backend_scsi.c +++ b/src/storage/storage_backend_scsi.c @@ -107,30 +107,6 @@ struct diskType { unsigned long long magic; }; -static struct diskType const disk_types[] = { - { VIR_STORAGE_POOL_DISK_LVM2, 0x218, 8, 0x31303020324D564CULL }, - { VIR_STORAGE_POOL_DISK_GPT, 0x200, 8, 0x5452415020494645ULL }, - { VIR_STORAGE_POOL_DISK_DVH, 0x0, 4, 0x41A9E50BULL }, - { VIR_STORAGE_POOL_DISK_MAC, 0x0, 2, 0x5245ULL }, - { VIR_STORAGE_POOL_DISK_BSD, 0x40, 4, 0x82564557ULL }, - { VIR_STORAGE_POOL_DISK_SUN, 0x1fc, 2, 0xBEDAULL }, - /* - * NOTE: pc98 is funky; the actual signature is 0x55AA (just like dos), so - * we can't use that. At the moment I'm relying on the "dummy" IPL - * bootloader data that comes from parted. Luckily, the chances of running - * into a pc98 machine running libvirt are approximately nil. - */ - /*{ 0x1fe, 2, 0xAA55UL },*/ - { VIR_STORAGE_POOL_DISK_PC98, 0x0, 8, 0x314C5049000000CBULL }, - /* - * NOTE: the order is important here; some other disk types (like GPT and - * and PC98) also have 0x55AA at this offset. For that reason, the DOS - * one must be the last one. - */ - { VIR_STORAGE_POOL_DISK_DOS, 0x1fe, 2, 0xAA55ULL }, - { -1, 0x0, 0, 0x0ULL }, -}; - static int virStorageBackendSCSIUpdateVolTargetInfo(virStorageVolTargetPtr target, unsigned long long *allocation, diff --git a/src/util/virdbus.c b/src/util/virdbus.c index a0cbbfe..a6232b7 100644 --- a/src/util/virdbus.c +++ b/src/util/virdbus.c @@ -1281,7 +1281,7 @@ int virDBusIsServiceEnabled(const char *name) "/org/freedesktop/DBus", "org.freedesktop.DBus", "ListActivatableNames", - DBUS_TYPE_INVALID) < 0) + NULL) < 0) return ret; if (!dbus_message_iter_init(reply, &iter) || -- 1.8.5.2

On 02/12/2014 03:36 AM, Cédric Bosdonnat wrote:
Two unused global variables, and DBUS_TYPE_INVALID used as a const char*. --- src/phyp/phyp_driver.c | 1 - src/storage/storage_backend_scsi.c | 24 ------------------------ src/util/virdbus.c | 2 +- 3 files changed, 1 insertion(+), 26 deletions(-)
+++ b/src/storage/storage_backend_scsi.c @@ -107,30 +107,6 @@ struct diskType { unsigned long long magic; };
-static struct diskType const disk_types[] = {
This is the only use of 'struct diskType'; please also remove that declaration a couple lines earlier. ACK with that fix. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On 02/12/2014 06:31 AM, Eric Blake wrote:
On 02/12/2014 03:36 AM, Cédric Bosdonnat wrote:
Two unused global variables, and DBUS_TYPE_INVALID used as a const char*. --- src/phyp/phyp_driver.c | 1 - src/storage/storage_backend_scsi.c | 24 ------------------------ src/util/virdbus.c | 2 +- 3 files changed, 1 insertion(+), 26 deletions(-)
+++ b/src/storage/storage_backend_scsi.c @@ -107,30 +107,6 @@ struct diskType { unsigned long long magic; };
-static struct diskType const disk_types[] = {
This is the only use of 'struct diskType'; please also remove that declaration a couple lines earlier.
ACK with that fix.
I made that change and pushed. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On Wed, 2014-02-12 at 06:31 -0700, Eric Blake wrote:
On 02/12/2014 03:36 AM, Cédric Bosdonnat wrote:
Two unused global variables, and DBUS_TYPE_INVALID used as a const char*. --- src/phyp/phyp_driver.c | 1 - src/storage/storage_backend_scsi.c | 24 ------------------------ src/util/virdbus.c | 2 +- 3 files changed, 1 insertion(+), 26 deletions(-)
+++ b/src/storage/storage_backend_scsi.c @@ -107,30 +107,6 @@ struct diskType { unsigned long long magic; };
-static struct diskType const disk_types[] = {
This is the only use of 'struct diskType'; please also remove that declaration a couple lines earlier.
Weird that clang didn't report that one after the patch. -- Cedric

On 02/12/2014 08:04 AM, Cedric Bosdonnat wrote:
On Wed, 2014-02-12 at 06:31 -0700, Eric Blake wrote:
On 02/12/2014 03:36 AM, Cédric Bosdonnat wrote:
Two unused global variables, and DBUS_TYPE_INVALID used as a const char*. --- src/phyp/phyp_driver.c | 1 - src/storage/storage_backend_scsi.c | 24 ------------------------ src/util/virdbus.c | 2 +- 3 files changed, 1 insertion(+), 26 deletions(-)
+++ b/src/storage/storage_backend_scsi.c @@ -107,30 +107,6 @@ struct diskType { unsigned long long magic; };
-static struct diskType const disk_types[] = {
This is the only use of 'struct diskType'; please also remove that declaration a couple lines earlier.
Weird that clang didn't report that one after the patch.
Unused variables are different than unused types. And if clang were to warn about unused types, we'd be in trouble: gnulib's verify() module depends on the ability to create dummy unused types. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
participants (3)
-
Cedric Bosdonnat
-
Cédric Bosdonnat
-
Eric Blake