lkml.org 
[lkml]   [2011]   [Mar]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH, RFC] virtio_blk: add cache control support
On Wed, Mar 16, 2011 at 02:39:39PM +1030, Rusty Russell wrote:
> > + if (strncmp(buf, "write through", sizeof("write through") - 1) == 0) {
> > + ;
> > + } else if (strncmp(buf, "write back", sizeof("write back") - 1) == 0) {
>
> Is there a reason we're not letting gcc and/or strcmp do the
> optimization work here?

I'm happ to switch strcmp.

> > + vdev->config->set(vdev, offsetof(struct virtio_blk_config, features),
> > + &features, sizeof(features));
> > +
> > + vdev->config->get(vdev, offsetof(struct virtio_blk_config, features),
> > + &features2, sizeof(features2));
> > +
> > + if ((features & VIRTIO_BLK_RT_WCE) !=
> > + (features2 & VIRTIO_BLK_RT_WCE))
> > + return -EIO;
>
> This seems like a debugging check you left in. Or do you suspect
> some issues?

No, it's intentional. config space writes can't return errors, so we need
to check that the value has really changed. I'll add a comment explaining it.



\
 
 \ /
  Last update: 2011-03-16 15:13    [W:0.061 / U:0.328 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site