diff options
author | Tom Rini <trini@konsulko.com> | 2021-05-24 11:49:10 -0400 |
---|---|---|
committer | David Gibson <david@gibson.dropbear.id.au> | 2021-05-25 13:27:00 +1000 |
commit | 61e513439e408035b4da9ce7120a91297371a308 (patch) | |
tree | 44b81f815a005198f613ea36b5eccb728bd8f1c6 | |
parent | c8bddd1060957ed0a5c95ea364cc13891742b09f (diff) | |
download | dtc-61e513439e408035b4da9ce7120a91297371a308.zip dtc-61e513439e408035b4da9ce7120a91297371a308.tar.gz dtc-61e513439e408035b4da9ce7120a91297371a308.tar.bz2 |
pylibfdt: Rework "avoid unused variable warning" lines
Clang has -Wself-assign enabled by default under -Wall and so when
building with -Werror we would get an error here. Inspired by Linux
kernel git commit a21151b9d81a ("tools/build: tweak unused value
workaround") make use of the fact that both Clang and GCC support
casting to `void` as the method to note that something is intentionally
unused.
Signed-off-by: Tom Rini <trini@konsulko.com>
Message-Id: <20210524154910.30523-1-trini@konsulko.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
-rw-r--r-- | pylibfdt/libfdt.i | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pylibfdt/libfdt.i b/pylibfdt/libfdt.i index 3e09d3a..51ee801 100644 --- a/pylibfdt/libfdt.i +++ b/pylibfdt/libfdt.i @@ -1009,7 +1009,7 @@ typedef uint32_t fdt32_t; } $1 = (void *)PyByteArray_AsString($input); fdt = $1; - fdt = fdt; /* avoid unused variable warning */ + (void)fdt; /* avoid unused variable warning */ } /* Some functions do change the device tree, so use void * */ @@ -1020,7 +1020,7 @@ typedef uint32_t fdt32_t; } $1 = PyByteArray_AsString($input); fdt = $1; - fdt = fdt; /* avoid unused variable warning */ + (void)fdt; /* avoid unused variable warning */ } /* typemap used for fdt_get_property_by_offset() */ |