From: Marek Vasut <marek.vasut@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 4/4] USB: Staticize usb_storage.c
Date: Tue, 14 Feb 2012 05:58:19 +0100 [thread overview]
Message-ID: <1329195499-20414-5-git-send-email-marek.vasut@gmail.com> (raw)
In-Reply-To: <1329195499-20414-1-git-send-email-marek.vasut@gmail.com>
Also, make usb_stor_buf local.
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Cc: Remy Bohmer <linux@bohmer.net>
---
common/usb_storage.c | 39 +++++++++++++++++++--------------------
1 files changed, 19 insertions(+), 20 deletions(-)
diff --git a/common/usb_storage.c b/common/usb_storage.c
index de84c8d..1446fb0 100644
--- a/common/usb_storage.c
+++ b/common/usb_storage.c
@@ -79,7 +79,6 @@ static const unsigned char us_direction[256/8] = {
};
#define US_DIRECTION(x) ((us_direction[x>>3] >> (x & 7)) & 1)
-static unsigned char usb_stor_buf[512];
static ccb usb_ccb;
/*
@@ -164,15 +163,14 @@ static struct us_data usb_stor[USB_MAX_STOR_DEV];
#define USB_STOR_TRANSPORT_FAILED -1
#define USB_STOR_TRANSPORT_ERROR -2
-int usb_stor_get_info(struct usb_device *dev, struct us_data *us,
+static int usb_stor_get_info(struct usb_device *dev, struct us_data *us,
block_dev_desc_t *dev_desc);
-int usb_storage_probe(struct usb_device *dev, unsigned int ifnum,
+static int usb_storage_probe(struct usb_device *dev, unsigned int ifnum,
struct us_data *ss);
-unsigned long usb_stor_read(int device, unsigned long blknr,
+static unsigned long usb_stor_read(int device, unsigned long blknr,
unsigned long blkcnt, void *buffer);
-unsigned long usb_stor_write(int device, unsigned long blknr,
+static unsigned long usb_stor_write(int device, unsigned long blknr,
unsigned long blkcnt, const void *buffer);
-struct usb_device * usb_get_dev_index(int index);
void uhci_show_temp_int_td(void);
#ifdef CONFIG_PARTITIONS
@@ -182,7 +180,7 @@ block_dev_desc_t *usb_stor_get_dev(int index)
}
#endif
-void usb_show_progress(void)
+static void usb_show_progress(void)
{
debug(".");
}
@@ -233,9 +231,6 @@ int usb_stor_scan(int mode)
unsigned char i;
struct usb_device *dev;
- /* GJ */
- memset(usb_stor_buf, 0, sizeof(usb_stor_buf));
-
if (mode == 1)
printf(" scanning bus for storage devices... ");
@@ -493,7 +488,7 @@ static int usb_stor_CB_reset(struct us_data *us)
* Set up the command for a BBB device. Note that the actual SCSI
* command is copied into cbw.CBWCDB.
*/
-int usb_stor_BBB_comdat(ccb *srb, struct us_data *us)
+static int usb_stor_BBB_comdat(ccb *srb, struct us_data *us)
{
int result;
int actlen;
@@ -541,7 +536,7 @@ int usb_stor_BBB_comdat(ccb *srb, struct us_data *us)
/* FIXME: we also need a CBI_command which sets up the completion
* interrupt, and waits for it
*/
-int usb_stor_CB_comdat(ccb *srb, struct us_data *us)
+static int usb_stor_CB_comdat(ccb *srb, struct us_data *us)
{
int result = 0;
int dir_in, retry;
@@ -610,7 +605,7 @@ int usb_stor_CB_comdat(ccb *srb, struct us_data *us)
}
-int usb_stor_CBI_get_status(ccb *srb, struct us_data *us)
+static int usb_stor_CBI_get_status(ccb *srb, struct us_data *us)
{
int timeout;
@@ -658,7 +653,7 @@ int usb_stor_CBI_get_status(ccb *srb, struct us_data *us)
#define USB_TRANSPORT_NOT_READY_RETRY 10
/* clear a stall on an endpoint - special for BBB devices */
-int usb_stor_BBB_clear_endpt_stall(struct us_data *us, __u8 endpt)
+static int usb_stor_BBB_clear_endpt_stall(struct us_data *us, __u8 endpt)
{
int result;
@@ -669,7 +664,7 @@ int usb_stor_BBB_clear_endpt_stall(struct us_data *us, __u8 endpt)
return result;
}
-int usb_stor_BBB_transport(ccb *srb, struct us_data *us)
+static int usb_stor_BBB_transport(ccb *srb, struct us_data *us)
{
int result, retry;
int dir_in;
@@ -790,7 +785,7 @@ again:
return result;
}
-int usb_stor_CB_transport(ccb *srb, struct us_data *us)
+static int usb_stor_CB_transport(ccb *srb, struct us_data *us)
{
int result, status;
ccb *psrb;
@@ -1042,7 +1037,7 @@ static void usb_bin_fixup(struct usb_device_descriptor descriptor,
}
#endif /* CONFIG_USB_BIN_FIXUP */
-unsigned long usb_stor_read(int device, unsigned long blknr,
+static unsigned long usb_stor_read(int device, unsigned long blknr,
unsigned long blkcnt, void *buffer)
{
unsigned long start, blks, buf_addr;
@@ -1118,7 +1113,7 @@ retry_it:
return blkcnt;
}
-unsigned long usb_stor_write(int device, unsigned long blknr,
+static unsigned long usb_stor_write(int device, unsigned long blknr,
unsigned long blkcnt, const void *buffer)
{
unsigned long start, blks, buf_addr;
@@ -1199,7 +1194,7 @@ retry_it:
}
/* Probe to see if a new device is actually a Storage device */
-int usb_storage_probe(struct usb_device *dev, unsigned int ifnum,
+static int usb_storage_probe(struct usb_device *dev, unsigned int ifnum,
struct us_data *ss)
{
struct usb_interface *iface;
@@ -1339,13 +1334,17 @@ int usb_storage_probe(struct usb_device *dev, unsigned int ifnum,
return 1;
}
-int usb_stor_get_info(struct usb_device *dev, struct us_data *ss,
+static int usb_stor_get_info(struct usb_device *dev, struct us_data *ss,
block_dev_desc_t *dev_desc)
{
unsigned char perq, modi;
unsigned long cap[2];
unsigned long *capacity, *blksz;
ccb *pccb = &usb_ccb;
+ unsigned char usb_stor_buf[512];
+
+ /* GJ */
+ memset(usb_stor_buf, 0, sizeof(usb_stor_buf));
pccb->pdata = usb_stor_buf;
--
1.7.8.3
next prev parent reply other threads:[~2012-02-14 4:58 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-14 4:58 [U-Boot] [PATCH 0/4] USB cleanup Marek Vasut
2012-02-14 4:58 ` [U-Boot] [PATCH 1/4] USB: Staticize internal functions Marek Vasut
2012-02-14 5:21 ` Mike Frysinger
2012-02-14 4:58 ` [U-Boot] [PATCH 2/4] USB: Separate out USB hub driver Marek Vasut
2012-02-14 5:25 ` Mike Frysinger
2012-02-14 5:59 ` Marek Vasut
2012-02-14 4:58 ` [U-Boot] [PATCH 3/4] USB: Make struct devrequest setup_packet local Marek Vasut
2012-02-14 5:25 ` Mike Frysinger
2012-02-14 4:58 ` Marek Vasut [this message]
2012-02-14 5:37 ` [U-Boot] [PATCH 4/4] USB: Staticize usb_storage.c Mike Frysinger
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=1329195499-20414-5-git-send-email-marek.vasut@gmail.com \
--to=marek.vasut@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