Skip to content

Commit

Permalink
scsi: sd_zbc: Remove set but not used variable 'buflen'
Browse files Browse the repository at this point in the history
Fixes gcc '-Wunused-but-set-variable' warning:

drivers/scsi/sd_zbc.c: In function 'sd_zbc_check_zones':
drivers/scsi/sd_zbc.c:341:9: warning:
 variable 'buflen' set but not used [-Wunused-but-set-variable]

It is not used since commit d9dd730 ("block: Enhance
blk_revalidate_disk_zones()")

Reported-by: Hulk Robot <[email protected]>
Reviewed-by: Damien Le Moal <[email protected]>
Signed-off-by: YueHaibing <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
YueHaibing authored and axboe committed Nov 18, 2019
1 parent d410035 commit a468168
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions drivers/scsi/sd_zbc.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,6 @@ static int sd_zbc_check_zoned_characteristics(struct scsi_disk *sdkp,
static int sd_zbc_check_zones(struct scsi_disk *sdkp, unsigned char *buf,
u32 *zblocks)
{
size_t buflen;
u64 zone_blocks = 0;
sector_t max_lba;
unsigned char *rec;
Expand All @@ -363,7 +362,6 @@ static int sd_zbc_check_zones(struct scsi_disk *sdkp, unsigned char *buf,
}

/* Parse REPORT ZONES header */
buflen = min_t(size_t, get_unaligned_be32(&buf[0]) + 64, SD_BUF_SIZE);
rec = buf + 64;
zone_blocks = get_unaligned_be64(&rec[8]);
if (!zone_blocks || !is_power_of_2(zone_blocks)) {
Expand Down

0 comments on commit a468168

Please sign in to comment.