]> git.proxmox.com Git - mirror_iproute2.git/blobdiff - rdma/rdma.c
rdma: Simplify code to reuse existing functions
[mirror_iproute2.git] / rdma / rdma.c
index b43e5385ad0a43e4c65ff2d173cc9a49b1004f50..676e03c23088316fac634990b52168f1636d7ab0 100644 (file)
@@ -1,11 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB
 /*
  * rdma.c      RDMA tool
- *
- *              This program is free software; you can redistribute it and/or
- *              modify it under the terms of the GNU General Public License
- *              as published by the Free Software Foundation; either version
- *              2 of the License, or (at your option) any later version.
- *
  * Authors:     Leon Romanovsky <leonro@mellanox.com>
  */
 
@@ -129,13 +124,14 @@ int main(int argc, char **argv)
                { "batch",              required_argument,      NULL, 'b' },
                { NULL, 0, NULL, 0 }
        };
+       bool show_driver_details = false;
        const char *batch_file = NULL;
        bool pretty_output = false;
        bool show_details = false;
        bool json_output = false;
        bool force = false;
-       char *filename;
        struct rd rd = {};
+       char *filename;
        int opt;
        int err;
 
@@ -152,7 +148,10 @@ int main(int argc, char **argv)
                        pretty_output = true;
                        break;
                case 'd':
-                       show_details = true;
+                       if (show_details)
+                               show_driver_details = true;
+                       else
+                               show_details = true;
                        break;
                case 'j':
                        json_output = true;
@@ -180,6 +179,7 @@ int main(int argc, char **argv)
        argv += optind;
 
        rd.show_details = show_details;
+       rd.show_driver_details = show_driver_details;
        rd.json_output = json_output;
        rd.pretty_output = pretty_output;