aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2010-12-05 12:52:02 -0500
committerKevin O'Connor <kevin@koconnor.net>2010-12-05 12:52:02 -0500
commit80c2b6e91b9025e67d5b11ff7c8122506a760057 (patch)
tree0253ad6fd83a6db4a556939b297a70f7f6e81e34
parentf3fe3aa7a0ccb881e659a4281d6f0a0bb5c33cc5 (diff)
downloadseabios-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.c3
-rw-r--r--src/ata.c3
-rw-r--r--src/usb-msc.c3
3 files changed, 9 insertions, 0 deletions
diff --git a/src/ahci.c b/src/ahci.c
index ee404d4..6c3127a 100644
--- a/src/ahci.c
+++ b/src/ahci.c
@@ -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);
diff --git a/src/ata.c b/src/ata.c
index 7079bf2..e533108 100644
--- a/src/ata.c
+++ b/src/ata.c
@@ -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(