All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] virtio_blk: Use sysfs_match_string() helper
@ 2017-06-09 12:07 Andy Shevchenko
  2017-07-03 12:05 ` Andy Shevchenko
  0 siblings, 1 reply; 6+ messages in thread
From: Andy Shevchenko @ 2017-06-09 12:07 UTC (permalink / raw)
  To: virtualization; +Cc: Andy Shevchenko, Michael S. Tsirkin

Use sysfs_match_string() helper instead of open coded variant.

Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Jason Wang <jasowang@redhat.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/block/virtio_blk.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index 553cc4c542b4..0e707b8cce9d 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -541,12 +541,9 @@ virtblk_cache_type_store(struct device *dev, struct device_attribute *attr,
 	int i;
 
 	BUG_ON(!virtio_has_feature(vblk->vdev, VIRTIO_BLK_F_CONFIG_WCE));
-	for (i = ARRAY_SIZE(virtblk_cache_types); --i >= 0; )
-		if (sysfs_streq(buf, virtblk_cache_types[i]))
-			break;
-
+	i = sysfs_match_string(virtblk_cache_types, buf);
 	if (i < 0)
-		return -EINVAL;
+		return i;
 
 	virtio_cwrite8(vdev, offsetof(struct virtio_blk_config, wce), i);
 	virtblk_update_cache_mode(vdev);
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v1] virtio_blk: Use sysfs_match_string() helper
  2017-06-09 12:07 [PATCH v1] virtio_blk: Use sysfs_match_string() helper Andy Shevchenko
@ 2017-07-03 12:05 ` Andy Shevchenko
  2017-07-03 16:37   ` Michael S. Tsirkin
  2017-07-04 12:17   ` Jason Wang
  0 siblings, 2 replies; 6+ messages in thread
From: Andy Shevchenko @ 2017-07-03 12:05 UTC (permalink / raw)
  To: virtualization, Jens Axboe; +Cc: Michael S. Tsirkin

On Fri, 2017-06-09 at 15:07 +0300, Andy Shevchenko wrote:
> Use sysfs_match_string() helper instead of open coded variant.

Did I miss maintainer?

> 
> Cc: "Michael S. Tsirkin" <mst@redhat.com>
> Cc: Jason Wang <jasowang@redhat.com>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/block/virtio_blk.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
> index 553cc4c542b4..0e707b8cce9d 100644
> --- a/drivers/block/virtio_blk.c
> +++ b/drivers/block/virtio_blk.c
> @@ -541,12 +541,9 @@ virtblk_cache_type_store(struct device *dev,
> struct device_attribute *attr,
>  	int i;
>  
>  	BUG_ON(!virtio_has_feature(vblk->vdev,
> VIRTIO_BLK_F_CONFIG_WCE));
> -	for (i = ARRAY_SIZE(virtblk_cache_types); --i >= 0; )
> -		if (sysfs_streq(buf, virtblk_cache_types[i]))
> -			break;
> -
> +	i = sysfs_match_string(virtblk_cache_types, buf);
>  	if (i < 0)
> -		return -EINVAL;
> +		return i;
>  
>  	virtio_cwrite8(vdev, offsetof(struct virtio_blk_config, wce),
> i);
>  	virtblk_update_cache_mode(vdev);

-- 
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v1] virtio_blk: Use sysfs_match_string() helper
  2017-07-03 12:05 ` Andy Shevchenko
@ 2017-07-03 16:37   ` Michael S. Tsirkin
  2017-07-18 15:46     ` Andy Shevchenko
  2017-07-04 12:17   ` Jason Wang
  1 sibling, 1 reply; 6+ messages in thread
From: Michael S. Tsirkin @ 2017-07-03 16:37 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: Jens Axboe, virtualization

On Mon, Jul 03, 2017 at 03:05:30PM +0300, Andy Shevchenko wrote:
> On Fri, 2017-06-09 at 15:07 +0300, Andy Shevchenko wrote:
> > Use sysfs_match_string() helper instead of open coded variant.
> 
> Did I miss maintainer?
> 
> > 
> > Cc: "Michael S. Tsirkin" <mst@redhat.com>
> > Cc: Jason Wang <jasowang@redhat.com>
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>


You didn't, I'll merge this in the next PULL.

Thanks!

> > ---
> >  drivers/block/virtio_blk.c | 7 ++-----
> >  1 file changed, 2 insertions(+), 5 deletions(-)
> > 
> > diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
> > index 553cc4c542b4..0e707b8cce9d 100644
> > --- a/drivers/block/virtio_blk.c
> > +++ b/drivers/block/virtio_blk.c
> > @@ -541,12 +541,9 @@ virtblk_cache_type_store(struct device *dev,
> > struct device_attribute *attr,
> >  	int i;
> >  
> >  	BUG_ON(!virtio_has_feature(vblk->vdev,
> > VIRTIO_BLK_F_CONFIG_WCE));
> > -	for (i = ARRAY_SIZE(virtblk_cache_types); --i >= 0; )
> > -		if (sysfs_streq(buf, virtblk_cache_types[i]))
> > -			break;
> > -
> > +	i = sysfs_match_string(virtblk_cache_types, buf);
> >  	if (i < 0)
> > -		return -EINVAL;
> > +		return i;
> >  
> >  	virtio_cwrite8(vdev, offsetof(struct virtio_blk_config, wce),
> > i);
> >  	virtblk_update_cache_mode(vdev);
> 
> -- 
> Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Intel Finland Oy

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v1] virtio_blk: Use sysfs_match_string() helper
  2017-07-03 12:05 ` Andy Shevchenko
  2017-07-03 16:37   ` Michael S. Tsirkin
@ 2017-07-04 12:17   ` Jason Wang
  1 sibling, 0 replies; 6+ messages in thread
From: Jason Wang @ 2017-07-04 12:17 UTC (permalink / raw)
  To: Andy Shevchenko, virtualization, Jens Axboe; +Cc: Michael S. Tsirkin



On 2017年07月03日 20:05, Andy Shevchenko wrote:
> On Fri, 2017-06-09 at 15:07 +0300, Andy Shevchenko wrote:
>> Use sysfs_match_string() helper instead of open coded variant.
> Did I miss maintainer?

Nope :)

Reviewed-by: Jason Wang <jasowang@redhat.com>

>
>> Cc: "Michael S. Tsirkin" <mst@redhat.com>
>> Cc: Jason Wang <jasowang@redhat.com>
>> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
>> ---
>>   drivers/block/virtio_blk.c | 7 ++-----
>>   1 file changed, 2 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
>> index 553cc4c542b4..0e707b8cce9d 100644
>> --- a/drivers/block/virtio_blk.c
>> +++ b/drivers/block/virtio_blk.c
>> @@ -541,12 +541,9 @@ virtblk_cache_type_store(struct device *dev,
>> struct device_attribute *attr,
>>   	int i;
>>   
>>   	BUG_ON(!virtio_has_feature(vblk->vdev,
>> VIRTIO_BLK_F_CONFIG_WCE));
>> -	for (i = ARRAY_SIZE(virtblk_cache_types); --i >= 0; )
>> -		if (sysfs_streq(buf, virtblk_cache_types[i]))
>> -			break;
>> -
>> +	i = sysfs_match_string(virtblk_cache_types, buf);
>>   	if (i < 0)
>> -		return -EINVAL;
>> +		return i;
>>   
>>   	virtio_cwrite8(vdev, offsetof(struct virtio_blk_config, wce),
>> i);
>>   	virtblk_update_cache_mode(vdev);

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v1] virtio_blk: Use sysfs_match_string() helper
  2017-07-03 16:37   ` Michael S. Tsirkin
@ 2017-07-18 15:46     ` Andy Shevchenko
  2017-07-18 16:25       ` Michael S. Tsirkin
  0 siblings, 1 reply; 6+ messages in thread
From: Andy Shevchenko @ 2017-07-18 15:46 UTC (permalink / raw)
  To: Michael S. Tsirkin; +Cc: Jens Axboe, virtualization

On Mon, 2017-07-03 at 19:37 +0300, Michael S. Tsirkin wrote:
> On Mon, Jul 03, 2017 at 03:05:30PM +0300, Andy Shevchenko wrote:
> > On Fri, 2017-06-09 at 15:07 +0300, Andy Shevchenko wrote:
> > > Use sysfs_match_string() helper instead of open coded variant.
> > 
> > Did I miss maintainer?
> > 
> You didn't, I'll merge this in the next PULL.

I didn't see this in v4.13-rc1. Shall I resend?

-- 
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v1] virtio_blk: Use sysfs_match_string() helper
  2017-07-18 15:46     ` Andy Shevchenko
@ 2017-07-18 16:25       ` Michael S. Tsirkin
  0 siblings, 0 replies; 6+ messages in thread
From: Michael S. Tsirkin @ 2017-07-18 16:25 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: Jens Axboe, virtualization

On Tue, Jul 18, 2017 at 06:46:52PM +0300, Andy Shevchenko wrote:
> On Mon, 2017-07-03 at 19:37 +0300, Michael S. Tsirkin wrote:
> > On Mon, Jul 03, 2017 at 03:05:30PM +0300, Andy Shevchenko wrote:
> > > On Fri, 2017-06-09 at 15:07 +0300, Andy Shevchenko wrote:
> > > > Use sysfs_match_string() helper instead of open coded variant.
> > > 
> > > Did I miss maintainer?
> > > 
> > You didn't, I'll merge this in the next PULL.
> 
> I didn't see this in v4.13-rc1. Shall I resend?

Thanks for the patch and sorry about a delay.

It's because I didn't send a pull - this cycle is so quiet, that is the
single patch I have. I was hoping for the balloon free page hint patches
to get there but it does not look like that is happening soon. I'll
merge it you do not need to resend.

> -- 
> Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Intel Finland Oy

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-07-18 16:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-09 12:07 [PATCH v1] virtio_blk: Use sysfs_match_string() helper Andy Shevchenko
2017-07-03 12:05 ` Andy Shevchenko
2017-07-03 16:37   ` Michael S. Tsirkin
2017-07-18 15:46     ` Andy Shevchenko
2017-07-18 16:25       ` Michael S. Tsirkin
2017-07-04 12:17   ` Jason Wang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.