diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2008-04-29 03:54:36 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2008-04-29 08:48:55 -0400 |
commit | 992b5bceee447a32ef2d617730ae0d03c063eedd (patch) | |
tree | cf8a457afc939b9d6040b809382e8a45adc9eee1 /drivers | |
parent | 4917fa292558593d36b2880977ea206f7727dbe5 (diff) |
block: no need to initialize rq->cmd with blk_get_request
blk_get_request initializes rq->cmd (rq_init does) so the users don't
need to do that.
The purpose of this patch is to remove sizeof(rq->cmd) and &rq->cmd,
as a preparation for large command support, which changes rq->cmd from
the static array to a pointer. sizeof(rq->cmd) will not make sense and
&rq->cmd won't work.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Alasdair G Kergon <agk@redhat.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/block/pktcdvd.c | 2 | ||||
-rw-r--r-- | drivers/cdrom/cdrom.c | 1 | ||||
-rw-r--r-- | drivers/md/dm-emc.c | 2 | ||||
-rw-r--r-- | drivers/md/dm-mpath-hp-sw.c | 1 | ||||
-rw-r--r-- | drivers/md/dm-mpath-rdac.c | 1 |
5 files changed, 0 insertions, 7 deletions
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c index 18feb1c7c33..3b806c9fb00 100644 --- a/drivers/block/pktcdvd.c +++ b/drivers/block/pktcdvd.c | |||
@@ -776,8 +776,6 @@ static int pkt_generic_packet(struct pktcdvd_device *pd, struct packet_command * | |||
776 | 776 | ||
777 | rq->cmd_len = COMMAND_SIZE(cgc->cmd[0]); | 777 | rq->cmd_len = COMMAND_SIZE(cgc->cmd[0]); |
778 | memcpy(rq->cmd, cgc->cmd, CDROM_PACKET_SIZE); | 778 | memcpy(rq->cmd, cgc->cmd, CDROM_PACKET_SIZE); |
779 | if (sizeof(rq->cmd) > CDROM_PACKET_SIZE) | ||
780 | memset(rq->cmd + CDROM_PACKET_SIZE, 0, sizeof(rq->cmd) - CDROM_PACKET_SIZE); | ||
781 | 779 | ||
782 | rq->timeout = 60*HZ; | 780 | rq->timeout = 60*HZ; |
783 | rq->cmd_type = REQ_TYPE_BLOCK_PC; | 781 | rq->cmd_type = REQ_TYPE_BLOCK_PC; |
diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c index ac3829030ac..69f26eb6415 100644 --- a/drivers/cdrom/cdrom.c +++ b/drivers/cdrom/cdrom.c | |||
@@ -2194,7 +2194,6 @@ static int cdrom_read_cdda_bpc(struct cdrom_device_info *cdi, __u8 __user *ubuf, | |||
2194 | if (ret) | 2194 | if (ret) |
2195 | break; | 2195 | break; |
2196 | 2196 | ||
2197 | memset(rq->cmd, 0, sizeof(rq->cmd)); | ||
2198 | rq->cmd[0] = GPCMD_READ_CD; | 2197 | rq->cmd[0] = GPCMD_READ_CD; |
2199 | rq->cmd[1] = 1 << 2; | 2198 | rq->cmd[1] = 1 << 2; |
2200 | rq->cmd[2] = (lba >> 24) & 0xff; | 2199 | rq->cmd[2] = (lba >> 24) & 0xff; |
diff --git a/drivers/md/dm-emc.c b/drivers/md/dm-emc.c index 6b91b9ab1d4..3ea5ad4b780 100644 --- a/drivers/md/dm-emc.c +++ b/drivers/md/dm-emc.c | |||
@@ -110,8 +110,6 @@ static struct request *get_failover_req(struct emc_handler *h, | |||
110 | memset(rq->sense, 0, SCSI_SENSE_BUFFERSIZE); | 110 | memset(rq->sense, 0, SCSI_SENSE_BUFFERSIZE); |
111 | rq->sense_len = 0; | 111 | rq->sense_len = 0; |
112 | 112 | ||
113 | memset(&rq->cmd, 0, BLK_MAX_CDB); | ||
114 | |||
115 | rq->timeout = EMC_FAILOVER_TIMEOUT; | 113 | rq->timeout = EMC_FAILOVER_TIMEOUT; |
116 | rq->cmd_type = REQ_TYPE_BLOCK_PC; | 114 | rq->cmd_type = REQ_TYPE_BLOCK_PC; |
117 | rq->cmd_flags |= REQ_FAILFAST | REQ_NOMERGE; | 115 | rq->cmd_flags |= REQ_FAILFAST | REQ_NOMERGE; |
diff --git a/drivers/md/dm-mpath-hp-sw.c b/drivers/md/dm-mpath-hp-sw.c index 204bf42c944..b63a0ab37c5 100644 --- a/drivers/md/dm-mpath-hp-sw.c +++ b/drivers/md/dm-mpath-hp-sw.c | |||
@@ -137,7 +137,6 @@ static struct request *hp_sw_get_request(struct dm_path *path) | |||
137 | req->sense = h->sense; | 137 | req->sense = h->sense; |
138 | memset(req->sense, 0, SCSI_SENSE_BUFFERSIZE); | 138 | memset(req->sense, 0, SCSI_SENSE_BUFFERSIZE); |
139 | 139 | ||
140 | memset(&req->cmd, 0, BLK_MAX_CDB); | ||
141 | req->cmd[0] = START_STOP; | 140 | req->cmd[0] = START_STOP; |
142 | req->cmd[4] = 1; | 141 | req->cmd[4] = 1; |
143 | req->cmd_len = COMMAND_SIZE(req->cmd[0]); | 142 | req->cmd_len = COMMAND_SIZE(req->cmd[0]); |
diff --git a/drivers/md/dm-mpath-rdac.c b/drivers/md/dm-mpath-rdac.c index e04eb5c697f..95e77734880 100644 --- a/drivers/md/dm-mpath-rdac.c +++ b/drivers/md/dm-mpath-rdac.c | |||
@@ -284,7 +284,6 @@ static struct request *get_rdac_req(struct rdac_handler *h, | |||
284 | return NULL; | 284 | return NULL; |
285 | } | 285 | } |
286 | 286 | ||
287 | memset(&rq->cmd, 0, BLK_MAX_CDB); | ||
288 | rq->sense = h->sense; | 287 | rq->sense = h->sense; |
289 | memset(rq->sense, 0, SCSI_SENSE_BUFFERSIZE); | 288 | memset(rq->sense, 0, SCSI_SENSE_BUFFERSIZE); |
290 | rq->sense_len = 0; | 289 | rq->sense_len = 0; |