staging: unisys: visornic: Move function to appropriate location
authorDavid Binder <david.binder@unisys.com>
Fri, 17 Mar 2017 15:27:06 +0000 (11:27 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 21 Mar 2017 06:58:46 +0000 (07:58 +0100)
Move function add_physinfo_entries() to visornic_main.c, which is the
only function where it is used.

Signed-off-by: David Binder <david.binder@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/unisys/include/iochannel.h
drivers/staging/unisys/visornic/visornic_main.c

index 53fed6d58da3a6bd749ee290b8fb8de076dd4d9f..0b61fd719356e632428dbf9684268b88a466252a 100644 (file)
@@ -551,41 +551,4 @@ struct spar_io_channel_protocol {
 #define PI_PAGE_SIZE  0x1000
 #define PI_PAGE_MASK  0x0FFF
 
-/* Returns next non-zero index on success or 0 on failure (i.e. out of room). */
-static inline u16
-add_physinfo_entries(u64 inp_pfn, u16 inp_off, u32 inp_len, u16 index,
-                    u16 max_pi_arr_entries, struct phys_info pi_arr[])
-{
-       u32 len;
-       u16 i, firstlen;
-
-       firstlen = PI_PAGE_SIZE - inp_off;
-       if (inp_len <= firstlen) {
-               /* The input entry spans only one page - add as is. */
-               if (index >= max_pi_arr_entries)
-                       return 0;
-               pi_arr[index].pi_pfn = inp_pfn;
-               pi_arr[index].pi_off = (u16)inp_off;
-               pi_arr[index].pi_len = (u16)inp_len;
-               return index + 1;
-       }
-
-       /* This entry spans multiple pages. */
-       for (len = inp_len, i = 0; len;
-               len -= pi_arr[index + i].pi_len, i++) {
-               if (index + i >= max_pi_arr_entries)
-                       return 0;
-               pi_arr[index + i].pi_pfn = inp_pfn + i;
-               if (i == 0) {
-                       pi_arr[index].pi_off = inp_off;
-                       pi_arr[index].pi_len = firstlen;
-               } else {
-                       pi_arr[index + i].pi_off = 0;
-                       pi_arr[index + i].pi_len =
-                           (u16)MINNUM(len, (u32)PI_PAGE_SIZE);
-               }
-       }
-       return index + i;
-}
-
 #endif /* __IOCHANNEL_H__ */
index b961d7e1ae7b1dff005011817cec21d9045e19a4..89de87fa9e4d96914aa644e9df8947cfd6dfdd68 100644 (file)
@@ -141,6 +141,43 @@ struct visornic_devdata {
        struct uiscmdrsp cmdrsp[SIZEOF_CMDRSP];
 };
 
+/* Returns next non-zero index on success or 0 on failure (i.e. out of room). */
+static inline u16
+add_physinfo_entries(u64 inp_pfn, u16 inp_off, u32 inp_len, u16 index,
+                    u16 max_pi_arr_entries, struct phys_info pi_arr[])
+{
+       u32 len;
+       u16 i, firstlen;
+
+       firstlen = PI_PAGE_SIZE - inp_off;
+       if (inp_len <= firstlen) {
+               /* The input entry spans only one page - add as is. */
+               if (index >= max_pi_arr_entries)
+                       return 0;
+               pi_arr[index].pi_pfn = inp_pfn;
+               pi_arr[index].pi_off = (u16)inp_off;
+               pi_arr[index].pi_len = (u16)inp_len;
+               return index + 1;
+       }
+
+       /* This entry spans multiple pages. */
+       for (len = inp_len, i = 0; len;
+               len -= pi_arr[index + i].pi_len, i++) {
+               if (index + i >= max_pi_arr_entries)
+                       return 0;
+               pi_arr[index + i].pi_pfn = inp_pfn + i;
+               if (i == 0) {
+                       pi_arr[index].pi_off = inp_off;
+                       pi_arr[index].pi_len = firstlen;
+               } else {
+                       pi_arr[index + i].pi_off = 0;
+                       pi_arr[index + i].pi_len =
+                           (u16)MINNUM(len, (u32)PI_PAGE_SIZE);
+               }
+       }
+       return index + i;
+}
+
 /*
  *     visor_copy_fragsinfo_from_skb(
  *     @skb_in: skbuff that we are pulling the frags from