diff options
author | Sami Kerola | 2017-02-11 21:23:26 +0100 |
---|---|---|
committer | Karel Zak | 2017-02-20 12:58:49 +0100 |
commit | 87918040658f2fa9b1bf78f1f8f4f5c065a2e3a3 (patch) | |
tree | 513541cfa347d7fc66e50137603489cb195c86de /sys-utils/losetup.c | |
parent | cfdisk: avoid use of VLA in combination with sizeof() [smatch scan] (diff) | |
download | kernel-qcow2-util-linux-87918040658f2fa9b1bf78f1f8f4f5c065a2e3a3.tar.gz kernel-qcow2-util-linux-87918040658f2fa9b1bf78f1f8f4f5c065a2e3a3.tar.xz kernel-qcow2-util-linux-87918040658f2fa9b1bf78f1f8f4f5c065a2e3a3.zip |
misc: do not use plain 0 as NULL [smatch scan]
text-utils/tailf.c:69:21: warning: Using plain integer as NULL pointer
Since many 'struct option' has used zero as NULL make them more readable in
same go by reindenting, and using named argument requirements.
Reference: https://lwn.net/Articles/93577/
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'sys-utils/losetup.c')
-rw-r--r-- | sys-utils/losetup.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/sys-utils/losetup.c b/sys-utils/losetup.c index ad508109d..5f599ead5 100644 --- a/sys-utils/losetup.c +++ b/sys-utils/losetup.c @@ -574,28 +574,28 @@ int main(int argc, char **argv) OPT_DIO }; static const struct option longopts[] = { - { "all", 0, 0, 'a' }, - { "set-capacity", 1, 0, 'c' }, - { "detach", 1, 0, 'd' }, - { "detach-all", 0, 0, 'D' }, - { "find", 0, 0, 'f' }, - { "nooverlap", 0, 0, 'L' }, - { "help", 0, 0, 'h' }, - { "associated", 1, 0, 'j' }, - { "json", 0, 0, 'J' }, - { "list", 0, 0, 'l' }, - { "noheadings", 0, 0, 'n' }, - { "offset", 1, 0, 'o' }, - { "output", 1, 0, 'O' }, - { "sizelimit", 1, 0, OPT_SIZELIMIT }, - { "partscan", 0, 0, 'P' }, - { "read-only", 0, 0, 'r' }, - { "direct-io", 2, 0, OPT_DIO }, - { "raw", 0, 0, OPT_RAW }, - { "show", 0, 0, OPT_SHOW }, - { "verbose", 0, 0, 'v' }, - { "version", 0, 0, 'V' }, - { NULL, 0, 0, 0 } + { "all", no_argument, NULL, 'a' }, + { "set-capacity", required_argument, NULL, 'c' }, + { "detach", required_argument, NULL, 'd' }, + { "detach-all", no_argument, NULL, 'D' }, + { "find", no_argument, NULL, 'f' }, + { "nooverlap", no_argument, NULL, 'L' }, + { "help", no_argument, NULL, 'h' }, + { "associated", required_argument, NULL, 'j' }, + { "json", no_argument, NULL, 'J' }, + { "list", no_argument, NULL, 'l' }, + { "noheadings", no_argument, NULL, 'n' }, + { "offset", required_argument, NULL, 'o' }, + { "output", required_argument, NULL, 'O' }, + { "sizelimit", required_argument, NULL, OPT_SIZELIMIT }, + { "partscan", no_argument, NULL, 'P' }, + { "read-only", no_argument, NULL, 'r' }, + { "direct-io", optional_argument, NULL, OPT_DIO }, + { "raw", no_argument, NULL, OPT_RAW }, + { "show", no_argument, NULL, OPT_SHOW }, + { "verbose", no_argument, NULL, 'v' }, + { "version", no_argument, NULL, 'V' }, + { NULL, 0, NULL, 0 } }; static const ul_excl_t excl[] = { /* rows and cols in ASCII order */ |