Skip to contentSkip to conversation

bcache: Fix incompatible pointer type warning

PATCH In review Emil Goode 2 participants 2 messages May 9, 2013

Subsystems (3)
lore
Share & tools
lore

Emil Goode

author
#0 lore raw

PATCH 1/1 bcache: Fix incompatible pointer type warning

The function pointer release in struct block_device_operations should point to functions declared as void.

Sparse warnings:

drivers/md/bcache/super.c:656:27: warning:

	incorrect type in initializer (different base types)
	drivers/md/bcache/super.c:656:27:
	expected void ( *release )( ... )
	drivers/md/bcache/super.c:656:27:
	got int ( static [toplevel] *<noident> )( ... )

drivers/md/bcache/super.c:656:2: warning:
initialization from incompatible pointer type [enabled by default]

drivers/md/bcache/super.c:656:2: warning:
(near initialization for ‘bcache_ops.release’) [enabled by default]

---
 drivers/md/bcache/super.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/md/bcache/super.c +1 -2
index 76c7f6c..938bbff 100644
@@ -637,11 +637,10 @@ static int open_dev(struct block_device *b, fmode_t mode)
 	return 0;
 }
 
-static int release_dev(struct gendisk *b, fmode_t mode)
+static void release_dev(struct gendisk *b, fmode_t mode)
 {
 	struct bcache_device *d = b->private_data;
 	closure_put(&d->cl);
-	return 0;
 }
 
 static int ioctl_dev(struct block_device *b, fmode_t mode,
Signature · 1 line
1.7.10.4
#1 lore raw
Quoted 2 lines · Emil Goode

The function pointer release in struct block_device_operations should point to functions declared as void.

Looks like .release just changed to returning void in the merge window - thanks, applied