[PATCH v2 11/30] ide: Make function static

Simon Glass sjg at chromium.org
Tue Apr 25 18:54:36 CEST 2023


Only one function is called from outside this file. Make all the others
static.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

(no changes since v1)

 drivers/block/ide.c | 23 +++++++++++------------
 include/ide.h       | 11 -----------
 2 files changed, 11 insertions(+), 23 deletions(-)

diff --git a/drivers/block/ide.c b/drivers/block/ide.c
index 875192cba16..1d5e54d6eb9 100644
--- a/drivers/block/ide.c
+++ b/drivers/block/ide.c
@@ -219,8 +219,8 @@ static uchar atapi_wait_mask(int dev, ulong t, uchar mask, uchar res)
 /*
  * issue an atapi command
  */
-unsigned char atapi_issue(int device, unsigned char *ccb, int ccblen,
-			  unsigned char *buffer, int buflen)
+static unsigned char atapi_issue(int device, unsigned char *ccb, int ccblen,
+				 unsigned char *buffer, int buflen)
 {
 	unsigned char c, err, mask, res;
 	int n;
@@ -343,10 +343,9 @@ AI_OUT:
 #define ATAPI_DRIVE_NOT_READY	100
 #define ATAPI_UNIT_ATTN		10
 
-unsigned char atapi_issue_autoreq(int device,
-				  unsigned char *ccb,
-				  int ccblen,
-				  unsigned char *buffer, int buflen)
+static unsigned char atapi_issue_autoreq(int device, unsigned char *ccb,
+					 int ccblen,
+					 unsigned char *buffer, int buflen)
 {
 	unsigned char sense_data[18], sense_ccb[12];
 	unsigned char res, key, asc, ascq;
@@ -421,8 +420,8 @@ error:
 #define ATAPI_READ_BLOCK_SIZE	2048	/* assuming CD part */
 #define ATAPI_READ_MAX_BLOCK	(ATAPI_READ_MAX_BYTES/ATAPI_READ_BLOCK_SIZE)
 
-ulong atapi_read(struct udevice *dev, lbaint_t blknr, lbaint_t blkcnt,
-		 void *buffer)
+static ulong atapi_read(struct udevice *dev, lbaint_t blknr, lbaint_t blkcnt,
+			void *buffer)
 {
 	struct blk_desc *block_dev = dev_get_uclass_plat(dev);
 	int device = block_dev->devnum;
@@ -810,8 +809,8 @@ static void ide_input_data(int dev, ulong *sect_buf, int words)
 	}
 }
 
-ulong ide_read(struct udevice *dev, lbaint_t blknr, lbaint_t blkcnt,
-	       void *buffer)
+static ulong ide_read(struct udevice *dev, lbaint_t blknr, lbaint_t blkcnt,
+		      void *buffer)
 {
 	struct blk_desc *block_dev = dev_get_uclass_plat(dev);
 	int device = block_dev->devnum;
@@ -930,8 +929,8 @@ IDE_READ_E:
 	return n;
 }
 
-ulong ide_write(struct udevice *dev, lbaint_t blknr, lbaint_t blkcnt,
-		const void *buffer)
+static ulong ide_write(struct udevice *dev, lbaint_t blknr, lbaint_t blkcnt,
+		       const void *buffer)
 {
 	struct blk_desc *block_dev = dev_get_uclass_plat(dev);
 	int device = block_dev->devnum;
diff --git a/include/ide.h b/include/ide.h
index b586ba3df4b..2c25e74ede0 100644
--- a/include/ide.h
+++ b/include/ide.h
@@ -11,17 +11,6 @@
 
 #define IDE_BUS(dev)	(dev / (CONFIG_SYS_IDE_MAXDEVICE / CONFIG_SYS_IDE_MAXBUS))
 
-/*
- * Function Prototypes
- */
-
-struct blk_desc;
-struct udevice;
-ulong ide_read(struct udevice *dev, lbaint_t blknr, lbaint_t blkcnt,
-	       void *buffer);
-ulong ide_write(struct udevice *dev, lbaint_t blknr, lbaint_t blkcnt,
-		const void *buffer);
-
 /**
  * ide_set_reset() - Assert or de-assert reset for the IDE device
  *
-- 
2.40.0.634.g4ca3ef3211-goog



More information about the U-Boot mailing list