Re: [PATCH 5/5] scripts: imx-usb-loader: split off topic-code into functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>Воскресенье, 17 июля 2016, 18:53 +03:00 от Alexander Kurz <akurz@xxxxxxxx>:
>
>Improve code understandability: extract the "jump application" Serial
>Download Protocol access method and file-to-buffer reader functionality
>out of do_irom_download().
>
>Signed-off-by: Alexander Kurz < akurz@xxxxxxxx >
>---
> scripts/imx/imx-usb-loader.c | 159 +++++++++++++++++++++++++------------------
> 1 file changed, 92 insertions(+), 67 deletions(-)
>
>diff --git a/scripts/imx/imx-usb-loader.c b/scripts/imx/imx-usb-loader.c
...
>+FILE *xfile;
>+unsigned fsize;
>+int cnt;
>+unsigned char *buf;
>+xfile = fopen(name, "rb");
>+if (!xfile) {
>+printf("error, can not open input file: %s\n", name);
>+return -5;
...
>+fsize = get_file_size(xfile);
>+if (fsize < 0x20) {
>+printf("error, file: %s is too small\n", name);
>+fclose(xfile);
>+return -2;
-2 ? Maybe -EINVAL or so will be more appropriate here?

---

_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox




[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux