aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/gdth_proc.c
diff options
context:
space:
mode:
authorAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
committerAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
commitada47b5fe13d89735805b566185f4885f5a3f750 (patch)
tree644b88f8a71896307d71438e9b3af49126ffb22b /drivers/scsi/gdth_proc.c
parent43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff)
parent3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff)
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'drivers/scsi/gdth_proc.c')
-rw-r--r--drivers/scsi/gdth_proc.c43
1 files changed, 22 insertions, 21 deletions
diff --git a/drivers/scsi/gdth_proc.c b/drivers/scsi/gdth_proc.c
index 1258da34fbc2..0572b9bf4bd6 100644
--- a/drivers/scsi/gdth_proc.c
+++ b/drivers/scsi/gdth_proc.c
@@ -3,6 +3,7 @@
3 */ 3 */
4 4
5#include <linux/completion.h> 5#include <linux/completion.h>
6#include <linux/slab.h>
6 7
7int gdth_proc_info(struct Scsi_Host *host, char *buffer,char **start,off_t offset,int length, 8int gdth_proc_info(struct Scsi_Host *host, char *buffer,char **start,off_t offset,int length,
8 int inout) 9 int inout)
@@ -43,7 +44,7 @@ static int gdth_set_asc_info(struct Scsi_Host *host, char *buffer,
43 int i, found; 44 int i, found;
44 gdth_cmd_str gdtcmd; 45 gdth_cmd_str gdtcmd;
45 gdth_cpar_str *pcpar; 46 gdth_cpar_str *pcpar;
46 ulong64 paddr; 47 u64 paddr;
47 48
48 char cmnd[MAX_COMMAND_SIZE]; 49 char cmnd[MAX_COMMAND_SIZE];
49 memset(cmnd, 0xff, 12); 50 memset(cmnd, 0xff, 12);
@@ -156,8 +157,8 @@ static int gdth_get_info(char *buffer,char **start,off_t offset,int length,
156 off_t begin = 0,pos = 0; 157 off_t begin = 0,pos = 0;
157 int id, i, j, k, sec, flag; 158 int id, i, j, k, sec, flag;
158 int no_mdrv = 0, drv_no, is_mirr; 159 int no_mdrv = 0, drv_no, is_mirr;
159 ulong32 cnt; 160 u32 cnt;
160 ulong64 paddr; 161 u64 paddr;
161 int rc = -ENOMEM; 162 int rc = -ENOMEM;
162 163
163 gdth_cmd_str *gdtcmd; 164 gdth_cmd_str *gdtcmd;
@@ -220,14 +221,14 @@ static int gdth_get_info(char *buffer,char **start,off_t offset,int length,
220 221
221 if (ha->more_proc) 222 if (ha->more_proc)
222 sprintf(hrec, "%d.%02d.%02d-%c%03X", 223 sprintf(hrec, "%d.%02d.%02d-%c%03X",
223 (unchar)(ha->binfo.upd_fw_ver>>24), 224 (u8)(ha->binfo.upd_fw_ver>>24),
224 (unchar)(ha->binfo.upd_fw_ver>>16), 225 (u8)(ha->binfo.upd_fw_ver>>16),
225 (unchar)(ha->binfo.upd_fw_ver), 226 (u8)(ha->binfo.upd_fw_ver),
226 ha->bfeat.raid ? 'R':'N', 227 ha->bfeat.raid ? 'R':'N',
227 ha->binfo.upd_revision); 228 ha->binfo.upd_revision);
228 else 229 else
229 sprintf(hrec, "%d.%02d", (unchar)(ha->cpar.version>>8), 230 sprintf(hrec, "%d.%02d", (u8)(ha->cpar.version>>8),
230 (unchar)(ha->cpar.version)); 231 (u8)(ha->cpar.version));
231 232
232 size = sprintf(buffer+len, 233 size = sprintf(buffer+len,
233 " Driver Ver.: \t%-10s\tFirmware Ver.: \t%s\n", 234 " Driver Ver.: \t%-10s\tFirmware Ver.: \t%s\n",
@@ -281,7 +282,7 @@ static int gdth_get_info(char *buffer,char **start,off_t offset,int length,
281 pds->bid = ha->raw[i].local_no; 282 pds->bid = ha->raw[i].local_no;
282 pds->first = 0; 283 pds->first = 0;
283 pds->entries = ha->raw[i].pdev_cnt; 284 pds->entries = ha->raw[i].pdev_cnt;
284 cnt = (3*GDTH_SCRATCH/4 - 5 * sizeof(ulong32)) / 285 cnt = (3*GDTH_SCRATCH/4 - 5 * sizeof(u32)) /
285 sizeof(pds->list[0]); 286 sizeof(pds->list[0]);
286 if (pds->entries > cnt) 287 if (pds->entries > cnt)
287 pds->entries = cnt; 288 pds->entries = cnt;
@@ -604,7 +605,7 @@ static int gdth_get_info(char *buffer,char **start,off_t offset,int length,
604 605
605 size = sprintf(buffer+len, 606 size = sprintf(buffer+len,
606 " Capacity [MB]:\t%-6d \tStart Sector: \t%d\n", 607 " Capacity [MB]:\t%-6d \tStart Sector: \t%d\n",
607 (ulong32)(ha->hdr[i].size/2048), ha->hdr[i].start_sec); 608 (u32)(ha->hdr[i].size/2048), ha->hdr[i].start_sec);
608 len += size; pos = begin + len; 609 len += size; pos = begin + len;
609 if (pos < offset) { 610 if (pos < offset) {
610 len = 0; 611 len = 0;
@@ -664,9 +665,9 @@ free_fail:
664} 665}
665 666
666static char *gdth_ioctl_alloc(gdth_ha_str *ha, int size, int scratch, 667static char *gdth_ioctl_alloc(gdth_ha_str *ha, int size, int scratch,
667 ulong64 *paddr) 668 u64 *paddr)
668{ 669{
669 ulong flags; 670 unsigned long flags;
670 char *ret_val; 671 char *ret_val;
671 672
672 if (size == 0) 673 if (size == 0)
@@ -691,9 +692,9 @@ static char *gdth_ioctl_alloc(gdth_ha_str *ha, int size, int scratch,
691 return ret_val; 692 return ret_val;
692} 693}
693 694
694static void gdth_ioctl_free(gdth_ha_str *ha, int size, char *buf, ulong64 paddr) 695static void gdth_ioctl_free(gdth_ha_str *ha, int size, char *buf, u64 paddr)
695{ 696{
696 ulong flags; 697 unsigned long flags;
697 698
698 if (buf == ha->pscratch) { 699 if (buf == ha->pscratch) {
699 spin_lock_irqsave(&ha->smp_lock, flags); 700 spin_lock_irqsave(&ha->smp_lock, flags);
@@ -705,16 +706,16 @@ static void gdth_ioctl_free(gdth_ha_str *ha, int size, char *buf, ulong64 paddr)
705} 706}
706 707
707#ifdef GDTH_IOCTL_PROC 708#ifdef GDTH_IOCTL_PROC
708static int gdth_ioctl_check_bin(gdth_ha_str *ha, ushort size) 709static int gdth_ioctl_check_bin(gdth_ha_str *ha, u16 size)
709{ 710{
710 ulong flags; 711 unsigned long flags;
711 int ret_val; 712 int ret_val;
712 713
713 spin_lock_irqsave(&ha->smp_lock, flags); 714 spin_lock_irqsave(&ha->smp_lock, flags);
714 715
715 ret_val = FALSE; 716 ret_val = FALSE;
716 if (ha->scratch_busy) { 717 if (ha->scratch_busy) {
717 if (((gdth_iord_str *)ha->pscratch)->size == (ulong32)size) 718 if (((gdth_iord_str *)ha->pscratch)->size == (u32)size)
718 ret_val = TRUE; 719 ret_val = TRUE;
719 } 720 }
720 spin_unlock_irqrestore(&ha->smp_lock, flags); 721 spin_unlock_irqrestore(&ha->smp_lock, flags);
@@ -724,11 +725,11 @@ static int gdth_ioctl_check_bin(gdth_ha_str *ha, ushort size)
724 725
725static void gdth_wait_completion(gdth_ha_str *ha, int busnum, int id) 726static void gdth_wait_completion(gdth_ha_str *ha, int busnum, int id)
726{ 727{
727 ulong flags; 728 unsigned long flags;
728 int i; 729 int i;
729 Scsi_Cmnd *scp; 730 Scsi_Cmnd *scp;
730 struct gdth_cmndinfo *cmndinfo; 731 struct gdth_cmndinfo *cmndinfo;
731 unchar b, t; 732 u8 b, t;
732 733
733 spin_lock_irqsave(&ha->smp_lock, flags); 734 spin_lock_irqsave(&ha->smp_lock, flags);
734 735
@@ -738,8 +739,8 @@ static void gdth_wait_completion(gdth_ha_str *ha, int busnum, int id)
738 739
739 b = scp->device->channel; 740 b = scp->device->channel;
740 t = scp->device->id; 741 t = scp->device->id;
741 if (!SPECIAL_SCP(scp) && t == (unchar)id && 742 if (!SPECIAL_SCP(scp) && t == (u8)id &&
742 b == (unchar)busnum) { 743 b == (u8)busnum) {
743 cmndinfo->wait_for_completion = 0; 744 cmndinfo->wait_for_completion = 0;
744 spin_unlock_irqrestore(&ha->smp_lock, flags); 745 spin_unlock_irqrestore(&ha->smp_lock, flags);
745 while (!cmndinfo->wait_for_completion) 746 while (!cmndinfo->wait_for_completion)