[dpdk-dev] (no subject)


Mon Dec 8 18:51:23 CET 2014


>From stephen at networkplumber.org Mon Dec  8 09:46:51 2014
Message-Id: <20141208174651.064719116 at networkplumber.org>
User-Agent: quilt/0.63-1
Date: Mon, 08 Dec 2014 09:45:55 -0800
From: Stephen Hemminger <stephen at networkplumber.org>
To: Thomas Monjalon <thomas.monjalon at 6wind.com>
Cc: dev at dpdk.org,
 Stephen Hemminger <stephen at networkplumber.org>
Subject: [PATCH 1/6] rte_log: remove unnecessary stubs
References: <20141208174554.889069531 at networkplumber.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-15
Content-Disposition: inline; filename=rte-log-unneeded-funct.patch

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 at 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;
 




More information about the dev mailing list