2013-05-16 16:22:49

by Cyril Roelandt

[permalink] [raw]
Subject: [PATCH] staging: lustre: fix return type of lo_release.

The return type of block_device_operations.release() changed to void in commit
db2a144b.

Found with the following Coccinelle patch:
<smpl>
@has_release_func@
identifier i;
identifier release_func;
@@
struct block_device_operations i = {
.release = release_func
};

@depends on has_release_func@
identifier has_release_func.release_func;
@@
- int
+ void
release_func(...) {
...
- return ...;
}
</smpl>

Signed-off-by: Cyril Roelandt <[email protected]>
---
drivers/staging/lustre/lustre/llite/lloop.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/lloop.c b/drivers/staging/lustre/lustre/llite/lloop.c
index b72f257..9d4c17e 100644
--- a/drivers/staging/lustre/lustre/llite/lloop.c
+++ b/drivers/staging/lustre/lustre/llite/lloop.c
@@ -596,15 +596,13 @@ static int lo_open(struct block_device *bdev, fmode_t mode)
return 0;
}

-static int lo_release(struct gendisk *disk, fmode_t mode)
+static void lo_release(struct gendisk *disk, fmode_t mode)
{
struct lloop_device *lo = disk->private_data;

mutex_lock(&lo->lo_ctl_mutex);
--lo->lo_refcnt;
mutex_unlock(&lo->lo_ctl_mutex);
-
- return 0;
}

/* lloop device node's ioctl function. */
--
1.7.10.4


2013-05-16 19:01:24

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH] staging: lustre: fix return type of lo_release.

On Thu, May 16, 2013 at 06:06:20PM +0200, Cyril Roelandt wrote:
> The return type of block_device_operations.release() changed to void in commit
> db2a144b.

Interesting, how did you test build this patch, given that the driver
doesn't currently build at all? :)

Anyway, thanks, I'll go queue this up.

greg k-h

2013-05-16 21:25:30

by Cyril Roelandt

[permalink] [raw]
Subject: Re: [PATCH] staging: lustre: fix return type of lo_release.

On 05/16/2013 09:01 PM, Greg KH wrote:
> On Thu, May 16, 2013 at 06:06:20PM +0200, Cyril Roelandt wrote:
>> The return type of block_device_operations.release() changed to void in commit
>> db2a144b.
>
> Interesting, how did you test build this patch, given that the driver
> doesn't currently build at all? :)
>

Well, the patch seemed simple enough to be sent anyway :)

Cyril Roelandt.

2013-05-17 00:56:28

by Peng, Tao

[permalink] [raw]
Subject: RE: [PATCH] staging: lustre: fix return type of lo_release.



> -----Original Message-----
> From: Cyril Roelandt [mailto:[email protected]]
> Sent: Friday, May 17, 2013 12:06 AM
> To: [email protected]; [email protected]; [email protected]; Peng, Tao;
> [email protected]; [email protected]
> Cc: Cyril Roelandt
> Subject: [PATCH] staging: lustre: fix return type of lo_release.
>
> The return type of block_device_operations.release() changed to void in commit
> db2a144b.
>
> Found with the following Coccinelle patch:
> <smpl>
> @has_release_func@
> identifier i;
> identifier release_func;
> @@
> struct block_device_operations i = {
> .release = release_func
> };
>
> @depends on has_release_func@
> identifier has_release_func.release_func;
> @@
> - int
> + void
> release_func(...) {
> ...
> - return ...;
> }
> </smpl>
>
Yeah, thanks for the patch. I have one same patch but am still working on procfs change so didn't send it out. I'd be glad to take yours instead.

Greg, will you take it directly or do you want Andreas and me to queue it first? The patch is absolutely right btw.

Thanks,
Tao

> Signed-off-by: Cyril Roelandt <[email protected]>
> ---
> drivers/staging/lustre/lustre/llite/lloop.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/staging/lustre/lustre/llite/lloop.c b/drivers/staging/lustre/lustre/llite/lloop.c
> index b72f257..9d4c17e 100644
> --- a/drivers/staging/lustre/lustre/llite/lloop.c
> +++ b/drivers/staging/lustre/lustre/llite/lloop.c
> @@ -596,15 +596,13 @@ static int lo_open(struct block_device *bdev, fmode_t mode)
> return 0;
> }
>
> -static int lo_release(struct gendisk *disk, fmode_t mode)
> +static void lo_release(struct gendisk *disk, fmode_t mode)
> {
> struct lloop_device *lo = disk->private_data;
>
> mutex_lock(&lo->lo_ctl_mutex);
> --lo->lo_refcnt;
> mutex_unlock(&lo->lo_ctl_mutex);
> -
> - return 0;
> }
>
> /* lloop device node's ioctl function. */
> --
> 1.7.10.4
>

????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?ݢj"???m??????G????????????&???~???iO???z??v?^?m???? ????????I?

2013-05-17 03:03:48

by Peng, Tao

[permalink] [raw]
Subject: RE: [PATCH] staging: lustre: fix return type of lo_release.


> -----Original Message-----
> From: Greg KH [mailto:[email protected]]
> Sent: Friday, May 17, 2013 3:02 AM
> To: Cyril Roelandt
> Cc: [email protected]; [email protected]; Peng, Tao; [email protected];
> [email protected]
> Subject: Re: [PATCH] staging: lustre: fix return type of lo_release.
>
> On Thu, May 16, 2013 at 06:06:20PM +0200, Cyril Roelandt wrote:
> > The return type of block_device_operations.release() changed to void in commit
> > db2a144b.
>
> Interesting, how did you test build this patch, given that the driver
> doesn't currently build at all? :)
>
> Anyway, thanks, I'll go queue this up.
My stupid email client... Just saw this one. Please ignore my previous mail. Sorry for the noise.

Thanks,
Tao


????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?ݢj"???m??????G????????????&???~???iO???z??v?^?m???? ????????I?