From: Christoph Hellwig Date: Tue, 24 Nov 2020 08:43:52 +0000 (+0100) Subject: block: remove a superflous check in blkpg_do_ioctl X-Git-Tag: v5.15~2163^2~62 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3f50b95e0edd22824b2650eb65466bf7060f7488;p=platform%2Fkernel%2Flinux-starfive.git block: remove a superflous check in blkpg_do_ioctl sector_t is now always a u64, so this check is not needed. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara Reviewed-by: Hannes Reinecke Reviewed-by: Johannes Thumshirn Acked-by: Tejun Heo Signed-off-by: Jens Axboe --- diff --git a/block/ioctl.c b/block/ioctl.c index 6b78518..0c09bb7 100644 --- a/block/ioctl.c +++ b/block/ioctl.c @@ -35,15 +35,6 @@ static int blkpg_do_ioctl(struct block_device *bdev, start = p.start >> SECTOR_SHIFT; length = p.length >> SECTOR_SHIFT; - /* check for fit in a hd_struct */ - if (sizeof(sector_t) < sizeof(long long)) { - long pstart = start, plength = length; - - if (pstart != start || plength != length || pstart < 0 || - plength < 0 || p.pno > 65535) - return -EINVAL; - } - switch (op) { case BLKPG_ADD_PARTITION: /* check if partition is aligned to blocksize */