aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/floppy.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2010-03-10 18:21:10 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2010-03-12 18:52:31 -0500
commit0aad92cfea6fec14bd57dd9c283cc6eb023c97bd (patch)
treeec6f212f60ffc8ace932ee5995797f3c9a63132a /drivers/block/floppy.c
parent712e1de43ed572886d6913a86eee5e73b7de4318 (diff)
drivers/block/floppy.c: remove misleading, used once FD_IOCTL_ALLOWED macro
Just code the test directly Signed-off-by: Joe Perches <joe@perches.com> Cc: Stephen Hemminger <shemminger@vyatta.com> Cc: Jens Axboe <jens.axboe@oracle.com> Cc: Marcin Slusarz <marcin.slusarz@gmail.com> Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/block/floppy.c')
-rw-r--r--drivers/block/floppy.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
index 0b659bb02ad4..67e8e5f366c5 100644
--- a/drivers/block/floppy.c
+++ b/drivers/block/floppy.c
@@ -3420,8 +3420,6 @@ static int fd_getgeo(struct block_device *bdev, struct hd_geometry *geo)
3420static int fd_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd, 3420static int fd_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd,
3421 unsigned long param) 3421 unsigned long param)
3422{ 3422{
3423#define FD_IOCTL_ALLOWED (mode & (FMODE_WRITE|FMODE_WRITE_IOCTL))
3424
3425 int drive = (long)bdev->bd_disk->private_data; 3423 int drive = (long)bdev->bd_disk->private_data;
3426 int type = ITYPE(UDRS->fd_device); 3424 int type = ITYPE(UDRS->fd_device);
3427 int i; 3425 int i;
@@ -3454,7 +3452,7 @@ static int fd_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd,
3454 return ret; 3452 return ret;
3455 3453
3456 /* permission checks */ 3454 /* permission checks */
3457 if (((cmd & 0x40) && !FD_IOCTL_ALLOWED) || 3455 if (((cmd & 0x40) && !(mode & (FMODE_WRITE | FMODE_WRITE_IOCTL))) ||
3458 ((cmd & 0x80) && !capable(CAP_SYS_ADMIN))) 3456 ((cmd & 0x80) && !capable(CAP_SYS_ADMIN)))
3459 return -EPERM; 3457 return -EPERM;
3460 3458