[PATCH 01/23] imx-usb-loader: let constant data be const
Sascha Hauer
s.hauer at pengutronix.de
Mon Jan 16 02:50:46 PST 2017
From: Juergen Borleis <jbe at pengutronix.de>
Signed-off-by: Juergen Borleis <jbe at pengutronix.de>
---
scripts/imx/imx-usb-loader.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/scripts/imx/imx-usb-loader.c b/scripts/imx/imx-usb-loader.c
index be0894fa6..dfeef9e2c 100644
--- a/scripts/imx/imx-usb-loader.c
+++ b/scripts/imx/imx-usb-loader.c
@@ -72,11 +72,11 @@ struct usb_work {
};
struct usb_id {
- struct mach_id *mach_id;
+ const struct mach_id *mach_id;
struct usb_work *work;
};
-struct mach_id imx_ids[] = {
+const struct mach_id imx_ids[] = {
{
.vid = 0x066f,
.pid = 0x3780,
@@ -174,12 +174,12 @@ struct sdp_command {
uint8_t rsvd;
} __attribute__((packed));
-static struct mach_id *imx_device(unsigned short vid, unsigned short pid)
+static const struct mach_id *imx_device(unsigned short vid, unsigned short pid)
{
int i;
for (i = 0; i < ARRAY_SIZE(imx_ids); i++) {
- struct mach_id *id = &imx_ids[i];
+ const struct mach_id *id = &imx_ids[i];
if (id->vid == vid && id->pid == pid) {
fprintf(stderr, "found %s USB device [%04x:%04x]\n",
id->name, vid, pid);
@@ -190,10 +190,10 @@ static struct mach_id *imx_device(unsigned short vid, unsigned short pid)
return NULL;
}
-static libusb_device *find_imx_dev(libusb_device **devs, struct mach_id **pp_id)
+static libusb_device *find_imx_dev(libusb_device **devs, const struct mach_id **pp_id)
{
int i = 0;
- struct mach_id *p;
+ const struct mach_id *p;
for (;;) {
struct libusb_device_descriptor desc;
@@ -1288,7 +1288,7 @@ static void usage(const char *prgname)
int main(int argc, char *argv[])
{
- struct mach_id *mach;
+ const struct mach_id *mach;
libusb_device **devs;
libusb_device *dev;
int r;
--
2.11.0
More information about the barebox
mailing list