mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH master 1/4] Revert "imx-usb-loader: add commandline option for displaying version number"
@ 2023-05-25 18:13 Ahmad Fatoum
  2023-05-25 18:13 ` [PATCH master 2/4] ARM: rockchip: pine64-quartz64: add sdram-init.bin to .gitignore Ahmad Fatoum
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Ahmad Fatoum @ 2023-05-25 18:13 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum, Johannes Zink

include/generated/utsrelease.h is only generated in the prepare make
target, which is not a dependency of the scripts make target. Builds of
the scripts target, e.g. sandbox $(make hosttools_defconfig; make scripts),
may thus fail because the file had not yet been generated:

<command-line>: fatal error: /build/source/include/generated/utsrelease.h:
	No such file or directory
	compilation terminated.

That scripts doesn't depend on prepare may be due to scripts/kconfig.
The kernel may side step this issue by having tools not needed for
prepare in a separate tools/.

Until this is resolved, revert commit c1b50061f4b33482ae749f9d6d6c92aa5bf6b37a.

Cc: Johannes Zink <j.zink@pengutronix.de>
Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
---
 scripts/imx/Makefile         |  2 +-
 scripts/imx/imx-usb-loader.c | 22 +---------------------
 2 files changed, 2 insertions(+), 22 deletions(-)

diff --git a/scripts/imx/Makefile b/scripts/imx/Makefile
index b3be3886d8eb..dbfa82910a55 100644
--- a/scripts/imx/Makefile
+++ b/scripts/imx/Makefile
@@ -3,7 +3,7 @@
 hostprogs-always-$(CONFIG_ARCH_IMX_IMXIMAGE)	+= imx-image
 hostprogs-always-$(CONFIG_ARCH_IMX_USBLOADER)	+= imx-usb-loader
 
-HOSTCFLAGS_imx-usb-loader.o = `pkg-config --cflags libusb-1.0` -include $(objtree)/include/generated/utsrelease.h
+HOSTCFLAGS_imx-usb-loader.o = `pkg-config --cflags libusb-1.0`
 HOSTLDLIBS_imx-usb-loader  = `pkg-config --libs libusb-1.0`
 
 imx-usb-loader-target-userccflags += `$(CROSS_PKG_CONFIG) --cflags libusb-1.0`
diff --git a/scripts/imx/imx-usb-loader.c b/scripts/imx/imx-usb-loader.c
index 676f077c2557..839288f753cc 100644
--- a/scripts/imx/imx-usb-loader.c
+++ b/scripts/imx/imx-usb-loader.c
@@ -46,10 +46,6 @@
 #define FT_DCD	0xee
 #define FT_LOAD_ONLY	0x00
 
-#ifndef UTS_RELEASE
-#define UTS_RELEASE "unknown"
-#endif
-
 /*
  * comment from libusb:
  * As per the USB 3.0 specs, the current maximum limit for the depth is 7.
@@ -1530,15 +1526,9 @@ static void usage(const char *prgname)
 		"-p <devpath> Specify device path: <bus>-<port>[.<port>]...\n"
 		"-s           skip DCD included in image\n"
 		"-v           verbose (give multiple times to increase)\n"
-		"--version    display version number\n"
 		"-h           this help\n", prgname);
 }
 
-static void version(const char *prgname)
-{
-	fprintf(stderr, "%s %s\n", prgname, UTS_RELEASE);
-}
-
 int main(int argc, char *argv[])
 {
 	libusb_device **devs;
@@ -1554,20 +1544,10 @@ int main(int argc, char *argv[])
 	char *initfile = NULL;
 	char *devpath = NULL;
 	char *devtype = NULL;
-	int opt_version = 0;
-	struct option long_options[] = {
-		{"version", no_argument, &opt_version, 1},
-		{ }
-	};
 
 	w.do_dcd_once = 1;
 
-	while ((opt = getopt_long(argc, argv, "cvhd:i:p:s", long_options, NULL)) != -1) {
-		if (opt_version) {
-			version(argv[0]);
-			exit(EXIT_SUCCESS);
-		}
-
+	while ((opt = getopt(argc, argv, "cvhd:i:p:s")) != -1) {
 		switch (opt) {
 		case 'c':
 			verify = 1;
-- 
2.38.4




^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH master 2/4] ARM: rockchip: pine64-quartz64: add sdram-init.bin to .gitignore
  2023-05-25 18:13 [PATCH master 1/4] Revert "imx-usb-loader: add commandline option for displaying version number" Ahmad Fatoum
@ 2023-05-25 18:13 ` Ahmad Fatoum
  2023-05-25 18:13 ` [PATCH master 3/4] scripts: kwbimage: check return value of asprintf Ahmad Fatoum
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Ahmad Fatoum @ 2023-05-25 18:13 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

Other boards already have sdram-init.bin in their .gitignore, so have
quartz64 follow suit.

Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
---
 arch/arm/boards/pine64-quartz64/.gitignore | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 arch/arm/boards/pine64-quartz64/.gitignore

diff --git a/arch/arm/boards/pine64-quartz64/.gitignore b/arch/arm/boards/pine64-quartz64/.gitignore
new file mode 100644
index 000000000000..f458f794b54c
--- /dev/null
+++ b/arch/arm/boards/pine64-quartz64/.gitignore
@@ -0,0 +1 @@
+sdram-init.bin
-- 
2.38.4




^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH master 3/4] scripts: kwbimage: check return value of asprintf
  2023-05-25 18:13 [PATCH master 1/4] Revert "imx-usb-loader: add commandline option for displaying version number" Ahmad Fatoum
  2023-05-25 18:13 ` [PATCH master 2/4] ARM: rockchip: pine64-quartz64: add sdram-init.bin to .gitignore Ahmad Fatoum
@ 2023-05-25 18:13 ` Ahmad Fatoum
  2023-05-25 18:13 ` [PATCH master 4/4] scripts: omap3-usb-loader: fix heap overflow Ahmad Fatoum
  2023-05-26  5:46 ` [PATCH master 1/4] Revert "imx-usb-loader: add commandline option for displaying version number" Johannes Zink
  3 siblings, 0 replies; 7+ messages in thread
From: Ahmad Fatoum @ 2023-05-25 18:13 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

Some newer toolchains defines asprintf with a must_check attribute,
leading to warnings when compiling kwbimage. Let's handle OOM gracefully
to get rid of the warnings.

Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
---
 scripts/kwbimage.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/scripts/kwbimage.c b/scripts/kwbimage.c
index f9d052752d79..370c54c983b5 100644
--- a/scripts/kwbimage.c
+++ b/scripts/kwbimage.c
@@ -1006,6 +1006,7 @@ static int image_create_config_parse_oneline(char *line,
 					     char *configpath)
 {
 	char *keyword, *saveptr;
+	int ret;
 
 	keyword = strtok_r(line, " ", &saveptr);
 	if (!strcmp(keyword, "VERSION")) {
@@ -1056,10 +1057,16 @@ static int image_create_config_parse_oneline(char *line,
 		int argi = 0;
 
 		el->type = IMAGE_CFG_BINARY;
-		if (*value == '/')
+		if (*value == '/') {
 			el->binary.file = strdup(value);
-		else
-			asprintf(&el->binary.file, "%s/%s", configpath, value);
+		} else {
+			ret = asprintf(&el->binary.file, "%s/%s", configpath, value);
+			if (ret < 0) {
+				fprintf(stderr, "Cannot allocate memory\n");
+				return -1;
+			}
+		}
+
 		while (1) {
 			value = strtok_r(NULL, " ", &saveptr);
 			if (!value)
-- 
2.38.4




^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH master 4/4] scripts: omap3-usb-loader: fix heap overflow
  2023-05-25 18:13 [PATCH master 1/4] Revert "imx-usb-loader: add commandline option for displaying version number" Ahmad Fatoum
  2023-05-25 18:13 ` [PATCH master 2/4] ARM: rockchip: pine64-quartz64: add sdram-init.bin to .gitignore Ahmad Fatoum
  2023-05-25 18:13 ` [PATCH master 3/4] scripts: kwbimage: check return value of asprintf Ahmad Fatoum
@ 2023-05-25 18:13 ` Ahmad Fatoum
  2023-05-26  5:46 ` [PATCH master 1/4] Revert "imx-usb-loader: add commandline option for displaying version number" Johannes Zink
  3 siblings, 0 replies; 7+ messages in thread
From: Ahmad Fatoum @ 2023-05-25 18:13 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

Newer GCC versions correctly warn that the buffer allocated by realloc
is too small. Correct the size.

Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
---
 scripts/omap3-usb-loader.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/omap3-usb-loader.c b/scripts/omap3-usb-loader.c
index a8d626c32f23..31a03be8e7f4 100644
--- a/scripts/omap3-usb-loader.c
+++ b/scripts/omap3-usb-loader.c
@@ -784,7 +784,7 @@ int main(int argc, char *argv[])
 				file.addr = OMAP_BASE_ADDRESS;
 
 				/* commit the file object with the processor specified base address */
-				args->files = realloc(args->files, filecount);
+				args->files = realloc(args->files, filecount * sizeof(*args->files));
 				args->numfiles = filecount;
 				args->files[filecount - 1] = malloc(sizeof (file));
 				memcpy(args->files[filecount - 1], &file, sizeof (file));
-- 
2.38.4




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH master 1/4] Revert "imx-usb-loader: add commandline option for displaying version number"
  2023-05-25 18:13 [PATCH master 1/4] Revert "imx-usb-loader: add commandline option for displaying version number" Ahmad Fatoum
                   ` (2 preceding siblings ...)
  2023-05-25 18:13 ` [PATCH master 4/4] scripts: omap3-usb-loader: fix heap overflow Ahmad Fatoum
@ 2023-05-26  5:46 ` Johannes Zink
  2023-05-26  6:20   ` Ahmad Fatoum
  3 siblings, 1 reply; 7+ messages in thread
From: Johannes Zink @ 2023-05-26  5:46 UTC (permalink / raw)
  To: Ahmad Fatoum, barebox

Hi Ahmad,

On 5/25/23 20:13, Ahmad Fatoum wrote:
> include/generated/utsrelease.h is only generated in the prepare make
> target, which is not a dependency of the scripts make target. Builds of
> the scripts target, e.g. sandbox $(make hosttools_defconfig; make scripts),
> may thus fail because the file had not yet been generated:
> 
> <command-line>: fatal error: /build/source/include/generated/utsrelease.h:
> 	No such file or directory
> 	compilation terminated.
> 
> That scripts doesn't depend on prepare may be due to scripts/kconfig.
> The kernel may side step this issue by having tools not needed for
> prepare in a separate tools/.
> 

do you have a suggestion how this issue could be solved? I think that it 
is - nevertheless - useful to have a version number in the tooling. Do 
you know of a flag that is set when the files have been generated? Maybe 
we can include the file conditionally if and only if it has been 
generated. Do you think that alternatively we can require the prepare 
make target as a dependency for scripts/imx?

Johannes

> Until this is resolved, revert commit c1b50061f4b33482ae749f9d6d6c92aa5bf6b37a.
> 
> Cc: Johannes Zink <j.zink@pengutronix.de>
> Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
> ---
>   scripts/imx/Makefile         |  2 +-
>   scripts/imx/imx-usb-loader.c | 22 +---------------------
>   2 files changed, 2 insertions(+), 22 deletions(-)
> 
> diff --git a/scripts/imx/Makefile b/scripts/imx/Makefile
> index b3be3886d8eb..dbfa82910a55 100644
> --- a/scripts/imx/Makefile
> +++ b/scripts/imx/Makefile
> @@ -3,7 +3,7 @@
>   hostprogs-always-$(CONFIG_ARCH_IMX_IMXIMAGE)	+= imx-image
>   hostprogs-always-$(CONFIG_ARCH_IMX_USBLOADER)	+= imx-usb-loader
>   
> -HOSTCFLAGS_imx-usb-loader.o = `pkg-config --cflags libusb-1.0` -include $(objtree)/include/generated/utsrelease.h
> +HOSTCFLAGS_imx-usb-loader.o = `pkg-config --cflags libusb-1.0`
>   HOSTLDLIBS_imx-usb-loader  = `pkg-config --libs libusb-1.0`
>   
>   imx-usb-loader-target-userccflags += `$(CROSS_PKG_CONFIG) --cflags libusb-1.0`
> diff --git a/scripts/imx/imx-usb-loader.c b/scripts/imx/imx-usb-loader.c
> index 676f077c2557..839288f753cc 100644
> --- a/scripts/imx/imx-usb-loader.c
> +++ b/scripts/imx/imx-usb-loader.c
> @@ -46,10 +46,6 @@
>   #define FT_DCD	0xee
>   #define FT_LOAD_ONLY	0x00
>   
> -#ifndef UTS_RELEASE
> -#define UTS_RELEASE "unknown"
> -#endif
> -
>   /*
>    * comment from libusb:
>    * As per the USB 3.0 specs, the current maximum limit for the depth is 7.
> @@ -1530,15 +1526,9 @@ static void usage(const char *prgname)
>   		"-p <devpath> Specify device path: <bus>-<port>[.<port>]...\n"
>   		"-s           skip DCD included in image\n"
>   		"-v           verbose (give multiple times to increase)\n"
> -		"--version    display version number\n"
>   		"-h           this help\n", prgname);
>   }
>   
> -static void version(const char *prgname)
> -{
> -	fprintf(stderr, "%s %s\n", prgname, UTS_RELEASE);
> -}
> -
>   int main(int argc, char *argv[])
>   {
>   	libusb_device **devs;
> @@ -1554,20 +1544,10 @@ int main(int argc, char *argv[])
>   	char *initfile = NULL;
>   	char *devpath = NULL;
>   	char *devtype = NULL;
> -	int opt_version = 0;
> -	struct option long_options[] = {
> -		{"version", no_argument, &opt_version, 1},
> -		{ }
> -	};
>   
>   	w.do_dcd_once = 1;
>   
> -	while ((opt = getopt_long(argc, argv, "cvhd:i:p:s", long_options, NULL)) != -1) {
> -		if (opt_version) {
> -			version(argv[0]);
> -			exit(EXIT_SUCCESS);
> -		}
> -
> +	while ((opt = getopt(argc, argv, "cvhd:i:p:s")) != -1) {
>   		switch (opt) {
>   		case 'c':
>   			verify = 1;

-- 
Pengutronix e.K.                | Johannes Zink                  |
Steuerwalder Str. 21            | https://www.pengutronix.de/    |
31137 Hildesheim, Germany       | Phone: +49-5121-206917-0       |
Amtsgericht Hildesheim, HRA 2686| Fax:   +49-5121-206917-5555    |




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH master 1/4] Revert "imx-usb-loader: add commandline option for displaying version number"
  2023-05-26  5:46 ` [PATCH master 1/4] Revert "imx-usb-loader: add commandline option for displaying version number" Johannes Zink
@ 2023-05-26  6:20   ` Ahmad Fatoum
  2023-05-26  7:12     ` Johannes Zink
  0 siblings, 1 reply; 7+ messages in thread
From: Ahmad Fatoum @ 2023-05-26  6:20 UTC (permalink / raw)
  To: Johannes Zink, Ahmad Fatoum, barebox

Hello Johannes,

On 26.05.23 07:46, Johannes Zink wrote:
> Hi Ahmad,
> 
> On 5/25/23 20:13, Ahmad Fatoum wrote:
>> include/generated/utsrelease.h is only generated in the prepare make
>> target, which is not a dependency of the scripts make target. Builds of
>> the scripts target, e.g. sandbox $(make hosttools_defconfig; make scripts),
>> may thus fail because the file had not yet been generated:
>>
>> <command-line>: fatal error: /build/source/include/generated/utsrelease.h:
>>     No such file or directory
>>     compilation terminated.
>>
>> That scripts doesn't depend on prepare may be due to scripts/kconfig.
>> The kernel may side step this issue by having tools not needed for
>> prepare in a separate tools/.
>>
> 
> do you have a suggestion how this issue could be solved?
> I think that it is - nevertheless - useful to have a version number in the tooling.

Agreed. I am looking forward to a v2 that doesn't break the build. ;)

> Do you know of a flag that is set when the files have been generated?
> Maybe we can include the file conditionally if and only if it has been generated.

That would mean we accept that the race condition is there and that depending on
timing/parallelism, we either end up with a version or unknown...

> Do you think that alternatively we can require the prepare make target as a dependency for scripts/imx?

AFAICS, scripts/Makefile is called recursively, so it may not be feasible to depend on
top-level Makefile's prepare for a target defined within. If everything needed for
Kconfig is part of another target (e.g. config or scripts_basic), then maybe scripts
could be made to depend on prepare. A worthwhile alternative may be moving stuff not
needed for the build, like all USB loaders, into a tools/ directory, but then one
needs to take care of dependencies on files in scripts/.

Cheers,
Ahmad

> 
> Johannes
> 
>> Until this is resolved, revert commit c1b50061f4b33482ae749f9d6d6c92aa5bf6b37a.
>>
>> Cc: Johannes Zink <j.zink@pengutronix.de>
>> Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
>> ---
>>   scripts/imx/Makefile         |  2 +-
>>   scripts/imx/imx-usb-loader.c | 22 +---------------------
>>   2 files changed, 2 insertions(+), 22 deletions(-)
>>
>> diff --git a/scripts/imx/Makefile b/scripts/imx/Makefile
>> index b3be3886d8eb..dbfa82910a55 100644
>> --- a/scripts/imx/Makefile
>> +++ b/scripts/imx/Makefile
>> @@ -3,7 +3,7 @@
>>   hostprogs-always-$(CONFIG_ARCH_IMX_IMXIMAGE)    += imx-image
>>   hostprogs-always-$(CONFIG_ARCH_IMX_USBLOADER)    += imx-usb-loader
>>   -HOSTCFLAGS_imx-usb-loader.o = `pkg-config --cflags libusb-1.0` -include $(objtree)/include/generated/utsrelease.h
>> +HOSTCFLAGS_imx-usb-loader.o = `pkg-config --cflags libusb-1.0`
>>   HOSTLDLIBS_imx-usb-loader  = `pkg-config --libs libusb-1.0`
>>     imx-usb-loader-target-userccflags += `$(CROSS_PKG_CONFIG) --cflags libusb-1.0`
>> diff --git a/scripts/imx/imx-usb-loader.c b/scripts/imx/imx-usb-loader.c
>> index 676f077c2557..839288f753cc 100644
>> --- a/scripts/imx/imx-usb-loader.c
>> +++ b/scripts/imx/imx-usb-loader.c
>> @@ -46,10 +46,6 @@
>>   #define FT_DCD    0xee
>>   #define FT_LOAD_ONLY    0x00
>>   -#ifndef UTS_RELEASE
>> -#define UTS_RELEASE "unknown"
>> -#endif
>> -
>>   /*
>>    * comment from libusb:
>>    * As per the USB 3.0 specs, the current maximum limit for the depth is 7.
>> @@ -1530,15 +1526,9 @@ static void usage(const char *prgname)
>>           "-p <devpath> Specify device path: <bus>-<port>[.<port>]...\n"
>>           "-s           skip DCD included in image\n"
>>           "-v           verbose (give multiple times to increase)\n"
>> -        "--version    display version number\n"
>>           "-h           this help\n", prgname);
>>   }
>>   -static void version(const char *prgname)
>> -{
>> -    fprintf(stderr, "%s %s\n", prgname, UTS_RELEASE);
>> -}
>> -
>>   int main(int argc, char *argv[])
>>   {
>>       libusb_device **devs;
>> @@ -1554,20 +1544,10 @@ int main(int argc, char *argv[])
>>       char *initfile = NULL;
>>       char *devpath = NULL;
>>       char *devtype = NULL;
>> -    int opt_version = 0;
>> -    struct option long_options[] = {
>> -        {"version", no_argument, &opt_version, 1},
>> -        { }
>> -    };
>>         w.do_dcd_once = 1;
>>   -    while ((opt = getopt_long(argc, argv, "cvhd:i:p:s", long_options, NULL)) != -1) {
>> -        if (opt_version) {
>> -            version(argv[0]);
>> -            exit(EXIT_SUCCESS);
>> -        }
>> -
>> +    while ((opt = getopt(argc, argv, "cvhd:i:p:s")) != -1) {
>>           switch (opt) {
>>           case 'c':
>>               verify = 1;
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH master 1/4] Revert "imx-usb-loader: add commandline option for displaying version number"
  2023-05-26  6:20   ` Ahmad Fatoum
@ 2023-05-26  7:12     ` Johannes Zink
  0 siblings, 0 replies; 7+ messages in thread
From: Johannes Zink @ 2023-05-26  7:12 UTC (permalink / raw)
  To: Ahmad Fatoum, Ahmad Fatoum, barebox

Hi Ahmad,

On 5/26/23 08:20, Ahmad Fatoum wrote:
[snip]

> 
> Agreed. I am looking forward to a v2 that doesn't break the build. ;)
> 

ack - just sent out a fixup.

>> Do you know of a flag that is set when the files have been generated?
>> Maybe we can include the file conditionally if and only if it has been generated.
> 
> That would mean we accept that the race condition is there and that depending on
> timing/parallelism, we either end up with a version or unknown...
> 

ack

>> Do you think that alternatively we can require the prepare make target as a dependency for scripts/imx?
> 
> AFAICS, scripts/Makefile is called recursively, so it may not be feasible to depend on
> top-level Makefile's prepare for a target defined within. If everything needed for
> Kconfig is part of another target (e.g. config or scripts_basic), then maybe scripts
> could be made to depend on prepare. A worthwhile alternative may be moving stuff not
> needed for the build, like all USB loaders, into a tools/ directory, but then one
> needs to take care of dependencies on files in scripts/.
> 

I had another thought - just using the Version variables from the top 
level makefile is much easier and also does the trick.

Johannes

> Cheers,
> Ahmad
> 
>>
>> Johannes
>>
>>> Until this is resolved, revert commit c1b50061f4b33482ae749f9d6d6c92aa5bf6b37a.
>>>
>>> Cc: Johannes Zink <j.zink@pengutronix.de>
>>> Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
>>> ---
>>>    scripts/imx/Makefile         |  2 +-
>>>    scripts/imx/imx-usb-loader.c | 22 +---------------------
>>>    2 files changed, 2 insertions(+), 22 deletions(-)
>>>
>>> diff --git a/scripts/imx/Makefile b/scripts/imx/Makefile
>>> index b3be3886d8eb..dbfa82910a55 100644
>>> --- a/scripts/imx/Makefile
>>> +++ b/scripts/imx/Makefile
>>> @@ -3,7 +3,7 @@
>>>    hostprogs-always-$(CONFIG_ARCH_IMX_IMXIMAGE)    += imx-image
>>>    hostprogs-always-$(CONFIG_ARCH_IMX_USBLOADER)    += imx-usb-loader
>>>    -HOSTCFLAGS_imx-usb-loader.o = `pkg-config --cflags libusb-1.0` -include $(objtree)/include/generated/utsrelease.h
>>> +HOSTCFLAGS_imx-usb-loader.o = `pkg-config --cflags libusb-1.0`
>>>    HOSTLDLIBS_imx-usb-loader  = `pkg-config --libs libusb-1.0`
>>>      imx-usb-loader-target-userccflags += `$(CROSS_PKG_CONFIG) --cflags libusb-1.0`
>>> diff --git a/scripts/imx/imx-usb-loader.c b/scripts/imx/imx-usb-loader.c
>>> index 676f077c2557..839288f753cc 100644
>>> --- a/scripts/imx/imx-usb-loader.c
>>> +++ b/scripts/imx/imx-usb-loader.c
>>> @@ -46,10 +46,6 @@
>>>    #define FT_DCD    0xee
>>>    #define FT_LOAD_ONLY    0x00
>>>    -#ifndef UTS_RELEASE
>>> -#define UTS_RELEASE "unknown"
>>> -#endif
>>> -
>>>    /*
>>>     * comment from libusb:
>>>     * As per the USB 3.0 specs, the current maximum limit for the depth is 7.
>>> @@ -1530,15 +1526,9 @@ static void usage(const char *prgname)
>>>            "-p <devpath> Specify device path: <bus>-<port>[.<port>]...\n"
>>>            "-s           skip DCD included in image\n"
>>>            "-v           verbose (give multiple times to increase)\n"
>>> -        "--version    display version number\n"
>>>            "-h           this help\n", prgname);
>>>    }
>>>    -static void version(const char *prgname)
>>> -{
>>> -    fprintf(stderr, "%s %s\n", prgname, UTS_RELEASE);
>>> -}
>>> -
>>>    int main(int argc, char *argv[])
>>>    {
>>>        libusb_device **devs;
>>> @@ -1554,20 +1544,10 @@ int main(int argc, char *argv[])
>>>        char *initfile = NULL;
>>>        char *devpath = NULL;
>>>        char *devtype = NULL;
>>> -    int opt_version = 0;
>>> -    struct option long_options[] = {
>>> -        {"version", no_argument, &opt_version, 1},
>>> -        { }
>>> -    };
>>>          w.do_dcd_once = 1;
>>>    -    while ((opt = getopt_long(argc, argv, "cvhd:i:p:s", long_options, NULL)) != -1) {
>>> -        if (opt_version) {
>>> -            version(argv[0]);
>>> -            exit(EXIT_SUCCESS);
>>> -        }
>>> -
>>> +    while ((opt = getopt(argc, argv, "cvhd:i:p:s")) != -1) {
>>>            switch (opt) {
>>>            case 'c':
>>>                verify = 1;
>>
> 

-- 
Pengutronix e.K.                | Johannes Zink                  |
Steuerwalder Str. 21            | https://www.pengutronix.de/    |
31137 Hildesheim, Germany       | Phone: +49-5121-206917-0       |
Amtsgericht Hildesheim, HRA 2686| Fax:   +49-5121-206917-5555    |




^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-05-26  7:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-25 18:13 [PATCH master 1/4] Revert "imx-usb-loader: add commandline option for displaying version number" Ahmad Fatoum
2023-05-25 18:13 ` [PATCH master 2/4] ARM: rockchip: pine64-quartz64: add sdram-init.bin to .gitignore Ahmad Fatoum
2023-05-25 18:13 ` [PATCH master 3/4] scripts: kwbimage: check return value of asprintf Ahmad Fatoum
2023-05-25 18:13 ` [PATCH master 4/4] scripts: omap3-usb-loader: fix heap overflow Ahmad Fatoum
2023-05-26  5:46 ` [PATCH master 1/4] Revert "imx-usb-loader: add commandline option for displaying version number" Johannes Zink
2023-05-26  6:20   ` Ahmad Fatoum
2023-05-26  7:12     ` Johannes Zink

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox