lkml.org 
[lkml]   [2009]   [Nov]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 2/2] virtio: Convert virtio-rng to the new API
Date
On Thu, 26 Nov 2009 10:55:27 am Ian Molton wrote:
> This patch converts virtio-rng to the new hw_rng API.
>
> In the process it fixes a previously untriggered buffering bug where the
> buffer is not drained correctly if it has a non-multiple-of-4 length.

Hi Ian,

Looks good. Minor comments below:

> @@ -16,6 +16,7 @@
> * along with this program; if not, write to the Free Software
> * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
> */
> +
> #include <linux/err.h>
> #include <linux/hw_random.h>
> #include <linux/scatterlist.h>

Gratuitous hunk?

> -static unsigned int data_left;
> +static unsigned int data_avail;
> static DECLARE_COMPLETION(have_data);
> +static int busy;

I prefer bool and true/false for booleans these days.

> +
> +/* The host will fill any buffer we give it with sweet, sweet randomness. */

This comment belongs above register_buffer() now I think.

(But I'm glad you kept it!)

Thanks,
Rusty.


\
 
 \ /
  Last update: 2009-11-28 11:03    [W:0.137 / U:0.292 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site