diff options
author | Tejun Heo <htejun@gmail.com> | 2008-04-02 04:28:46 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2008-04-04 02:43:35 -0400 |
commit | 436d34b36202ef724778ded1e9cb10f8c37b32bc (patch) | |
tree | 45671994cf049263a25e7f540ae488b97bb7d01f | |
parent | a4ba7fe2a6c2b61419b290035bff398ab2591c54 (diff) |
libata: uninline atapi_cmd_type()
Uninline atapi_cmd_type(). It doesn't really have to be inline and
more case will be added which need to access unexported libata
variable.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
-rw-r--r-- | drivers/ata/libata-core.c | 34 | ||||
-rw-r--r-- | include/linux/libata.h | 22 |
2 files changed, 35 insertions, 21 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 2db5c9c9ca10..e9b69ba489d2 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -326,6 +326,39 @@ static void ata_force_horkage(struct ata_device *dev) | |||
326 | } | 326 | } |
327 | 327 | ||
328 | /** | 328 | /** |
329 | * atapi_cmd_type - Determine ATAPI command type from SCSI opcode | ||
330 | * @opcode: SCSI opcode | ||
331 | * | ||
332 | * Determine ATAPI command type from @opcode. | ||
333 | * | ||
334 | * LOCKING: | ||
335 | * None. | ||
336 | * | ||
337 | * RETURNS: | ||
338 | * ATAPI_{READ|WRITE|READ_CD|PASS_THRU|MISC} | ||
339 | */ | ||
340 | int atapi_cmd_type(u8 opcode) | ||
341 | { | ||
342 | switch (opcode) { | ||
343 | case GPCMD_READ_10: | ||
344 | case GPCMD_READ_12: | ||
345 | return ATAPI_READ; | ||
346 | |||
347 | case GPCMD_WRITE_10: | ||
348 | case GPCMD_WRITE_12: | ||
349 | case GPCMD_WRITE_AND_VERIFY_10: | ||
350 | return ATAPI_WRITE; | ||
351 | |||
352 | case GPCMD_READ_CD: | ||
353 | case GPCMD_READ_CD_MSF: | ||
354 | return ATAPI_READ_CD; | ||
355 | |||
356 | default: | ||
357 | return ATAPI_MISC; | ||
358 | } | ||
359 | } | ||
360 | |||
361 | /** | ||
329 | * ata_tf_to_fis - Convert ATA taskfile to SATA FIS structure | 362 | * ata_tf_to_fis - Convert ATA taskfile to SATA FIS structure |
330 | * @tf: Taskfile to convert | 363 | * @tf: Taskfile to convert |
331 | * @pmp: Port multiplier port | 364 | * @pmp: Port multiplier port |
@@ -7774,6 +7807,7 @@ EXPORT_SYMBOL_GPL(ata_tf_read); | |||
7774 | EXPORT_SYMBOL_GPL(ata_noop_dev_select); | 7807 | EXPORT_SYMBOL_GPL(ata_noop_dev_select); |
7775 | EXPORT_SYMBOL_GPL(ata_std_dev_select); | 7808 | EXPORT_SYMBOL_GPL(ata_std_dev_select); |
7776 | EXPORT_SYMBOL_GPL(sata_print_link_status); | 7809 | EXPORT_SYMBOL_GPL(sata_print_link_status); |
7810 | EXPORT_SYMBOL_GPL(atapi_cmd_type); | ||
7777 | EXPORT_SYMBOL_GPL(ata_tf_to_fis); | 7811 | EXPORT_SYMBOL_GPL(ata_tf_to_fis); |
7778 | EXPORT_SYMBOL_GPL(ata_tf_from_fis); | 7812 | EXPORT_SYMBOL_GPL(ata_tf_from_fis); |
7779 | EXPORT_SYMBOL_GPL(ata_pack_xfermask); | 7813 | EXPORT_SYMBOL_GPL(ata_pack_xfermask); |
diff --git a/include/linux/libata.h b/include/linux/libata.h index b064bfeb69ee..92c64909ed25 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -849,6 +849,7 @@ extern unsigned int ata_dev_try_classify(struct ata_device *dev, int present, | |||
849 | */ | 849 | */ |
850 | extern void ata_tf_load(struct ata_port *ap, const struct ata_taskfile *tf); | 850 | extern void ata_tf_load(struct ata_port *ap, const struct ata_taskfile *tf); |
851 | extern void ata_tf_read(struct ata_port *ap, struct ata_taskfile *tf); | 851 | extern void ata_tf_read(struct ata_port *ap, struct ata_taskfile *tf); |
852 | extern int atapi_cmd_type(u8 opcode); | ||
852 | extern void ata_tf_to_fis(const struct ata_taskfile *tf, | 853 | extern void ata_tf_to_fis(const struct ata_taskfile *tf, |
853 | u8 pmp, int is_cmd, u8 *fis); | 854 | u8 pmp, int is_cmd, u8 *fis); |
854 | extern void ata_tf_from_fis(const u8 *fis, struct ata_taskfile *tf); | 855 | extern void ata_tf_from_fis(const u8 *fis, struct ata_taskfile *tf); |
@@ -1379,27 +1380,6 @@ static inline int ata_try_flush_cache(const struct ata_device *dev) | |||
1379 | ata_id_has_flush_ext(dev->id); | 1380 | ata_id_has_flush_ext(dev->id); |
1380 | } | 1381 | } |
1381 | 1382 | ||
1382 | static inline int atapi_cmd_type(u8 opcode) | ||
1383 | { | ||
1384 | switch (opcode) { | ||
1385 | case GPCMD_READ_10: | ||
1386 | case GPCMD_READ_12: | ||
1387 | return ATAPI_READ; | ||
1388 | |||
1389 | case GPCMD_WRITE_10: | ||
1390 | case GPCMD_WRITE_12: | ||
1391 | case GPCMD_WRITE_AND_VERIFY_10: | ||
1392 | return ATAPI_WRITE; | ||
1393 | |||
1394 | case GPCMD_READ_CD: | ||
1395 | case GPCMD_READ_CD_MSF: | ||
1396 | return ATAPI_READ_CD; | ||
1397 | |||
1398 | default: | ||
1399 | return ATAPI_MISC; | ||
1400 | } | ||
1401 | } | ||
1402 | |||
1403 | static inline unsigned int ac_err_mask(u8 status) | 1383 | static inline unsigned int ac_err_mask(u8 status) |
1404 | { | 1384 | { |
1405 | if (status & (ATA_BUSY | ATA_DRQ)) | 1385 | if (status & (ATA_BUSY | ATA_DRQ)) |