]> xenbits.xensource.com Git - seabios.git/commitdiff
Check if capability enabled in XXX_cmd_data functions.
authorKevin O'Connor <kevin@koconnor.net>
Sun, 5 Dec 2010 17:52:02 +0000 (12:52 -0500)
committerKevin O'Connor <kevin@koconnor.net>
Sun, 5 Dec 2010 17:52:02 +0000 (12:52 -0500)
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.

src/ahci.c
src/ata.c
src/usb-msc.c

index ee404d43810b7e20277161ba2da176f043ce3f2b..6c3127ae4c6421add41d784a0a9e4d07468f97b7 100644 (file)
@@ -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);
index 7079bf2d958d9f90fb4aafda61a25d46c823a71e..e5331084e2e0630132871f06fd41c5dabf285b78 100644 (file)
--- 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);
index 968cae3914d9149ef57519147ec9c8f906046733..080efdc12c1702e2af7b88a4a8d50ba3d3155cfe 100644 (file)
@@ -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(