Commit 29a9e895 authored by Benjamin Romer's avatar Benjamin Romer Committed by Greg Kroah-Hartman

staging: unisys: fix indentation of uisutil_copy_fragsinfo_from_skb()

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: default avatarBenjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d283f0c6
...@@ -229,27 +229,30 @@ uisutil_copy_fragsinfo_from_skb(unsigned char *calling_ctx, void *skb_in, ...@@ -229,27 +229,30 @@ uisutil_copy_fragsinfo_from_skb(unsigned char *calling_ctx, void *skb_in,
offset += size; offset += size;
count++; count++;
} }
if (numfrags) { if (!numfrags)
if ((count + numfrags) > frags_max) { goto dolist;
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++) { if ((count + numfrags) > frags_max) {
count = add_physinfo_entries(page_to_pfn(skb_frag_page(&skb_shinfo(skb)->frags[ii])), /* pfn */ LOGERR("**** FAILED %s frags array too small: max:%d count+nr_frags:%d\n",
skb_shinfo(skb)->frags[ii]. calling_ctx, frags_max, count + numfrags);
page_offset, return -1; /* failure */
skb_shinfo(skb)->frags[ii]. }
size, count, frags_max,
frags); for (ii = 0; ii < numfrags; ii++) {
if (count == 0) { count = add_physinfo_entries(page_to_pfn(
LOGERR("**** FAILED to add physinfo entries\n"); skb_frag_page(&skb_shinfo(skb)->frags[ii])),
return -1; /* failure */ 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; struct sk_buff *skbinlist;
int c; int c;
...@@ -257,11 +260,10 @@ uisutil_copy_fragsinfo_from_skb(unsigned char *calling_ctx, void *skb_in, ...@@ -257,11 +260,10 @@ uisutil_copy_fragsinfo_from_skb(unsigned char *calling_ctx, void *skb_in,
skbinlist = skbinlist->next) { skbinlist = skbinlist->next) {
c = uisutil_copy_fragsinfo_from_skb("recursive", c = uisutil_copy_fragsinfo_from_skb("recursive",
skbinlist, skbinlist,
skbinlist->len - skbinlist->len - skbinlist->data_len,
skbinlist->data_len, frags_max - count,
frags_max - count, &frags[count]);
&frags[count]);
if (c == -1) { if (c == -1) {
LOGERR("**** FAILED recursive call failed\n"); LOGERR("**** FAILED recursive call failed\n");
return -1; return -1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment