lkml.org 
[lkml]   [2014]   [Nov]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [V2 PATCH 04/10] added media agnostic (MA) USB packet handling
From
Date
On Mon, 2014-11-10 at 18:09 -0800, Stephanie Wallick wrote:
> +/**
> + * Compares 2 request IDs. Returns true if a is less than b. Handles
> request id
> + * wraparound.
> + */
> +bool mausb_req_id_lt(u8 a, u8 b)

Unify such functions. It's just silly to have so many of them.

> +/**
> + * Calculates the total length of data contained in an ms_pkt (in
> bytes).
> + * Returns the length of the kvec, or 0 on an error.
> + */
> +static int mausb_ms_data_length(struct ms_pkt *pkt)
> +{
> + int i;
> + int total_length;
> + struct kvec *current_kvec;
> +
> + for (i = 0; i < pkt->nents; ++i) {
> + current_kvec = &pkt->kvec[i];
> + if (NULL == current_kvec)
> + return -EINVAL;
> + else
> + total_length += current_kvec->iov_len;
> + }
> +
> + return total_length;
> +}
> +

Regards
Oliver

--
Oliver Neukum <oneukum@suse.de>



\
 
 \ /
  Last update: 2014-11-12 15:41    [W:0.148 / U:15.376 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site