diff options
author | Harvey Harrison <harvey.harrison@gmail.com> | 2008-04-01 01:05:30 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-04-07 13:19:08 -0400 |
commit | d70d4667e9eead06aa38be947274fda22dcf923b (patch) | |
tree | 1c8912cbfe627b91153579bc118f44edf62535d4 /drivers/scsi/ch.c | |
parent | 8c5e03d3cf70161413aaf7152dafa96daca5bb2f (diff) |
[SCSI] ch: fix sparse shadowed variable warnings
Replace the global err array with ch_err.
drivers/scsi/ch.c:271:6: warning: symbol 'err' shadows an earlier one
drivers/scsi/ch.c:116:3: originally declared here
Replace the temporary cmd buffer with ch_err to avoid shadowing the cmd
function parameter.
drivers/scsi/ch.c:724:11: warning: symbol 'cmd' shadows an earlier one
drivers/scsi/ch.c:596:20: originally declared here
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/ch.c')
-rw-r--r-- | drivers/scsi/ch.c | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/drivers/scsi/ch.c b/drivers/scsi/ch.c index 7aad15436d24..92d1cb1b21cb 100644 --- a/drivers/scsi/ch.c +++ b/drivers/scsi/ch.c | |||
@@ -113,7 +113,7 @@ static const struct { | |||
113 | unsigned char asc; | 113 | unsigned char asc; |
114 | unsigned char ascq; | 114 | unsigned char ascq; |
115 | int errno; | 115 | int errno; |
116 | } err[] = { | 116 | } ch_err[] = { |
117 | /* Just filled in what looks right. Hav'nt checked any standard paper for | 117 | /* Just filled in what looks right. Hav'nt checked any standard paper for |
118 | these errno assignments, so they may be wrong... */ | 118 | these errno assignments, so they may be wrong... */ |
119 | { | 119 | { |
@@ -155,11 +155,11 @@ static int ch_find_errno(struct scsi_sense_hdr *sshdr) | |||
155 | /* Check to see if additional sense information is available */ | 155 | /* Check to see if additional sense information is available */ |
156 | if (scsi_sense_valid(sshdr) && | 156 | if (scsi_sense_valid(sshdr) && |
157 | sshdr->asc != 0) { | 157 | sshdr->asc != 0) { |
158 | for (i = 0; err[i].errno != 0; i++) { | 158 | for (i = 0; ch_err[i].errno != 0; i++) { |
159 | if (err[i].sense == sshdr->sense_key && | 159 | if (ch_err[i].sense == sshdr->sense_key && |
160 | err[i].asc == sshdr->asc && | 160 | ch_err[i].asc == sshdr->asc && |
161 | err[i].ascq == sshdr->ascq) { | 161 | ch_err[i].ascq == sshdr->ascq) { |
162 | errno = -err[i].errno; | 162 | errno = -ch_err[i].errno; |
163 | break; | 163 | break; |
164 | } | 164 | } |
165 | } | 165 | } |
@@ -721,8 +721,8 @@ static long ch_ioctl(struct file *file, | |||
721 | case CHIOGELEM: | 721 | case CHIOGELEM: |
722 | { | 722 | { |
723 | struct changer_get_element cge; | 723 | struct changer_get_element cge; |
724 | u_char cmd[12]; | 724 | u_char ch_cmd[12]; |
725 | u_char *buffer; | 725 | u_char *buffer; |
726 | unsigned int elem; | 726 | unsigned int elem; |
727 | int result,i; | 727 | int result,i; |
728 | 728 | ||
@@ -739,17 +739,18 @@ static long ch_ioctl(struct file *file, | |||
739 | mutex_lock(&ch->lock); | 739 | mutex_lock(&ch->lock); |
740 | 740 | ||
741 | voltag_retry: | 741 | voltag_retry: |
742 | memset(cmd,0,sizeof(cmd)); | 742 | memset(ch_cmd, 0, sizeof(ch_cmd)); |
743 | cmd[0] = READ_ELEMENT_STATUS; | 743 | ch_cmd[0] = READ_ELEMENT_STATUS; |
744 | cmd[1] = (ch->device->lun << 5) | | 744 | ch_cmd[1] = (ch->device->lun << 5) | |
745 | (ch->voltags ? 0x10 : 0) | | 745 | (ch->voltags ? 0x10 : 0) | |
746 | ch_elem_to_typecode(ch,elem); | 746 | ch_elem_to_typecode(ch,elem); |
747 | cmd[2] = (elem >> 8) & 0xff; | 747 | ch_cmd[2] = (elem >> 8) & 0xff; |
748 | cmd[3] = elem & 0xff; | 748 | ch_cmd[3] = elem & 0xff; |
749 | cmd[5] = 1; | 749 | ch_cmd[5] = 1; |
750 | cmd[9] = 255; | 750 | ch_cmd[9] = 255; |
751 | 751 | ||
752 | if (0 == (result = ch_do_scsi(ch, cmd, buffer, 256, DMA_FROM_DEVICE))) { | 752 | result = ch_do_scsi(ch, ch_cmd, buffer, 256, DMA_FROM_DEVICE); |
753 | if (!result) { | ||
753 | cge.cge_status = buffer[18]; | 754 | cge.cge_status = buffer[18]; |
754 | cge.cge_flags = 0; | 755 | cge.cge_flags = 0; |
755 | if (buffer[18] & CESTATUS_EXCEPT) { | 756 | if (buffer[18] & CESTATUS_EXCEPT) { |