From f6295033c1fd4fd11df9fe78dff8f9c113e8959d Mon Sep 17 00:00:00 2001 From: Alexander Motin Date: Thu, 27 Aug 2015 21:16:24 +0000 Subject: [PATCH] Fix type bug introduced at r286811. --- sys/cam/ctl/ctl_backend_block.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/sys/cam/ctl/ctl_backend_block.c b/sys/cam/ctl/ctl_backend_block.c index 65d049113de..3170b8b002a 100644 --- a/sys/cam/ctl/ctl_backend_block.c +++ b/sys/cam/ctl/ctl_backend_block.c @@ -1861,8 +1861,8 @@ ctl_be_block_open_dev(struct ctl_be_block_lun *be_lun, struct ctl_lun_req *req) struct cdev *dev; struct cdevsw *devsw; char *value; - int error, atomic, maxio, unmap; - off_t ps, pss, po, pos, us, uss, uo, uos, tmp; + int error, atomic, maxio, unmap, tmp; + off_t ps, pss, po, pos, us, uss, uo, uos, otmp; params = &be_lun->params; @@ -1928,21 +1928,19 @@ ctl_be_block_open_dev(struct ctl_be_block_lun *be_lun, struct ctl_lun_req *req) snprintf(req->error_str, sizeof(req->error_str), "requested blocksize %u is not an even " "multiple of backing device blocksize %u", - params->blocksize_bytes, - be_lun->blocksize); + params->blocksize_bytes, tmp); return (EINVAL); } } else if (params->blocksize_bytes != 0) { snprintf(req->error_str, sizeof(req->error_str), "requested blocksize %u < backing device " - "blocksize %u", params->blocksize_bytes, - be_lun->blocksize); + "blocksize %u", params->blocksize_bytes, tmp); return (EINVAL); } else be_lun->blocksize = tmp; - error = devsw->d_ioctl(dev, DIOCGMEDIASIZE, (caddr_t)&tmp, FREAD, + error = devsw->d_ioctl(dev, DIOCGMEDIASIZE, (caddr_t)&otmp, FREAD, curthread); if (error) { snprintf(req->error_str, sizeof(req->error_str), @@ -1953,18 +1951,18 @@ ctl_be_block_open_dev(struct ctl_be_block_lun *be_lun, struct ctl_lun_req *req) } if (params->lun_size_bytes != 0) { - if (params->lun_size_bytes > tmp) { + if (params->lun_size_bytes > otmp) { snprintf(req->error_str, sizeof(req->error_str), "requested LUN size %ju > backing device " "size %ju", (uintmax_t)params->lun_size_bytes, - (uintmax_t)be_lun->size_bytes); + (uintmax_t)otmp); return (EINVAL); } be_lun->size_bytes = params->lun_size_bytes; } else - be_lun->size_bytes = tmp; + be_lun->size_bytes = otmp; error = devsw->d_ioctl(dev, DIOCGSTRIPESIZE, (caddr_t)&ps, FREAD, curthread);