public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Pavel Herrmann <morpheus.ibis@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 2/2] Fix checkpatch warnings about externs in *.c
Date: Fri, 28 Sep 2012 11:18:04 +0200	[thread overview]
Message-ID: <1348823884-17187-2-git-send-email-morpheus.ibis@gmail.com> (raw)
In-Reply-To: <1348823884-17187-1-git-send-email-morpheus.ibis@gmail.com>

Move all extern declarations of sata_dev_desc[] into <sata.h> to make checkpatch
happy, inslude <sata.h> in every sata driver, and remove now duplicit
declarations of sata API functions.

Signed-off-by: Pavel Herrmann <morpheus.ibis@gmail.com>
---
Changes for v2:
 use include/sata.h instead of a separate header file

 drivers/block/ata_piix.c     | 4 +---
 drivers/block/ata_piix.h     | 2 --
 drivers/block/dwc_ahsata.c   | 1 +
 drivers/block/dwc_ahsata.h   | 2 --
 drivers/block/fsl_sata.c     | 3 +--
 drivers/block/pata_bfin.c    | 1 +
 drivers/block/pata_bfin.h    | 2 --
 drivers/block/sata_dwc.c     | 3 +--
 drivers/block/sata_sil.c     | 1 +
 drivers/block/sata_sil.h     | 2 --
 drivers/block/sata_sil3114.c | 2 +-
 include/sata.h               | 3 +++
 12 files changed, 10 insertions(+), 16 deletions(-)

diff --git a/drivers/block/ata_piix.c b/drivers/block/ata_piix.c
index 1c3ab8a..d18af73 100644
--- a/drivers/block/ata_piix.c
+++ b/drivers/block/ata_piix.c
@@ -34,9 +34,7 @@
 #include <part.h>
 #include <ide.h>
 #include <ata.h>
-
-extern block_dev_desc_t sata_dev_desc[CONFIG_SYS_SATA_MAX_DEVICE];
-extern int sata_curr_device;
+#include <sata.h>
 
 #define DEBUG_SATA 0		/*For debug prints set DEBUG_SATA to 1 */
 
diff --git a/drivers/block/ata_piix.h b/drivers/block/ata_piix.h
index 9157cf8..6d8988d 100644
--- a/drivers/block/ata_piix.h
+++ b/drivers/block/ata_piix.h
@@ -63,8 +63,6 @@ int sata_devchk (struct sata_ioports *ioaddr, int dev);
 void dev_select (struct sata_ioports *ioaddr, int dev);
 u8 sata_busy_wait (struct sata_ioports *ioaddr, int bits, unsigned int max);
 u8 sata_chk_status (struct sata_ioports *ioaddr);
-ulong sata_read (int device, ulong blknr,lbaint_t blkcnt, void * buffer);
-ulong sata_write (int device,ulong blknr, lbaint_t blkcnt, void * buffer);
 void msleep (int count);
 #endif
 
diff --git a/drivers/block/dwc_ahsata.c b/drivers/block/dwc_ahsata.c
index 2703d3d..7b06c81 100644
--- a/drivers/block/dwc_ahsata.c
+++ b/drivers/block/dwc_ahsata.c
@@ -24,6 +24,7 @@
 #include <libata.h>
 #include <ahci.h>
 #include <fis.h>
+#include <sata.h>
 
 #include <common.h>
 #include <malloc.h>
diff --git a/drivers/block/dwc_ahsata.h b/drivers/block/dwc_ahsata.h
index 84860ea..4dac5dc 100644
--- a/drivers/block/dwc_ahsata.h
+++ b/drivers/block/dwc_ahsata.h
@@ -330,6 +330,4 @@
 #define READ_CMD	0
 #define WRITE_CMD	1
 
-extern block_dev_desc_t sata_dev_desc[CONFIG_SYS_SATA_MAX_DEVICE];
-
 #endif /* __FSL_SATA_H__ */
diff --git a/drivers/block/fsl_sata.c b/drivers/block/fsl_sata.c
index 3026ade..88f3891 100644
--- a/drivers/block/fsl_sata.c
+++ b/drivers/block/fsl_sata.c
@@ -26,10 +26,9 @@
 #include <malloc.h>
 #include <libata.h>
 #include <fis.h>
+#include <sata.h>
 #include "fsl_sata.h"
 
-extern block_dev_desc_t sata_dev_desc[CONFIG_SYS_SATA_MAX_DEVICE];
-
 #ifndef CONFIG_SYS_SATA1_FLAGS
 	#define CONFIG_SYS_SATA1_FLAGS	FLAGS_DMA
 #endif
diff --git a/drivers/block/pata_bfin.c b/drivers/block/pata_bfin.c
index cce21fb..a42a7b8 100644
--- a/drivers/block/pata_bfin.c
+++ b/drivers/block/pata_bfin.c
@@ -17,6 +17,7 @@
 #include <asm/portmux.h>
 #include <asm/mach-common/bits/pata.h>
 #include <ata.h>
+#include <sata.h>
 #include <libata.h>
 #include "pata_bfin.h"
 
diff --git a/drivers/block/pata_bfin.h b/drivers/block/pata_bfin.h
index 2b3425b..2093cf0 100644
--- a/drivers/block/pata_bfin.h
+++ b/drivers/block/pata_bfin.h
@@ -41,8 +41,6 @@ struct ata_port {
 	unsigned char dev_mask;
 };
 
-extern block_dev_desc_t sata_dev_desc[CONFIG_SYS_SATA_MAX_DEVICE];
-
 #define DRV_NAME		"pata-bfin"
 #define DRV_VERSION		"0.9"
 #define __iomem
diff --git a/drivers/block/sata_dwc.c b/drivers/block/sata_dwc.c
index 75101b5..ba98ecd 100644
--- a/drivers/block/sata_dwc.c
+++ b/drivers/block/sata_dwc.c
@@ -35,6 +35,7 @@
 #include <asm/io.h>
 #include <malloc.h>
 #include <ata.h>
+#include <sata.h>
 #include <linux/ctype.h>
 
 #include "sata_dwc.h"
@@ -268,8 +269,6 @@ static int ata_dev_read_id(struct ata_device *dev, unsigned int *p_class,
 		unsigned int flags, u16 *id);
 static int check_sata_dev_state(void);
 
-extern block_dev_desc_t sata_dev_desc[CONFIG_SYS_SATA_MAX_DEVICE];
-
 static const struct ata_port_info sata_dwc_port_info[] = {
 	{
 		.flags		= ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY |
diff --git a/drivers/block/sata_sil.c b/drivers/block/sata_sil.c
index fb7cd2a..8e8d4fb 100644
--- a/drivers/block/sata_sil.c
+++ b/drivers/block/sata_sil.c
@@ -25,6 +25,7 @@
 #include <malloc.h>
 #include <asm/io.h>
 #include <fis.h>
+#include <sata.h>
 #include <libata.h>
 #include "sata_sil.h"
 
diff --git a/drivers/block/sata_sil.h b/drivers/block/sata_sil.h
index 2dfd4a5..9f3a37f 100644
--- a/drivers/block/sata_sil.h
+++ b/drivers/block/sata_sil.h
@@ -24,8 +24,6 @@
 #define READ_CMD	0
 #define WRITE_CMD	1
 
-extern block_dev_desc_t sata_dev_desc[CONFIG_SYS_SATA_MAX_DEVICE];
-
 /*
  * SATA device driver struct for each dev
  */
diff --git a/drivers/block/sata_sil3114.c b/drivers/block/sata_sil3114.c
index 34fe038..3a5e032 100644
--- a/drivers/block/sata_sil3114.c
+++ b/drivers/block/sata_sil3114.c
@@ -28,6 +28,7 @@
 #include <asm/byteorder.h>
 #include <asm/io.h>
 #include <ide.h>
+#include <sata.h>
 #include <libata.h>
 #include "sata_sil3114.h"
 
@@ -48,7 +49,6 @@ static u8 sata_chk_status (struct sata_ioports *ioaddr, u8 usealtstatus);
 static void msleep (int count);
 
 static u32 iobase[6] = { 0, 0, 0, 0, 0, 0};	/* PCI BAR registers for device */
-extern block_dev_desc_t sata_dev_desc[CONFIG_SYS_SATA_MAX_DEVICE];
 
 static struct sata_port port[CONFIG_SYS_SATA_MAX_DEVICE];
 
diff --git a/include/sata.h b/include/sata.h
index 37573cf..52c3033 100644
--- a/include/sata.h
+++ b/include/sata.h
@@ -1,5 +1,6 @@
 #ifndef __SATA_H__
 #define __SATA_H__
+#include <part.h>
 
 int init_sata(int dev);
 int scan_sata(int dev);
@@ -9,4 +10,6 @@ ulong sata_write(int dev, ulong blknr, ulong blkcnt, const void *buffer);
 int sata_initialize(void);
 int __sata_initialize(void);
 
+extern block_dev_desc_t sata_dev_desc[CONFIG_SYS_SATA_MAX_DEVICE];
+
 #endif
-- 
1.7.12

  reply	other threads:[~2012-09-28  9:18 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-16 11:53 [U-Boot] [PATCH] Fix checkpatch warnings about externs in *.c Pavel Herrmann
2012-09-16 12:37 ` Marek Vasut
2012-09-16 12:59   ` Pavel Herrmann
2012-09-16 13:11     ` Marek Vasut
2012-09-17 19:05     ` Tom Rini
2012-09-28  9:18 ` [U-Boot] [PATCH 1/2] remove unnecessary code in ata_piix Pavel Herrmann
2012-09-28  9:18   ` Pavel Herrmann [this message]
2012-09-28 18:13     ` [U-Boot] [PATCH v2 2/2] Fix checkpatch warnings about externs in *.c Marek Vasut
2012-09-28 19:39     ` Tom Rini
2012-09-28 18:12   ` [U-Boot] [PATCH 1/2] remove unnecessary code in ata_piix Marek Vasut
2012-09-28 18:29     ` Tom Rini
2012-09-29 14:52   ` [U-Boot] [U-Boot,1/2] " Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1348823884-17187-2-git-send-email-morpheus.ibis@gmail.com \
    --to=morpheus.ibis@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox