Skip to content

Commit

Permalink
bcache: Fix incompatible pointer type warning
Browse files Browse the repository at this point in the history
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]

Signed-off-by: Emil Goode <emilgoode@gmail.com>
Signed-off-by: Kent Overstreet <koverstreet@google.com>
  • Loading branch information
Emil Goode authored and Kent Overstreet committed May 15, 2013
1 parent f50efd2 commit 867e116
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/md/bcache/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -634,11 +634,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,
Expand Down

0 comments on commit 867e116

Please sign in to comment.