* [dpdk-dev] [PATCH] rte_log: remove unnecessary stubs
@ 2014-12-09 16:35 Stephen Hemminger
2015-01-15 13:34 ` Thomas Monjalon
0 siblings, 1 reply; 2+ messages in thread
From: Stephen Hemminger @ 2014-12-09 16:35 UTC (permalink / raw)
To: dev
The read/seek/close stub functions are unnecessary on the
log stream. Per glibc fopencookie man page:
cookie_read_function_t *read
If *read is a null pointer, then reads from the custom stream
always return end of file.
cookie_seek_function_t *seek
If *seek is a null pointer, then it is not possible to perform
seek operations on the stream.
cookie_close_function_t *close
If *close is NULL, then no special action is performed when the
stream is closed.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
--- a/lib/librte_eal/linuxapp/eal/eal_log.c 2014-12-08 09:25:23.725812125 -0800
+++ b/lib/librte_eal/linuxapp/eal/eal_log.c 2014-12-08 09:25:23.661811703 -0800
@@ -83,33 +83,8 @@ console_log_write(__attribute__((unused)
return ret;
}
-static ssize_t
-console_log_read(__attribute__((unused)) void *c,
- __attribute__((unused)) char *buf,
- __attribute__((unused)) size_t size)
-{
- return 0;
-}
-
-static int
-console_log_seek(__attribute__((unused)) void *c,
- __attribute__((unused)) off64_t *offset,
- __attribute__((unused)) int whence)
-{
- return -1;
-}
-
-static int
-console_log_close(__attribute__((unused)) void *c)
-{
- return 0;
-}
-
static cookie_io_functions_t console_log_func = {
- .read = console_log_read,
.write = console_log_write,
- .seek = console_log_seek,
- .close = console_log_close
};
/*
@@ -150,33 +125,8 @@ early_log_write(__attribute__((unused))
return ret;
}
-static ssize_t
-early_log_read(__attribute__((unused)) void *c,
- __attribute__((unused)) char *buf,
- __attribute__((unused)) size_t size)
-{
- return 0;
-}
-
-static int
-early_log_seek(__attribute__((unused)) void *c,
- __attribute__((unused)) off64_t *offset,
- __attribute__((unused)) int whence)
-{
- return -1;
-}
-
-static int
-early_log_close(__attribute__((unused)) void *c)
-{
- return 0;
-}
-
static cookie_io_functions_t early_log_func = {
- .read = early_log_read,
.write = early_log_write,
- .seek = early_log_seek,
- .close = early_log_close
};
static FILE *early_log_stream;
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [dpdk-dev] [PATCH] rte_log: remove unnecessary stubs
2014-12-09 16:35 [dpdk-dev] [PATCH] rte_log: remove unnecessary stubs Stephen Hemminger
@ 2015-01-15 13:34 ` Thomas Monjalon
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Monjalon @ 2015-01-15 13:34 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: dev
> The read/seek/close stub functions are unnecessary on the
> log stream. Per glibc fopencookie man page:
>
> cookie_read_function_t *read
> If *read is a null pointer, then reads from the custom stream
> always return end of file.
>
> cookie_seek_function_t *seek
> If *seek is a null pointer, then it is not possible to perform
> seek operations on the stream.
>
> cookie_close_function_t *close
> If *close is NULL, then no special action is performed when the
> stream is closed.
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Applied
Thanks
--
Thomas
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-01-15 13:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-09 16:35 [dpdk-dev] [PATCH] rte_log: remove unnecessary stubs Stephen Hemminger
2015-01-15 13:34 ` Thomas Monjalon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).