lkml.org 
[lkml]   [2014]   [Mar]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 1/6] Drivers: net: hyperv: Enable scatter gather I/O
From
From: "K. Y. Srinivasan" <kys@microsoft.com>
Date: Thu, 6 Mar 2014 03:13:05 -0800

> @@ -140,21 +140,125 @@ static void netvsc_xmit_completion(void *context)
> dev_kfree_skb_any(skb);
> }
>
> +static u32 fill_pg_buf(struct page *page, u32 offset, u32 len,
> + struct hv_page_buffer *pb)
> +{
> + int j = 0;
> + /*
> + * Deal with compund pages by ignoring unused part
> + * of the page.
> + */
> + page += offset >> PAGE_SHIFT;
> + offset &= ~PAGE_MASK;

Please put an empty line between local variable declarations and
the code.

Please format comments:

/* Like
* this.
*/

> + while (len > 0) {
> + unsigned long bytes;
> + bytes = PAGE_SIZE - offset;

Empty line between local variable declarations and code.

> + /*
> + * The packet is laid out thus:
> + * 1. hdr
> + * 2. skb linear data
> + * 3. skb fragment data
> + */

Fix comment formatting as explained above.

> + if (hdr != NULL) {
> + slots_used += fill_pg_buf(virt_to_page(hdr),
> + offset_in_page(hdr),
> + len, &pb[slots_used]);
> + }

Single statment basic blocks do not need surrounding braces.

> + /*
> + * We will atmost need two pages to describe the rndis
> + * header. We can only transmit MAX_PAGE_BUFFER_COUNT number
> + * of pages in a single packet.
> + */

Comment formatting.


\
 
 \ /
  Last update: 2014-03-06 21:01    [W:0.192 / U:1.432 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site