From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.tuxdriver.com (charlotte.tuxdriver.com [70.61.120.58]) by dpdk.org (Postfix) with ESMTP id A3E365AAD for ; Wed, 21 Jan 2015 21:58:11 +0100 (CET) Received: from hmsreliant.think-freely.org ([2001:470:8:a08:7aac:c0ff:fec2:933b] helo=localhost) by smtp.tuxdriver.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.63) (envelope-from ) id 1YE2Ln-00079c-AY; Wed, 21 Jan 2015 15:58:09 -0500 From: Neil Horman To: dev@dpdk.org Date: Wed, 21 Jan 2015 15:57:30 -0500 Message-Id: <1421873870-21754-6-git-send-email-nhorman@tuxdriver.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1421873870-21754-1-git-send-email-nhorman@tuxdriver.com> References: <1419109299-9603-1-git-send-email-nhorman@tuxdriver.com> <1421873870-21754-1-git-send-email-nhorman@tuxdriver.com> X-Spam-Score: -2.9 (--) X-Spam-Status: No Subject: [dpdk-dev] [PATCH v7 06/26] log: remove unnecessary stubs X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2015 20:58:12 -0000 From: Stephen Hemminger 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 Acked-by: Thomas Monjalon --- lib/librte_eal/linuxapp/eal/eal_log.c | 50 ----------------------------------- 1 file changed, 50 deletions(-) diff --git a/lib/librte_eal/linuxapp/eal/eal_log.c b/lib/librte_eal/linuxapp/eal/eal_log.c index 94dedfb..a2d9056 100644 --- a/lib/librte_eal/linuxapp/eal/eal_log.c +++ b/lib/librte_eal/linuxapp/eal/eal_log.c @@ -83,33 +83,8 @@ console_log_write(__attribute__((unused)) void *c, const char *buf, size_t size) 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)) void *c, const char *buf, size_t size) 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; -- 2.1.0