diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2010-12-05 12:52:02 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2010-12-05 12:52:02 -0500 |
commit | 80c2b6e91b9025e67d5b11ff7c8122506a760057 (patch) | |
tree | 0253ad6fd83a6db4a556939b297a70f7f6e81e34 | |
parent | f3fe3aa7a0ccb881e659a4281d6f0a0bb5c33cc5 (diff) | |
download | seabios-80c2b6e91b9025e67d5b11ff7c8122506a760057.tar.gz |
Check if capability enabled in XXX_cmd_data functions.
Make sure to check if CONFIG_AHCI, CONFIG_ATA, CONFIG_USB_MSC is
enabled in their respective cmd_data functions. This reduces the
compile size when they are not enabled.
-rw-r--r-- | src/ahci.c | 3 | ||||
-rw-r--r-- | src/ata.c | 3 | ||||
-rw-r--r-- | src/usb-msc.c | 3 |
3 files changed, 9 insertions, 0 deletions
@@ -155,6 +155,9 @@ static int ahci_command(struct ahci_port_s *port, int iswrite, int isatapi, int ahci_cmd_data(struct disk_op_s *op, void *cdbcmd, u16 blocksize) { + if (! CONFIG_AHCI) + return 0; + struct ahci_port_s *port = container_of( op->drive_g, struct ahci_port_s, drive); struct ahci_cmd_s *cmd = GET_GLOBAL(port->cmd); @@ -602,6 +602,9 @@ process_ata_op(struct disk_op_s *op) int atapi_cmd_data(struct disk_op_s *op, void *cdbcmd, u16 blocksize) { + if (! CONFIG_ATA) + return 0; + struct atadrive_s *adrive_g = container_of( op->drive_g, struct atadrive_s, drive); struct ata_channel_s *chan_gf = GET_GLOBAL(adrive_g->chan_gf); diff --git a/src/usb-msc.c b/src/usb-msc.c index 968cae3..080efdc 100644 --- a/src/usb-msc.c +++ b/src/usb-msc.c @@ -50,6 +50,9 @@ struct csw_s { int usb_cmd_data(struct disk_op_s *op, void *cdbcmd, u16 blocksize) { + if (!CONFIG_USB_MSC) + return 0; + dprintf(16, "usb_cmd_data id=%p write=%d count=%d bs=%d buf=%p\n" , op->drive_g, 0, op->count, blocksize, op->buf_fl); struct usbdrive_s *udrive_g = container_of( |