Skip to contentSkip to conversation

Clean up assertion in get_boot_devices_list()

PATCH Applied Markus Armbruster 2 participants 2 messages Nov 8, 2011 – Nov 9, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Clean up assertion in get_boot_devices_list()

g_strdup() can't fail, remove assertion. Assert its argument can't be null, because that's not obvious (add_boot_device_path() ensures it).

---
 vl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
vl.c +1 -1
index 641629b..f169aac 100644
@@ -915,8 +915,8 @@ char *get_boot_devices_list(uint32_t *size)
         } else if (devpath) {
             bootpath = devpath;
         } else {
+            assert(i->suffix);
             bootpath = g_strdup(i->suffix);
-            assert(bootpath);
         }
 
         if (total) {
Signature · 1 line
1.7.6.4
#1 lore raw
Quoted 4 lines · Markus Armbruster

g_strdup() can't fail, remove assertion. Assert its argument can't be null, because that's not obvious (add_boot_device_path() ensures it).

Applied. Thanks.

Regards,

Anthony Liguori

Quoted 18 lines
---
  vl.c |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)
vl.c +1 -1
index 641629b..f169aac 100644
@@ -915,8 +915,8 @@ char *get_boot_devices_list(uint32_t *size)
          } else if (devpath) {
              bootpath = devpath;
          } else {
+            assert(i->suffix);
              bootpath = g_strdup(i->suffix);
-            assert(bootpath);
          }
 
          if (total) {