Print this page
8659 ata: unused but set warnings with GCC 5.X

@@ -20,10 +20,12 @@
  */
 
 /*
  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
+ *
+ * Copyright 2017 RackTop Systems.
  */
 
 #include <sys/types.h>
 #include <sys/modctl.h>
 #include <sys/debug.h>

@@ -3497,19 +3499,21 @@
  * Initialize the power management components
  */
 static void
 ata_init_pm(dev_info_t *dip)
 {
+        int             instance;
+        ata_ctl_t       *ata_ctlp;
+#ifdef  ATA_USE_AUTOPM
         char            pmc_name[16];
         char            *pmc[] = {
                                 NULL,
                                 "0=Sleep (PCI D3 State)",
                                 "3=PowerOn (PCI D0 State)",
                                 NULL
                         };
-        int             instance;
-        ata_ctl_t       *ata_ctlp;
+#endif
 
 
         instance = ddi_get_instance(dip);
         ata_ctlp = ddi_get_soft_state(ata_state, instance);
         ata_ctlp->ac_pm_support = 0;

@@ -3516,14 +3520,14 @@
 
         /* check PCI capabilities */
         if (!ata_is_pci(dip))
                 return;
 
+#ifdef  ATA_USE_AUTOPM
         (void) sprintf(pmc_name, "NAME=ata%d", instance);
         pmc[0] = pmc_name;
 
-#ifdef  ATA_USE_AUTOPM
         if (ddi_prop_update_string_array(DDI_DEV_T_NONE, dip,
             "pm-components", pmc, 3) != DDI_PROP_SUCCESS) {
                 return;
         }
 #endif