Re: [PR] examples/mtdpart:Register MTD devices using the mtd_register method [nuttx-apps]
jingfei195887 commented on PR #3130: URL: https://github.com/apache/nuttx-apps/pull/3130#issuecomment-3138362591 > Thank you @jingfei195887 :-) Great work! :-) Please remember to `git commit -s` sign the commits :-) Thanks for the reminder. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] examples/mtdpart:Register MTD devices using the mtd_register method [nuttx-apps]
cederom commented on PR #3130: URL: https://github.com/apache/nuttx-apps/pull/3130#issuecomment-3136143790 Thank you @jingfei195887 :-) Great work! :-) Please remember to `git commit -s` sign the commits :-) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] examples/mtdpart:Register MTD devices using the mtd_register method [nuttx-apps]
Donny9 merged PR #3130: URL: https://github.com/apache/nuttx-apps/pull/3130 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] examples/mtdpart:Register MTD devices using the mtd_register method [nuttx-apps]
jingfei195887 commented on code in PR #3130:
URL: https://github.com/apache/nuttx-apps/pull/3130#discussion_r2236056792
##
examples/mtdpart/mtdpart_main.c:
##
@@ -530,19 +490,41 @@ int main(int argc, FAR char *argv[])
{
printf("ERROR: Bad value %lu, expected %lu\n",
(long)buffer[k], (long)(~check));
- fflush(stdout);
- exit(27);
+ status = 23;
+ goto err_rw;
}
check += sizeof(uint32_t);
}
}
- close(fd);
+ status = 0;
/* And exit without bothering to clean up */
printf("PASS: Everything looks good\n");
+
+err_rw:
+ close(fd);
+
+err_fd:
Review Comment:
done
##
examples/mtdpart/mtdpart_main.c:
##
@@ -530,19 +490,41 @@ int main(int argc, FAR char *argv[])
{
printf("ERROR: Bad value %lu, expected %lu\n",
(long)buffer[k], (long)(~check));
- fflush(stdout);
- exit(27);
+ status = 23;
+ goto err_rw;
}
check += sizeof(uint32_t);
}
}
- close(fd);
+ status = 0;
/* And exit without bothering to clean up */
printf("PASS: Everything looks good\n");
+
+err_rw:
+ close(fd);
+
+err_fd:
+ free(buffer);
+
+err_buf:
Review Comment:
removed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Re: [PR] examples/mtdpart:Register MTD devices using the mtd_register method [nuttx-apps]
jingfei195887 commented on code in PR #3130:
URL: https://github.com/apache/nuttx-apps/pull/3130#discussion_r2236055293
##
examples/mtdpart/mtdpart_main.c:
##
@@ -530,19 +490,41 @@ int main(int argc, FAR char *argv[])
{
printf("ERROR: Bad value %lu, expected %lu\n",
(long)buffer[k], (long)(~check));
- fflush(stdout);
- exit(27);
+ status = 23;
+ goto err_rw;
}
check += sizeof(uint32_t);
}
}
- close(fd);
+ status = 0;
/* And exit without bothering to clean up */
printf("PASS: Everything looks good\n");
+
+err_rw:
Review Comment:
done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Re: [PR] examples/mtdpart:Register MTD devices using the mtd_register method [nuttx-apps]
xiaoxiang781216 commented on code in PR #3130:
URL: https://github.com/apache/nuttx-apps/pull/3130#discussion_r2235496579
##
examples/mtdpart/mtdpart_main.c:
##
@@ -530,19 +490,41 @@ int main(int argc, FAR char *argv[])
{
printf("ERROR: Bad value %lu, expected %lu\n",
(long)buffer[k], (long)(~check));
- fflush(stdout);
- exit(27);
+ status = 23;
+ goto err_rw;
}
check += sizeof(uint32_t);
}
}
- close(fd);
+ status = 0;
/* And exit without bothering to clean up */
printf("PASS: Everything looks good\n");
+
+err_rw:
Review Comment:
```suggestion
err_fd:
```
##
examples/mtdpart/mtdpart_main.c:
##
@@ -530,19 +490,41 @@ int main(int argc, FAR char *argv[])
{
printf("ERROR: Bad value %lu, expected %lu\n",
(long)buffer[k], (long)(~check));
- fflush(stdout);
- exit(27);
+ status = 23;
+ goto err_rw;
}
check += sizeof(uint32_t);
}
}
- close(fd);
+ status = 0;
/* And exit without bothering to clean up */
printf("PASS: Everything looks good\n");
+
+err_rw:
+ close(fd);
+
+err_fd:
+ free(buffer);
+
+err_buf:
Review Comment:
remove
##
examples/mtdpart/mtdpart_main.c:
##
@@ -530,19 +490,41 @@ int main(int argc, FAR char *argv[])
{
printf("ERROR: Bad value %lu, expected %lu\n",
(long)buffer[k], (long)(~check));
- fflush(stdout);
- exit(27);
+ status = 23;
+ goto err_rw;
}
check += sizeof(uint32_t);
}
}
- close(fd);
+ status = 0;
/* And exit without bothering to clean up */
printf("PASS: Everything looks good\n");
+
+err_rw:
+ close(fd);
+
+err_fd:
Review Comment:
```suggestion
err_buf:
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Re: [PR] examples/mtdpart:Register MTD devices using the mtd_register method [nuttx-apps]
jingfei195887 commented on code in PR #3130: URL: https://github.com/apache/nuttx-apps/pull/3130#discussion_r2234943965 ## examples/mtdpart/mtdpart_main.c: ## @@ -133,8 +133,7 @@ int main(int argc, FAR char *argv[]) FAR struct mtd_dev_s *part[CONFIG_EXAMPLES_MTDPART_NPARTITIONS + 1]; FAR struct mtd_geometry_s geo; FAR uint32_t *buffer; Review Comment: @xiaoxiang781216 we do not need init values for any variables in main now -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] examples/mtdpart:Register MTD devices using the mtd_register method [nuttx-apps]
jingfei195887 commented on code in PR #3130: URL: https://github.com/apache/nuttx-apps/pull/3130#discussion_r2234907214 ## examples/mtdpart/mtdpart_main.c: ## @@ -133,8 +133,7 @@ int main(int argc, FAR char *argv[]) FAR struct mtd_dev_s *part[CONFIG_EXAMPLES_MTDPART_NPARTITIONS + 1]; FAR struct mtd_geometry_s geo; FAR uint32_t *buffer; Review Comment: I've rechecked the logic of the main function. All our variables are assigned values through function calls before being used or released, so there's no need to initialize the variables. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] examples/mtdpart:Register MTD devices using the mtd_register method [nuttx-apps]
jingfei195887 commented on PR #3130: URL: https://github.com/apache/nuttx-apps/pull/3130#issuecomment-3125754672 > @jingfei195887 please drop merge patch. yes this is done -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] examples/mtdpart:Register MTD devices using the mtd_register method [nuttx-apps]
jingfei195887 commented on code in PR #3130:
URL: https://github.com/apache/nuttx-apps/pull/3130#discussion_r2234891024
##
examples/mtdpart/mtdpart_main.c:
##
@@ -179,22 +179,12 @@ int main(int argc, FAR char *argv[])
* interesting.
*/
- ret = ftl_initialize(0, master);
+ ret = register_mtddriver("/dev/mtd0", master, 0775, NULL);
if (ret < 0)
{
- printf("ERROR: ftl_initialize /dev/mtdblock0 failed: %d\n", ret);
- fflush(stdout);
- exit(2);
-}
-
- /* Now create a character device on the block device */
-
- ret = bchdev_register("/dev/mtdblock0", "/dev/mtd0", false);
- if (ret < 0)
-{
- printf("ERROR: bchdev_register /dev/mtd0 failed: %d\n", ret);
- fflush(stdout);
- exit(3);
+ printf("ERROR: register_mtddriver /dev/mtd0 failed: %d\n", ret);
+ status = 2;
+ goto errout;
Review Comment:
yes now we use different err lable for error handling
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Re: [PR] examples/mtdpart:Register MTD devices using the mtd_register method [nuttx-apps]
jingfei195887 commented on code in PR #3130:
URL: https://github.com/apache/nuttx-apps/pull/3130#discussion_r2234848403
##
examples/mtdpart/mtdpart_main.c:
##
@@ -280,8 +257,8 @@ int main(int argc, FAR char *argv[])
if (!buffer)
{
printf("ERROR: failed to allocate a sector buffer\n");
- fflush(stdout);
- exit(7);
+ status = 6;
+ goto errout;
Review Comment:
done err_buf is added
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Re: [PR] examples/mtdpart:Register MTD devices using the mtd_register method [nuttx-apps]
jingfei195887 commented on code in PR #3130:
URL: https://github.com/apache/nuttx-apps/pull/3130#discussion_r2234846113
##
examples/mtdpart/mtdpart_main.c:
##
@@ -530,19 +507,47 @@ int main(int argc, FAR char *argv[])
{
printf("ERROR: Bad value %lu, expected %lu\n",
(long)buffer[k], (long)(~check));
- fflush(stdout);
- exit(27);
+ close(fd);
+ status = 23;
+ goto errout;
}
check += sizeof(uint32_t);
}
}
close(fd);
+ status = 0;
/* And exit without bothering to clean up */
printf("PASS: Everything looks good\n");
+
+errout:
+
+ if (status)
+{
+ printf("ERROR: error status %d\n", status);
+}
+
+ if (buffer)
+{
+ free(buffer);
+}
+
+ if (master)
Review Comment:
In new version of this patch, none of the variables in the main function
need initial values. Also, during error handling, there's no need to check if
master and buffer are null, or if fd is greater than or equal to 0.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Re: [PR] examples/mtdpart:Register MTD devices using the mtd_register method [nuttx-apps]
jingfei195887 commented on code in PR #3130:
URL: https://github.com/apache/nuttx-apps/pull/3130#discussion_r2234834865
##
examples/mtdpart/mtdpart_main.c:
##
@@ -159,8 +159,8 @@ int main(int argc, FAR char *argv[])
if (!master)
{
printf("ERROR: Failed to create RAM MTD instance\n");
- fflush(stdout);
- exit(1);
+ status = 1;
+ goto errout;
Review Comment:
done. `errout` is removed. Now we use different err lable for error handling
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Re: [PR] examples/mtdpart:Register MTD devices using the mtd_register method [nuttx-apps]
jingfei195887 commented on code in PR #3130:
URL: https://github.com/apache/nuttx-apps/pull/3130#discussion_r2234826162
##
examples/mtdpart/mtdpart_main.c:
##
@@ -204,7 +194,9 @@ int main(int argc, FAR char *argv[])
if (ret < 0)
{
ferr("ERROR: mtd->ioctl failed: %d\n", ret);
- exit(3);
+ unregister_mtddriver("/dev/mtd0");
Review Comment:
Now all the "unregister_mtddriver" work is moved to the function end, I use
`err_xxx` lable to handle different error type
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Re: [PR] examples/mtdpart:Register MTD devices using the mtd_register method [nuttx-apps]
jingfei195887 commented on code in PR #3130:
URL: https://github.com/apache/nuttx-apps/pull/3130#discussion_r2234827297
##
examples/mtdpart/mtdpart_main.c:
##
@@ -317,8 +294,9 @@ int main(int argc, FAR char *argv[])
if (nbytes < 0)
{
printf("ERROR: write to /dev/mtd0 failed: %d\n", errno);
- fflush(stdout);
- exit(9);
+ close(fd);
Review Comment:
done. close(fd) is done in the label err_fd
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Re: [PR] examples/mtdpart:Register MTD devices using the mtd_register method [nuttx-apps]
jingfei195887 commented on code in PR #3130:
URL: https://github.com/apache/nuttx-apps/pull/3130#discussion_r2234520882
##
examples/mtdpart/mtdpart_main.c:
##
@@ -530,19 +507,47 @@ int main(int argc, FAR char *argv[])
{
printf("ERROR: Bad value %lu, expected %lu\n",
(long)buffer[k], (long)(~check));
- fflush(stdout);
- exit(27);
+ close(fd);
+ status = 23;
+ goto errout;
}
check += sizeof(uint32_t);
}
}
close(fd);
+ status = 0;
/* And exit without bothering to clean up */
printf("PASS: Everything looks good\n");
+
+errout:
+
+ if (status)
+{
+ printf("ERROR: error status %d\n", status);
+}
+
+ if (buffer)
Review Comment:
done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Re: [PR] examples/mtdpart:Register MTD devices using the mtd_register method [nuttx-apps]
xiaoxiang781216 commented on PR #3130: URL: https://github.com/apache/nuttx-apps/pull/3130#issuecomment-3101234044 @jingfei195887 please drop merge patch. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] examples/mtdpart:Register MTD devices using the mtd_register method [nuttx-apps]
xiaoxiang781216 commented on code in PR #3130:
URL: https://github.com/apache/nuttx-apps/pull/3130#discussion_r2214853980
##
examples/mtdpart/mtdpart_main.c:
##
@@ -530,19 +507,47 @@ int main(int argc, FAR char *argv[])
{
printf("ERROR: Bad value %lu, expected %lu\n",
(long)buffer[k], (long)(~check));
- fflush(stdout);
- exit(27);
+ close(fd);
+ status = 23;
+ goto errout;
}
check += sizeof(uint32_t);
}
}
close(fd);
+ status = 0;
/* And exit without bothering to clean up */
printf("PASS: Everything looks good\n");
+
+errout:
+
+ if (status)
+{
+ printf("ERROR: error status %d\n", status);
Review Comment:
remove the unnecessary log
##
examples/mtdpart/mtdpart_main.c:
##
@@ -133,8 +133,7 @@ int main(int argc, FAR char *argv[])
FAR struct mtd_dev_s *part[CONFIG_EXAMPLES_MTDPART_NPARTITIONS + 1];
FAR struct mtd_geometry_s geo;
FAR uint32_t *buffer;
Review Comment:
need zero
##
examples/mtdpart/mtdpart_main.c:
##
@@ -179,22 +179,12 @@ int main(int argc, FAR char *argv[])
* interesting.
*/
- ret = ftl_initialize(0, master);
+ ret = register_mtddriver("/dev/mtd0", master, 0775, NULL);
if (ret < 0)
{
- printf("ERROR: ftl_initialize /dev/mtdblock0 failed: %d\n", ret);
- fflush(stdout);
- exit(2);
-}
-
- /* Now create a character device on the block device */
-
- ret = bchdev_register("/dev/mtdblock0", "/dev/mtd0", false);
- if (ret < 0)
-{
- printf("ERROR: bchdev_register /dev/mtd0 failed: %d\n", ret);
- fflush(stdout);
- exit(3);
+ printf("ERROR: register_mtddriver /dev/mtd0 failed: %d\n", ret);
+ status = 2;
+ goto errout;
Review Comment:
goto err_mtd
##
examples/mtdpart/mtdpart_main.c:
##
@@ -280,8 +257,8 @@ int main(int argc, FAR char *argv[])
if (!buffer)
{
printf("ERROR: failed to allocate a sector buffer\n");
- fflush(stdout);
- exit(7);
+ status = 6;
+ goto errout;
Review Comment:
goto err_buf
##
examples/mtdpart/mtdpart_main.c:
##
@@ -530,19 +507,47 @@ int main(int argc, FAR char *argv[])
{
printf("ERROR: Bad value %lu, expected %lu\n",
(long)buffer[k], (long)(~check));
- fflush(stdout);
- exit(27);
+ close(fd);
+ status = 23;
+ goto errout;
}
check += sizeof(uint32_t);
}
}
close(fd);
+ status = 0;
/* And exit without bothering to clean up */
printf("PASS: Everything looks good\n");
+
+errout:
+
+ if (status)
+{
+ printf("ERROR: error status %d\n", status);
+}
+
+ if (buffer)
+{
+ free(buffer);
+}
+
+ if (master)
Review Comment:
need zero at line 132, please fix ALL warning before submit your change.
##
examples/mtdpart/mtdpart_main.c:
##
@@ -530,19 +507,47 @@ int main(int argc, FAR char *argv[])
{
printf("ERROR: Bad value %lu, expected %lu\n",
(long)buffer[k], (long)(~check));
- fflush(stdout);
- exit(27);
+ close(fd);
+ status = 23;
+ goto errout;
}
check += sizeof(uint32_t);
}
}
close(fd);
+ status = 0;
/* And exit without bothering to clean up */
printf("PASS: Everything looks good\n");
+
+errout:
+
+ if (status)
+{
+ printf("ERROR: error status %d\n", status);
+}
+
+ if (buffer)
Review Comment:
remove the check
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Re: [PR] examples/mtdpart:Register MTD devices using the mtd_register method [nuttx-apps]
xiaoxiang781216 commented on code in PR #3130:
URL: https://github.com/apache/nuttx-apps/pull/3130#discussion_r2212335501
##
examples/mtdpart/mtdpart_main.c:
##
@@ -317,8 +294,9 @@ int main(int argc, FAR char *argv[])
if (nbytes < 0)
{
printf("ERROR: write to /dev/mtd0 failed: %d\n", errno);
- fflush(stdout);
- exit(9);
+ close(fd);
Review Comment:
move close to the end and add label err_fd
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Re: [PR] examples/mtdpart:Register MTD devices using the mtd_register method [nuttx-apps]
xiaoxiang781216 commented on code in PR #3130:
URL: https://github.com/apache/nuttx-apps/pull/3130#discussion_r2212333569
##
examples/mtdpart/mtdpart_main.c:
##
@@ -204,7 +194,9 @@ int main(int argc, FAR char *argv[])
if (ret < 0)
{
ferr("ERROR: mtd->ioctl failed: %d\n", ret);
- exit(3);
+ unregister_mtddriver("/dev/mtd0");
Review Comment:
move to the end and add label err_mtd
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Re: [PR] examples/mtdpart:Register MTD devices using the mtd_register method [nuttx-apps]
xiaoxiang781216 commented on code in PR #3130:
URL: https://github.com/apache/nuttx-apps/pull/3130#discussion_r2212338074
##
examples/mtdpart/mtdpart_main.c:
##
@@ -159,8 +159,8 @@ int main(int argc, FAR char *argv[])
if (!master)
{
printf("ERROR: Failed to create RAM MTD instance\n");
- fflush(stdout);
- exit(1);
+ status = 1;
+ goto errout;
Review Comment:
```suggestion
goto err;
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Re: [PR] examples/mtdpart:Register MTD devices using the mtd_register method [nuttx-apps]
xiaoxiang781216 commented on code in PR #3130:
URL: https://github.com/apache/nuttx-apps/pull/3130#discussion_r2212335501
##
examples/mtdpart/mtdpart_main.c:
##
@@ -317,8 +294,9 @@ int main(int argc, FAR char *argv[])
if (nbytes < 0)
{
printf("ERROR: write to /dev/mtd0 failed: %d\n", errno);
- fflush(stdout);
- exit(9);
+ close(fd);
Review Comment:
move close to the end and add label err_close
##
examples/mtdpart/mtdpart_main.c:
##
@@ -159,8 +159,8 @@ int main(int argc, FAR char *argv[])
if (!master)
{
printf("ERROR: Failed to create RAM MTD instance\n");
- fflush(stdout);
- exit(1);
+ status = 1;
+ goto errout;
Review Comment:
```suggestion
goto ert;
```
##
examples/mtdpart/mtdpart_main.c:
##
@@ -204,7 +194,9 @@ int main(int argc, FAR char *argv[])
if (ret < 0)
{
ferr("ERROR: mtd->ioctl failed: %d\n", ret);
- exit(3);
+ unregister_mtddriver("/dev/mtd0");
Review Comment:
move to the end and add label err_unreg
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Re: [PR] examples/mtdpart:Register MTD devices using the mtd_register method [nuttx-apps]
xiaoxiang781216 commented on PR #3130: URL: https://github.com/apache/nuttx-apps/pull/3130#issuecomment-3078846282 still have ci error, please run checkpatch.sh before you update patch. @jingfei195887 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] examples/mtdpart:Register MTD devices using the mtd_register method [nuttx-apps]
jingfei195887 commented on code in PR #3130:
URL: https://github.com/apache/nuttx-apps/pull/3130#discussion_r2210544472
##
examples/mtdpart/mtdpart_main.c:
##
@@ -364,31 +342,20 @@ int main(int argc, FAR char *argv[])
{
printf("ERROR: lseek to offset %ld failed: %d\n",
(unsigned long)sectoff, errno);
- fflush(stdout);
- exit(11);
+ close(fd);
+ status = 10;
+ goto errout;
}
/* Read the next block into memory */
nbytes = read(fd, buffer, geo.blocksize);
if (nbytes < 0)
{
- printf("ERROR: read from %s failed: %d\n", charname, errno);
- fflush(stdout);
- exit(12);
-}
- else if (nbytes == 0)
Review Comment:
The code here is redundant. Please check lines 366 to 382 of the new file.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Re: [PR] examples/mtdpart:Register MTD devices using the mtd_register method [nuttx-apps]
jingfei195887 commented on PR #3130: URL: https://github.com/apache/nuttx-apps/pull/3130#issuecomment-3078800465 > please fix: > > ``` > Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/mtdpart/mtdpart_main.c:551:1: error: Too many blank lines > /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/mtdpart/mtdpart_main.c:457: verifed ==> verified > ``` done -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] examples/mtdpart:Register MTD devices using the mtd_register method [nuttx-apps]
jingfei195887 commented on PR #3130: URL: https://github.com/apache/nuttx-apps/pull/3130#issuecomment-3068323986 > please fix: > > ``` > Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/mtdpart/mtdpart_main.c:551:1: error: Too many blank lines > /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/mtdpart/mtdpart_main.c:457: verifed ==> verified > ``` sure, working on this now -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] examples/mtdpart:Register MTD devices using the mtd_register method [nuttx-apps]
xiaoxiang781216 commented on PR #3130: URL: https://github.com/apache/nuttx-apps/pull/3130#issuecomment-3068210330 please fix: ``` Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/mtdpart/mtdpart_main.c:551:1: error: Too many blank lines /home/runner/work/nuttx-apps/nuttx-apps/apps/examples/mtdpart/mtdpart_main.c:457: verifed ==> verified ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] examples/mtdpart:Register MTD devices using the mtd_register method [nuttx-apps]
xiaoxiang781216 commented on code in PR #3130:
URL: https://github.com/apache/nuttx-apps/pull/3130#discussion_r2203442031
##
examples/mtdpart/mtdpart_main.c:
##
@@ -364,31 +342,20 @@ int main(int argc, FAR char *argv[])
{
printf("ERROR: lseek to offset %ld failed: %d\n",
(unsigned long)sectoff, errno);
- fflush(stdout);
- exit(11);
+ close(fd);
+ status = 10;
+ goto errout;
}
/* Read the next block into memory */
nbytes = read(fd, buffer, geo.blocksize);
if (nbytes < 0)
{
- printf("ERROR: read from %s failed: %d\n", charname, errno);
- fflush(stdout);
- exit(12);
-}
- else if (nbytes == 0)
Review Comment:
why remove
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
