cmdline: remove cmdline_poll()
PATCH 1/1 cmdline: remove cmdline_poll()
The API functions cmdline_poll() was unused by any project, untested, and it was buggy. Remove it from 23.11 release.
--- doc/guides/rel_notes/release_23_11.rst | 10 +--- lib/cmdline/cmdline.c | 34 ------------- lib/cmdline/cmdline.h | 16 ------ lib/cmdline/cmdline_os_unix.c | 12 ----- lib/cmdline/cmdline_os_windows.c | 68 -------------------------- lib/cmdline/cmdline_private.h | 3 -- lib/cmdline/version.map | 1 - 7 files changed, 1 insertion(+), 143 deletions(-)
doc/guides/rel_notes/release_23_11.rst +1 -9
@@ -59,15 +59,7 @@ New Features Removed Items ------------- -.. This section should contain removed items in this release. Sample format: - - * Add a short 1-2 sentence description of the removed item - in the past tense. - - This section is a comment. Do not overwrite or remove it. - Also, make sure to start the actual text at the margin. - ======================================================= - +* cmdline: Removed broken and unused function ``cmdline_poll``. API Changes -----------
lib/cmdline/cmdline.c +0 -34
@@ -177,40 +177,6 @@ cmdline_quit(struct cmdline *cl)rdline_quit (&cl->rdl); } -int -cmdline_poll (struct cmdline *cl) -{ -int status; -ssize_t read_status; -char c; - -if (!cl) -return -EINVAL ; -else if (cl->rdl.status ==RDLINE_EXITED ) -return RDLINE_EXITED ; - - status =cmdline_poll_char (cl); -if (status <0 ) -return status; -else if (status >0 ) { - c =-1 ; - read_status =cmdline_read_char (cl, &c); -if (read_status <0 ) -return read_status; - -if (read_status ==0 ) { -/* end of file is implicit quit */ -cmdline_quit (cl); - }else { - status =cmdline_in (cl, &c,1 ); -if (status <0 && cl->rdl.status !=RDLINE_EXITED ) -return status; - } - } - -return cl->rdl.status; -} -void cmdline_interact (struct cmdline *cl) {
lib/cmdline/cmdline.h +0 -16
@@ -43,22 +43,6 @@ __rte_experimentalstruct rdline *cmdline_get_rdline (struct cmdline *cl); -/** -* @deprecated Function is broken and scheduled for removal. -* -* This function is nonblocking equivalent of ``cmdline_interact()``. It polls -* *cl* for one character and interpret it. If return value is *RDLINE_EXITED* -* it mean that ``cmdline_quit()`` was invoked. -* -* @param cl -* The command line object. -* -* @return -* On success return object status - one of *enum rdline_status*. -* On error return negative value. -*/ -__rte_deprecated -int cmdline_poll(struct cmdline *cl);void cmdline_interact (struct cmdline *cl);void cmdline_quit (struct cmdline *cl);
lib/cmdline/cmdline_os_unix.c +0 -12
@@ -28,18 +28,6 @@ terminal_restore(const struct cmdline *cl)tcsetattr (fileno (stdin),TCSANOW , &cl->oldterm); } -int -cmdline_poll_char (struct cmdline *cl) -{ -struct pollfd pfd; - - pfd.fd = cl->s_in; - pfd.events =POLLIN ; - pfd.revents =0 ; - -return poll (&pfd,1 ,0 ); -} -ssize_t cmdline_read_char (struct cmdline *cl,char *c) {
lib/cmdline/cmdline_os_windows.c +0 -68
74 lines not on this page · raw message
lib/cmdline/cmdline_private.h +0 -3
@@ -84,9 +84,6 @@ void terminal_adjust(struct cmdline *cl);/* Restore terminal settings form oldterm. */ void terminal_restore (const struct cmdline *cl); -/* Check if a single character can be read from input. */ -int cmdline_poll_char (struct cmdline *cl); -/* Read one character from input. */ ssize_t cmdline_read_char (struct cmdline *cl,char *c);
lib/cmdline/version.map +0 -1
@@ -40,7 +40,6 @@ DPDK_24 { cmdline_parse_num; cmdline_parse_portlist; cmdline_parse_string; - cmdline_poll; cmdline_printf; cmdline_quit; cmdline_set_prompt;
Signature · 1 line
2.39.2
Quoted 4 lines · Stephen Hemminger
The API functions
cmdline_poll()was unused by any project, untested, and it was buggy. Remove it from 23.11 release.Signed-off-by Stephen Hemminger <[email protected]>
Quoted 10 lines
--- doc/guides/rel_notes/release_23_11.rst | 10 +--- lib/cmdline/cmdline.c | 34 ------------- lib/cmdline/cmdline.h | 16 ------ lib/cmdline/cmdline_os_unix.c | 12 ----- lib/cmdline/cmdline_os_windows.c | 68 -------------------------- lib/cmdline/cmdline_private.h | 3 -- lib/cmdline/version.map | 1 - 7 files changed, 1 insertion(+), 143 deletions(-)
with one comment below
Quoted 7 lines
doc/guides/rel_notes/release_23_11.rst +0
-0@@ -59,15 +59,7 @@ New Features Removed Items -------------
doc/guides/rel_notes/release_23_11.rst New Features · line 70
Quoted 10 lines
doc/guides/rel_notes/release_23_11.rst +0
-9-.. This section should contain removed items in this release. Sample format: - - * Add a short 1-2 sentence description of the removed item - in the past tense. - - This section is a comment. Do not overwrite or remove it. - Also, make sure to start the actual text at the margin. - ======================================================= -
I believe we keep this boilerplate in place until the finalization of the release. We want to ensure the instructions are read by all who are editing this file.
PATCH v2 1/1 cmdline: remove cmdline_poll()
In reply to Stephen HemmingerThe API functions cmdline_poll() was unused by any project, untested, and buggy. Remove it from 23.11 release.
--- doc/guides/rel_notes/release_23_11.rst | 1 + lib/cmdline/cmdline.c | 34 ------------- lib/cmdline/cmdline.h | 16 ------ lib/cmdline/cmdline_os_unix.c | 12 ----- lib/cmdline/cmdline_os_windows.c | 68 -------------------------- lib/cmdline/cmdline_private.h | 3 -- lib/cmdline/version.map | 1 - 7 files changed, 1 insertion(+), 134 deletions(-)
doc/guides/rel_notes/release_23_11.rst +1 -0
@@ -68,6 +68,7 @@ Removed Items Also, make sure to start the actual text at the margin. ======================================================= +* cmdline: Removed broken and unused function ``cmdline_poll``. API Changes -----------
lib/cmdline/cmdline.c +0 -34
@@ -177,40 +177,6 @@ cmdline_quit(struct cmdline *cl)rdline_quit (&cl->rdl); } -int -cmdline_poll (struct cmdline *cl) -{ -int status; -ssize_t read_status; -char c; - -if (!cl) -return -EINVAL ; -else if (cl->rdl.status ==RDLINE_EXITED ) -return RDLINE_EXITED ; - - status =cmdline_poll_char (cl); -if (status <0 ) -return status; -else if (status >0 ) { - c =-1 ; - read_status =cmdline_read_char (cl, &c); -if (read_status <0 ) -return read_status; - -if (read_status ==0 ) { -/* end of file is implicit quit */ -cmdline_quit (cl); - }else { - status =cmdline_in (cl, &c,1 ); -if (status <0 && cl->rdl.status !=RDLINE_EXITED ) -return status; - } - } - -return cl->rdl.status; -} -void cmdline_interact (struct cmdline *cl) {
lib/cmdline/cmdline.h +0 -16
@@ -43,22 +43,6 @@ __rte_experimentalstruct rdline *cmdline_get_rdline (struct cmdline *cl); -/** -* @deprecated Function is broken and scheduled for removal. -* -* This function is nonblocking equivalent of ``cmdline_interact()``. It polls -* *cl* for one character and interpret it. If return value is *RDLINE_EXITED* -* it mean that ``cmdline_quit()`` was invoked. -* -* @param cl -* The command line object. -* -* @return -* On success return object status - one of *enum rdline_status*. -* On error return negative value. -*/ -__rte_deprecated -int cmdline_poll(struct cmdline *cl);void cmdline_interact (struct cmdline *cl);void cmdline_quit (struct cmdline *cl);
lib/cmdline/cmdline_os_unix.c +0 -12
@@ -28,18 +28,6 @@ terminal_restore(const struct cmdline *cl)tcsetattr (fileno (stdin),TCSANOW , &cl->oldterm); } -int -cmdline_poll_char (struct cmdline *cl) -{ -struct pollfd pfd; - - pfd.fd = cl->s_in; - pfd.events =POLLIN ; - pfd.revents =0 ; - -return poll (&pfd,1 ,0 ); -} -ssize_t cmdline_read_char (struct cmdline *cl,char *c) {
lib/cmdline/cmdline_os_windows.c +0 -68
74 lines not on this page · raw message
lib/cmdline/cmdline_private.h +0 -3
@@ -84,9 +84,6 @@ void terminal_adjust(struct cmdline *cl);/* Restore terminal settings form oldterm. */ void terminal_restore (const struct cmdline *cl); -/* Check if a single character can be read from input. */ -int cmdline_poll_char (struct cmdline *cl); -/* Read one character from input. */ ssize_t cmdline_read_char (struct cmdline *cl,char *c);
lib/cmdline/version.map +0 -1
@@ -40,7 +40,6 @@ DPDK_24 { cmdline_parse_num; cmdline_parse_portlist; cmdline_parse_string; - cmdline_poll; cmdline_printf; cmdline_quit; cmdline_set_prompt;
Signature · 1 line
2.39.2
Thomas Monjalon
Applied02/08/2023 01:48, Stephen Hemminger:
Quoted 5 lines
The API functions
cmdline_poll()was unused by any project, untested, and buggy. Remove it from 23.11 release.Signed-off-by Stephen Hemminger <[email protected]>Acked-by Bruce Richardson <[email protected]>
Applied, thanks.