Re: [V2 PATCH 04/10] added media agnostic (MA) USB packet handling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxx>

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux