]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lsfd: move kernel32_to_cpu() front in the source file
authorMasatake YAMATO <yamato@redhat.com>
Thu, 2 Feb 2023 16:25:17 +0000 (01:25 +0900)
committerMasatake YAMATO <yamato@redhat.com>
Mon, 6 Feb 2023 20:39:18 +0000 (05:39 +0900)
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
misc-utils/lsfd-sock-xinfo.c

index d4a5563c05d2bb8857a27bdae948e5dd310c7c4d..934fd08cb52e62096278a100034b2ff4303b4faa 100644 (file)
@@ -432,6 +432,14 @@ static bool inet_fill_column(struct proc *proc __attribute__((__unused__)),
        return false;
 }
 
+static uint32_t kernel32_to_cpu(enum sysfs_byteorder byteorder, uint32_t v)
+{
+       if (byteorder == SYSFS_BYTEORDER_LITTLE)
+               return le32_to_cpu(v);
+       else
+               return be32_to_cpu(v);
+}
+
 /*
  * TCP
  */
@@ -603,14 +611,6 @@ static bool L3_verify_initial_line(const char *line)
        return (strncmp(line, "sl", 2) == 0);
 }
 
-static uint32_t kernel32_to_cpu(enum sysfs_byteorder byteorder, uint32_t v)
-{
-       if (byteorder == SYSFS_BYTEORDER_LITTLE)
-               return le32_to_cpu(v);
-       else
-               return be32_to_cpu(v);
-}
-
 #define TCP_LINE_LEN 256
 static void load_xinfo_from_proc_inet_L3(ino_t netns_inode, const char *proc_file,
                                         const struct sock_xinfo_class *class)