[PATCH] device: fix order of params in nm_match_spec_device prototype



The following commit:

  b869d9cc0 device: add spec "driver:" to match devices

added two parameters ("driver" and "driver_version") to the
nm_match_spec_device() function.

However, the definition of the function and its declaration are not
consistent.

The prototype shows:
  nm_match_spec_device (const GSList *specs,
                        const char *interface_name,
                        const char *driver,
                        const char *driver_version,
                        const char *device_type,

But the definition shows:
  nm_match_spec_device (const GSList *specs,
                        const char *interface_name,
                        const char *device_type,
                        const char *driver,
                        const char *driver_version,

Since all parameters are pointers to const char, the type checking
succeeds at compile time.

All currently existing invocations of the function are correct and pass
the arguments in the order described in the definition/implementation.
This patch only changes the prototype so that potential future
invocations don't end up buggy.

Signed-off-by: Olivier Gayot <olivier gayot sigexec com>
---
 src/nm-core-utils.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/nm-core-utils.h b/src/nm-core-utils.h
index 085304008..38a0fff54 100644
--- a/src/nm-core-utils.h
+++ b/src/nm-core-utils.h
@@ -204,9 +204,9 @@ typedef enum {
 
 NMMatchSpecMatchType nm_match_spec_device (const GSList *specs,
                                            const char *interface_name,
+                                           const char *device_type,
                                            const char *driver,
                                            const char *driver_version,
-                                           const char *device_type,
                                            const char *hwaddr,
                                            const char *s390_subchannels);
 NMMatchSpecMatchType nm_match_spec_config (const GSList *specs,
-- 
2.18.0



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]