Skip to contentSkip to conversation

libata: make functions/variables static

PATCH Applied Robert Hancock 2 participants 2 messages Jan 20, 2010 libata

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libata: make functions/variables static

Make some variables in ahci and a function in pata_pcmcia static, as found using sparse.

drivers/ata/ahci.c +4 -4
index b8bea10..265d0d4 100644
@@ -356,10 +356,10 @@ static ssize_t ahci_show_host_version(struct device *dev,
 static ssize_t ahci_show_port_cmd(struct device *dev,
 				  struct device_attribute *attr, char *buf);
 
-DEVICE_ATTR(ahci_host_caps, S_IRUGO, ahci_show_host_caps, NULL);
-DEVICE_ATTR(ahci_host_cap2, S_IRUGO, ahci_show_host_cap2, NULL);
-DEVICE_ATTR(ahci_host_version, S_IRUGO, ahci_show_host_version, NULL);
-DEVICE_ATTR(ahci_port_cmd, S_IRUGO, ahci_show_port_cmd, NULL);
+static DEVICE_ATTR(ahci_host_caps, S_IRUGO, ahci_show_host_caps, NULL);
+static DEVICE_ATTR(ahci_host_cap2, S_IRUGO, ahci_show_host_cap2, NULL);
+static DEVICE_ATTR(ahci_host_version, S_IRUGO, ahci_show_host_version, NULL);
+static DEVICE_ATTR(ahci_port_cmd, S_IRUGO, ahci_show_port_cmd, NULL);
 
 static struct device_attribute *ahci_shost_attrs[] = {
 	&dev_attr_link_power_management_policy,
drivers/ata/pata_pcmcia.c +1 -1
index 1b392c9..3610353 100644
@@ -136,7 +136,7 @@ static unsigned int ata_data_xfer_8bit(struct ata_device *dev,
  *
  */
  
-void pcmcia_8bit_drain_fifo(struct ata_queued_cmd *qc)
+static void pcmcia_8bit_drain_fifo(struct ata_queued_cmd *qc)
 {
 	int count;
 	struct ata_port *ap;
Applied
#1 lore raw
Quoted 30 lines · Robert Hancock

Make some variables in ahci and a function in pata_pcmcia static, as found using sparse.

drivers/ata/ahci.c +4 -4
index b8bea10..265d0d4 100644
@@ -356,10 +356,10 @@ static ssize_t ahci_show_host_version(struct device *dev,
  static ssize_t ahci_show_port_cmd(struct device *dev,
  				  struct device_attribute *attr, char *buf);
 
-DEVICE_ATTR(ahci_host_caps, S_IRUGO, ahci_show_host_caps, NULL);
-DEVICE_ATTR(ahci_host_cap2, S_IRUGO, ahci_show_host_cap2, NULL);
-DEVICE_ATTR(ahci_host_version, S_IRUGO, ahci_show_host_version, NULL);
-DEVICE_ATTR(ahci_port_cmd, S_IRUGO, ahci_show_port_cmd, NULL);
+static DEVICE_ATTR(ahci_host_caps, S_IRUGO, ahci_show_host_caps, NULL);
+static DEVICE_ATTR(ahci_host_cap2, S_IRUGO, ahci_show_host_cap2, NULL);
+static DEVICE_ATTR(ahci_host_version, S_IRUGO, ahci_show_host_version, NULL);
+static DEVICE_ATTR(ahci_port_cmd, S_IRUGO, ahci_show_port_cmd, NULL);
 
  static struct device_attribute *ahci_shost_attrs[] = {
  	&dev_attr_link_power_management_policy,
drivers/ata/pata_pcmcia.c +0 -0
index 1b392c9..3610353 100644

drivers/ata/pata_pcmcia.c static unsigned int ata_data_xfer_8bit(struct ata_device *dev, · line 142

Quoted 8 lines
drivers/ata/pata_pcmcia.c +1 -1
@@ -136,7 +136,7 @@ static unsigned int ata_data_xfer_8bit(struct ata_device *dev,
   *
   */
 
-void pcmcia_8bit_drain_fifo(struct ata_queued_cmd *qc)
+static void pcmcia_8bit_drain_fifo(struct ata_queued_cmd *qc)
  {
  	int count;
  	struct ata_port *ap;

applied