]> git.puffer.fish Git - mirror/frr.git/commitdiff
lib/clippy: fix forgotten conditional 9106/head
authorDavid Lamparter <equinox@opensourcerouting.org>
Wed, 21 Jul 2021 14:34:35 +0000 (16:34 +0200)
committerDavid Lamparter <equinox@opensourcerouting.org>
Sat, 28 Aug 2021 12:27:17 +0000 (14:27 +0200)
This fixes some spurious warnings on *BSD, where `elffile_add_dynreloc`
isn't used since `elf_getdata_rawchunk` is not available.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
lib/elf_py.c

index b47aa3d7950a1cca63446de099f645b0f226a282..1c306893ad816f08d5ff31e45204f84253d28167 100644 (file)
@@ -860,6 +860,7 @@ static PyObject *elffile_find_note(PyObject *self, PyObject *args)
        Py_RETURN_NONE;
 }
 
+#ifdef HAVE_ELF_GETDATA_RAWCHUNK
 static bool elffile_virt2file(struct elffile *w, GElf_Addr virt,
                              GElf_Addr *offs)
 {
@@ -884,6 +885,7 @@ static bool elffile_virt2file(struct elffile *w, GElf_Addr virt,
 
        return false;
 }
+#endif /* HAVE_ELF_GETDATA_RAWCHUNK */
 
 static PyObject *elffile_subscript(PyObject *self, PyObject *key)
 {
@@ -1016,6 +1018,7 @@ static PyTypeObject typeobj_elffile = {
        .tp_methods = methods_elffile,
 };
 
+#ifdef HAVE_ELF_GETDATA_RAWCHUNK
 static char *elfdata_strptr(Elf_Data *data, size_t offset)
 {
        char *p;
@@ -1124,6 +1127,7 @@ static void elffile_add_dynreloc(struct elffile *w, Elf_Data *reldata,
        }
 
 }
+#endif /* HAVE_ELF_GETDATA_RAWCHUNK */
 
 /* primary (only, really) entry point to anything in this module */
 static PyObject *elffile_load(PyTypeObject *type, PyObject *args,