Revision tags: v1.1.0 |
|
#
4dfefa97 |
| 02-May-2023 |
Andrew Jeffery <andrew@aj.id.au> |
test: ringbuffer-test-utils: Add stdlib.h for malloc()/free()
Include what we use to address clang-tidy issues:
``` Error while processing /mnt/host/andrew/home/andrew/src/openbmc/obmc-console/test
test: ringbuffer-test-utils: Add stdlib.h for malloc()/free()
Include what we use to address clang-tidy issues:
``` Error while processing /mnt/host/andrew/home/andrew/src/openbmc/obmc-console/test/ringbuffer-test-utils.c. /mnt/host/andrew/home/andrew/src/openbmc/obmc-console/test/ringbuffer-test-utils.c:25:2: error: call to undeclared library function 'free' with type 'void (void *)'; ISO C99 and later do not support implicit function declarations [clang-diagnostic-implicit-function-declaration] free(ctx->data); ^ /mnt/host/andrew/home/andrew/src/openbmc/obmc-console/test/ringbuffer-test-utils.c:25:2: note: include the header <stdlib.h> or explicitly provide a declaration for 'free' /mnt/host/andrew/home/andrew/src/openbmc/obmc-console/test/ringbuffer-test-utils.c:64:15: error: call to undeclared library function 'realloc' with type 'void *(void *, unsigned long)'; ISO C99 and later do not support implicit function declarations [clang-diagnostic-implicit-function-declaration] ctx->data = realloc(ctx->data, ctx->len + len); ^ /mnt/host/andrew/home/andrew/src/openbmc/obmc-console/test/ringbuffer-test-utils.c:64:15: note: include the header <stdlib.h> or explicitly provide a declaration for 'realloc' ```
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: Icf6d9ab735fb035572e8953ec474afd81efa53e9
show more ...
|
#
1b868441 |
| 18-Apr-2023 |
Andrew Jeffery <andrew@aj.id.au> |
obmc-console: Fix ringbuffer-test-utils analysis
ninja's clang-tidy target barfs due to the strategy of including C files into each other for test purposes. Help it out by moving the ringbuffer stru
obmc-console: Fix ringbuffer-test-utils analysis
ninja's clang-tidy target barfs due to the strategy of including C files into each other for test purposes. Help it out by moving the ringbuffer struct definitions into console-server.h so it can find them when analysing test/ringbuffer-test-utils.c.
obmc-console isn't a library, so it's not like we're trying to avoid expanding API/ABI surface.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: Ifd4501d3ca7f3bb02c557a1c31364aadd2b26abe
show more ...
|
#
b70f8713 |
| 18-Apr-2023 |
Andrew Jeffery <andrew@aj.id.au> |
obmc-console: Fix readability-isolate-declaration
For example:
``` /usr/bin/clang-tidy -checks=-*, readability-isolate-declaration -export-fixes /tmp/tmpoo7fbs72/tmpo8xiwfxs.yaml -p=build /mnt/host
obmc-console: Fix readability-isolate-declaration
For example:
``` /usr/bin/clang-tidy -checks=-*, readability-isolate-declaration -export-fixes /tmp/tmpoo7fbs72/tmpo8xiwfxs.yaml -p=build /mnt/host/andrew/home/andrew/src/openbmc/obmc-console/test/test-client-escape.c /mnt/host/andrew/home/andrew/src/openbmc/obmc-console/build/../config.c:61:2: error: multiple declarations in a single statement reduces readability [readability-isolate-declaration,-warnings-as-errors] char *name, *value; ^~~~~~~~~~~~~~~~~~~ /mnt/host/andrew/home/andrew/src/openbmc/obmc-console/build/../config.c:62:2: error: multiple declarations in a single statement reduces readability [readability-isolate-declaration,-warnings-as-errors] char *p, *line; ^~~~~~~~~~~~~~~ /mnt/host/andrew/home/andrew/src/openbmc/obmc-console/build/../config.c:110:2: error: multiple declarations in a single statement reduces readability [readability-isolate-declaration,-warnings-as-errors] size_t size, len; ^~~~~~~~~~~~~~~~~ /mnt/host/andrew/home/andrew/src/openbmc/obmc-console/build/../config.c:170:2: error: multiple declarations in a single statement reduces readability [readability-isolate-declaration,-warnings-as-errors] struct config_item *item, *next; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /mnt/host/andrew/home/andrew/src/openbmc/obmc-console/build/../console-client.c:263:2: error: multiple declarations in a single statement reduces readability [readability-isolate-declaration,-warnings-as-errors] struct console_client _client, *client; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 6 warnings generated. ```
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: Ia7829b1672ea2dfb3fa020c7c48bd8266e6a1769
show more ...
|
#
2834c5b1 |
| 18-Apr-2023 |
Andrew Jeffery <andrew@aj.id.au> |
obmc-console: Fix readability-braces-around-statements
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: I88d2bdcb15106298d83a1cf7176e069092820f1d
|
#
5c359cc6 |
| 18-Apr-2023 |
Andrew Jeffery <andrew@aj.id.au> |
obmc-console: Fix bugprone-narrowing-conversions
For example:
``` /mnt/host/andrew/home/andrew/src/openbmc/obmc-console/build/../console-server.c:769:9: error: narrowing conversion from 'ssize_t' (
obmc-console: Fix bugprone-narrowing-conversions
For example:
``` /mnt/host/andrew/home/andrew/src/openbmc/obmc-console/build/../console-server.c:769:9: error: narrowing conversion from 'ssize_t' (aka 'long') to signed type 'int' is implementation-defined [bugprone-narrowing-conversions,-warnings-as-errors] rc = read(console->tty_fd, buf, sizeof(buf)); ^ ```
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: I67c158b411f1533ca3b5a62803116e95907e8c5b
show more ...
|
#
a72711af |
| 18-Apr-2023 |
Andrew Jeffery <andrew@aj.id.au> |
obmc-console: Add clang-format configuration
And apply the formatting.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: I75251051affa5129c8698185baf8d151302b19d6
|
#
8f548f6c |
| 17-Apr-2023 |
Andrew Jeffery <andrew@aj.id.au> |
obmc-console: Clean up invalid sign comparisons
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: I83fae6857620ca2913952bea597c1299dd962620
|
#
c9775ce7 |
| 07-Feb-2017 |
Jeremy Kerr <jk@ozlabs.org> |
server: Use ringbuffer for socket backlog
Currently, the socket handler uses a linear buffer for the backlog data; this means we need to shift up to 128kB of data after each socket write().
This ch
server: Use ringbuffer for socket backlog
Currently, the socket handler uses a linear buffer for the backlog data; this means we need to shift up to 128kB of data after each socket write().
This change introduces a single-producer-multiple-consumer ringbuffer, to avoid the need for memmove()ing data around; we can simply update pointers instead of shifting data.
We add this as a new file (ringbuffer.c), to make it a little more modular. To mitigate the risk of subtle pointer arithmetic issues, we add a set of tests too.
Change-Id: Ib7c5151d3cf1f588436f5461000b6fed22d0681c Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
show more ...
|