diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-01-25 16:17:06 -0500 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-01-25 16:17:06 -0500 |
commit | cd2a2d969761c26542095c01324201ca0b3ee896 (patch) | |
tree | fa95d329ac2f2ae3fca30833b8b0ec91aefbd243 | |
parent | 1c029fd658baa2442e8e51dc9c819301cad95777 (diff) |
ide: remove task_ioreg_t typedef (take 2)
Remove task_ioreg_t typedef from the kernel code (but leave it
in <linux/hdreg.h> for #ifndef/#endif __KERNEL__ case).
While at it also move sata_ioreg_t typedef under #ifndef/#endif __KERNEL__.
v2:
Remove name of the second parameter from ide_execute_command() declaration.
(Noticed by Sergei).
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
-rw-r--r-- | drivers/ide/ide-disk.c | 20 | ||||
-rw-r--r-- | drivers/ide/ide-iops.c | 5 | ||||
-rw-r--r-- | drivers/ide/ide-taskfile.c | 4 | ||||
-rw-r--r-- | include/linux/hdreg.h | 46 | ||||
-rw-r--r-- | include/linux/ide.h | 7 |
5 files changed, 42 insertions, 40 deletions
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c index b1781908e1f2..322c4691836a 100644 --- a/drivers/ide/ide-disk.c +++ b/drivers/ide/ide-disk.c | |||
@@ -138,7 +138,7 @@ static ide_startstop_t __ide_do_rw_disk(ide_drive_t *drive, struct request *rq, | |||
138 | ide_hwif_t *hwif = HWIF(drive); | 138 | ide_hwif_t *hwif = HWIF(drive); |
139 | unsigned int dma = drive->using_dma; | 139 | unsigned int dma = drive->using_dma; |
140 | u8 lba48 = (drive->addressing == 1) ? 1 : 0; | 140 | u8 lba48 = (drive->addressing == 1) ? 1 : 0; |
141 | task_ioreg_t command = WIN_NOP; | 141 | u8 command = WIN_NOP; |
142 | ata_nsector_t nsectors; | 142 | ata_nsector_t nsectors; |
143 | 143 | ||
144 | nsectors.all = (u16) rq->nr_sectors; | 144 | nsectors.all = (u16) rq->nr_sectors; |
@@ -162,7 +162,7 @@ static ide_startstop_t __ide_do_rw_disk(ide_drive_t *drive, struct request *rq, | |||
162 | 162 | ||
163 | if (drive->select.b.lba) { | 163 | if (drive->select.b.lba) { |
164 | if (lba48) { | 164 | if (lba48) { |
165 | task_ioreg_t tasklets[10]; | 165 | u8 tasklets[10]; |
166 | 166 | ||
167 | pr_debug("%s: LBA=0x%012llx\n", drive->name, | 167 | pr_debug("%s: LBA=0x%012llx\n", drive->name, |
168 | (unsigned long long)block); | 168 | (unsigned long long)block); |
@@ -171,16 +171,16 @@ static ide_startstop_t __ide_do_rw_disk(ide_drive_t *drive, struct request *rq, | |||
171 | tasklets[1] = 0; | 171 | tasklets[1] = 0; |
172 | tasklets[2] = nsectors.b.low; | 172 | tasklets[2] = nsectors.b.low; |
173 | tasklets[3] = nsectors.b.high; | 173 | tasklets[3] = nsectors.b.high; |
174 | tasklets[4] = (task_ioreg_t) block; | 174 | tasklets[4] = (u8) block; |
175 | tasklets[5] = (task_ioreg_t) (block>>8); | 175 | tasklets[5] = (u8)(block >> 8); |
176 | tasklets[6] = (task_ioreg_t) (block>>16); | 176 | tasklets[6] = (u8)(block >> 16); |
177 | tasklets[7] = (task_ioreg_t) (block>>24); | 177 | tasklets[7] = (u8)(block >> 24); |
178 | if (sizeof(block) == 4) { | 178 | if (sizeof(block) == 4) { |
179 | tasklets[8] = (task_ioreg_t) 0; | 179 | tasklets[8] = 0; |
180 | tasklets[9] = (task_ioreg_t) 0; | 180 | tasklets[9] = 0; |
181 | } else { | 181 | } else { |
182 | tasklets[8] = (task_ioreg_t)((u64)block >> 32); | 182 | tasklets[8] = (u8)((u64)block >> 32); |
183 | tasklets[9] = (task_ioreg_t)((u64)block >> 40); | 183 | tasklets[9] = (u8)((u64)block >> 40); |
184 | } | 184 | } |
185 | #ifdef DEBUG | 185 | #ifdef DEBUG |
186 | printk("%s: 0x%02x%02x 0x%02x%02x%02x%02x%02x%02x\n", | 186 | printk("%s: 0x%02x%02x 0x%02x%02x%02x%02x%02x%02x\n", |
diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c index bb9693dabe41..f4e8a0cf06e2 100644 --- a/drivers/ide/ide-iops.c +++ b/drivers/ide/ide-iops.c | |||
@@ -902,8 +902,9 @@ EXPORT_SYMBOL(ide_set_handler); | |||
902 | * handler and IRQ setup do not race. All IDE command kick off | 902 | * handler and IRQ setup do not race. All IDE command kick off |
903 | * should go via this function or do equivalent locking. | 903 | * should go via this function or do equivalent locking. |
904 | */ | 904 | */ |
905 | 905 | ||
906 | void ide_execute_command(ide_drive_t *drive, task_ioreg_t cmd, ide_handler_t *handler, unsigned timeout, ide_expiry_t *expiry) | 906 | void ide_execute_command(ide_drive_t *drive, u8 cmd, ide_handler_t *handler, |
907 | unsigned timeout, ide_expiry_t *expiry) | ||
907 | { | 908 | { |
908 | unsigned long flags; | 909 | unsigned long flags; |
909 | ide_hwgroup_t *hwgroup = HWGROUP(drive); | 910 | ide_hwgroup_t *hwgroup = HWGROUP(drive); |
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c index 2b60f1b0437e..91948a46cc6e 100644 --- a/drivers/ide/ide-taskfile.c +++ b/drivers/ide/ide-taskfile.c | |||
@@ -519,8 +519,8 @@ int ide_taskfile_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg) | |||
519 | ide_task_t args; | 519 | ide_task_t args; |
520 | u8 *outbuf = NULL; | 520 | u8 *outbuf = NULL; |
521 | u8 *inbuf = NULL; | 521 | u8 *inbuf = NULL; |
522 | task_ioreg_t *argsptr = args.tfRegister; | 522 | u8 *argsptr = args.tfRegister; |
523 | task_ioreg_t *hobsptr = args.hobRegister; | 523 | u8 *hobsptr = args.hobRegister; |
524 | int err = 0; | 524 | int err = 0; |
525 | int tasksize = sizeof(struct ide_task_request_s); | 525 | int tasksize = sizeof(struct ide_task_request_s); |
526 | unsigned int taskin = 0; | 526 | unsigned int taskin = 0; |
diff --git a/include/linux/hdreg.h b/include/linux/hdreg.h index 818c6afc1091..3bcb88560418 100644 --- a/include/linux/hdreg.h +++ b/include/linux/hdreg.h | |||
@@ -87,10 +87,10 @@ | |||
87 | #ifndef __KERNEL__ | 87 | #ifndef __KERNEL__ |
88 | #define IDE_TASKFILE_STD_OUT_FLAGS 0xFE | 88 | #define IDE_TASKFILE_STD_OUT_FLAGS 0xFE |
89 | #define IDE_HOB_STD_OUT_FLAGS 0x3C | 89 | #define IDE_HOB_STD_OUT_FLAGS 0x3C |
90 | #endif | ||
91 | 90 | ||
92 | typedef unsigned char task_ioreg_t; | 91 | typedef unsigned char task_ioreg_t; |
93 | typedef unsigned long sata_ioreg_t; | 92 | typedef unsigned long sata_ioreg_t; |
93 | #endif | ||
94 | 94 | ||
95 | typedef union ide_reg_valid_s { | 95 | typedef union ide_reg_valid_s { |
96 | unsigned all : 16; | 96 | unsigned all : 16; |
@@ -116,8 +116,8 @@ typedef union ide_reg_valid_s { | |||
116 | } ide_reg_valid_t; | 116 | } ide_reg_valid_t; |
117 | 117 | ||
118 | typedef struct ide_task_request_s { | 118 | typedef struct ide_task_request_s { |
119 | task_ioreg_t io_ports[8]; | 119 | __u8 io_ports[8]; |
120 | task_ioreg_t hob_ports[8]; | 120 | __u8 hob_ports[8]; |
121 | ide_reg_valid_t out_flags; | 121 | ide_reg_valid_t out_flags; |
122 | ide_reg_valid_t in_flags; | 122 | ide_reg_valid_t in_flags; |
123 | int data_phase; | 123 | int data_phase; |
@@ -133,32 +133,32 @@ typedef struct ide_ioctl_request_s { | |||
133 | } ide_ioctl_request_t; | 133 | } ide_ioctl_request_t; |
134 | 134 | ||
135 | struct hd_drive_cmd_hdr { | 135 | struct hd_drive_cmd_hdr { |
136 | task_ioreg_t command; | 136 | __u8 command; |
137 | task_ioreg_t sector_number; | 137 | __u8 sector_number; |
138 | task_ioreg_t feature; | 138 | __u8 feature; |
139 | task_ioreg_t sector_count; | 139 | __u8 sector_count; |
140 | }; | 140 | }; |
141 | 141 | ||
142 | typedef struct hd_drive_task_hdr { | 142 | typedef struct hd_drive_task_hdr { |
143 | task_ioreg_t data; | 143 | __u8 data; |
144 | task_ioreg_t feature; | 144 | __u8 feature; |
145 | task_ioreg_t sector_count; | 145 | __u8 sector_count; |
146 | task_ioreg_t sector_number; | 146 | __u8 sector_number; |
147 | task_ioreg_t low_cylinder; | 147 | __u8 low_cylinder; |
148 | task_ioreg_t high_cylinder; | 148 | __u8 high_cylinder; |
149 | task_ioreg_t device_head; | 149 | __u8 device_head; |
150 | task_ioreg_t command; | 150 | __u8 command; |
151 | } task_struct_t; | 151 | } task_struct_t; |
152 | 152 | ||
153 | typedef struct hd_drive_hob_hdr { | 153 | typedef struct hd_drive_hob_hdr { |
154 | task_ioreg_t data; | 154 | __u8 data; |
155 | task_ioreg_t feature; | 155 | __u8 feature; |
156 | task_ioreg_t sector_count; | 156 | __u8 sector_count; |
157 | task_ioreg_t sector_number; | 157 | __u8 sector_number; |
158 | task_ioreg_t low_cylinder; | 158 | __u8 low_cylinder; |
159 | task_ioreg_t high_cylinder; | 159 | __u8 high_cylinder; |
160 | task_ioreg_t device_head; | 160 | __u8 device_head; |
161 | task_ioreg_t control; | 161 | __u8 control; |
162 | } hob_struct_t; | 162 | } hob_struct_t; |
163 | 163 | ||
164 | #define TASKFILE_INVALID 0x7fff | 164 | #define TASKFILE_INVALID 0x7fff |
diff --git a/include/linux/ide.h b/include/linux/ide.h index 1fb03b630676..66a38f101175 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -1019,7 +1019,8 @@ int ide_end_dequeued_request(ide_drive_t *drive, struct request *rq, | |||
1019 | 1019 | ||
1020 | extern void ide_set_handler (ide_drive_t *drive, ide_handler_t *handler, unsigned int timeout, ide_expiry_t *expiry); | 1020 | extern void ide_set_handler (ide_drive_t *drive, ide_handler_t *handler, unsigned int timeout, ide_expiry_t *expiry); |
1021 | 1021 | ||
1022 | extern void ide_execute_command(ide_drive_t *, task_ioreg_t cmd, ide_handler_t *, unsigned int, ide_expiry_t *); | 1022 | void ide_execute_command(ide_drive_t *, u8, ide_handler_t *, unsigned int, |
1023 | ide_expiry_t *); | ||
1023 | 1024 | ||
1024 | ide_startstop_t __ide_error(ide_drive_t *, struct request *, u8, u8); | 1025 | ide_startstop_t __ide_error(ide_drive_t *, struct request *, u8, u8); |
1025 | 1026 | ||
@@ -1068,8 +1069,8 @@ typedef struct ide_task_s { | |||
1068 | * struct hd_drive_hob_hdr hobf; | 1069 | * struct hd_drive_hob_hdr hobf; |
1069 | * hob_struct_t hobf; | 1070 | * hob_struct_t hobf; |
1070 | */ | 1071 | */ |
1071 | task_ioreg_t tfRegister[8]; | 1072 | u8 tfRegister[8]; |
1072 | task_ioreg_t hobRegister[8]; | 1073 | u8 hobRegister[8]; |
1073 | ide_reg_valid_t tf_out_flags; | 1074 | ide_reg_valid_t tf_out_flags; |
1074 | ide_reg_valid_t tf_in_flags; | 1075 | ide_reg_valid_t tf_in_flags; |
1075 | int data_phase; | 1076 | int data_phase; |