staging: unisys: fix indentation of uisutil_copy_fragsinfo_from_skb()
authorBenjamin Romer <benjamin.romer@unisys.com>
Mon, 18 Aug 2014 13:29:47 +0000 (09:29 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 26 Aug 2014 00:16:06 +0000 (17:16 -0700)
The function uisutil_copy_fragsinfo_from_skb() in uisutils.c is messy and
over-indented. This patch fixes the function's indentation so it is cleaner.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/unisys/uislib/uisutils.c

index 423cbc4b72f9035e94dd2d8e34c1d0ec6facc192..d175d03c525858691b85c268b2662fd94e40767b 100644 (file)
@@ -229,27 +229,30 @@ uisutil_copy_fragsinfo_from_skb(unsigned char *calling_ctx, void *skb_in,
                offset += size;
                count++;
        }
-       if (numfrags) {
-               if ((count + numfrags) > frags_max) {
-                       LOGERR("**** FAILED %s frags array too small: max:%d count+nr_frags:%d\n",
-                            calling_ctx, frags_max, count + numfrags);
-                       return -1;      /* failure */
-               }
+       if (!numfrags)
+               goto dolist;
 
-               for (ii = 0; ii < numfrags; ii++) {
-                       count = add_physinfo_entries(page_to_pfn(skb_frag_page(&skb_shinfo(skb)->frags[ii])),   /* pfn */
-                                                    skb_shinfo(skb)->frags[ii].
-                                                    page_offset,
-                                                    skb_shinfo(skb)->frags[ii].
-                                                    size, count, frags_max,
-                                                    frags);
-                       if (count == 0) {
-                               LOGERR("**** FAILED to add physinfo entries\n");
-                               return -1;      /* failure */
-                       }
+       if ((count + numfrags) > frags_max) {
+               LOGERR("**** FAILED %s frags array too small: max:%d count+nr_frags:%d\n",
+                    calling_ctx, frags_max, count + numfrags);
+               return -1;      /* failure */
+       }
+
+       for (ii = 0; ii < numfrags; ii++) {
+               count = add_physinfo_entries(page_to_pfn(
+                               skb_frag_page(&skb_shinfo(skb)->frags[ii])),
+                                       skb_shinfo(skb)->frags[ii].
+                                       page_offset,
+                                       skb_shinfo(skb)->frags[ii].
+                                       size, count, frags_max,
+                                       frags);
+               if (count == 0) {
+                       LOGERR("**** FAILED to add physinfo entries\n");
+                       return -1;      /* failure */
                }
        }
-       if (skb_shinfo(skb)->frag_list) {
+
+dolist: if (skb_shinfo(skb)->frag_list) {
                struct sk_buff *skbinlist;
                int c;
 
@@ -257,11 +260,10 @@ uisutil_copy_fragsinfo_from_skb(unsigned char *calling_ctx, void *skb_in,
                     skbinlist = skbinlist->next) {
 
                        c = uisutil_copy_fragsinfo_from_skb("recursive",
-                                                           skbinlist,
-                                                           skbinlist->len -
-                                                           skbinlist->data_len,
-                                                           frags_max - count,
-                                                           &frags[count]);
+                               skbinlist,
+                               skbinlist->len - skbinlist->data_len,
+                               frags_max - count,
+                               &frags[count]);
                        if (c == -1) {
                                LOGERR("**** FAILED recursive call failed\n");
                                return -1;