From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f54.google.com (mail-pa0-f54.google.com [209.85.220.54]) by dpdk.org (Postfix) with ESMTP id 9F72168AE for ; Tue, 9 Dec 2014 17:35:57 +0100 (CET) Received: by mail-pa0-f54.google.com with SMTP id fb1so865366pad.27 for ; Tue, 09 Dec 2014 08:35:57 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-type:content-transfer-encoding; bh=ViYQkA9/NqgQOaWTp1ff/q+5lqfg2SD3A/17F2QKDdU=; b=Sh5E9ax4rHZk9fOldgxso6cZWEmMYAuK40ODmjg+LeyyINhez/UkQpElOivnyTNZ0e ruOfhefG2dIQWZHbP4qBH/qVlxzX4juo4fD9COS+RGy4IOO1coco5rF7V5R8fOb7kg7o ekuAUFECvJPmPvOJ2667P3sj2QdJgh73s6K5N3U0C4it/FHRM7Q8K3+NI06J7t45MUWo 313Po4/i9/teXlUqyHXOwUO4LwIM4s5S4RVTC/Gzq5q9Dl7/1+nRlYLsTBfl2yJPYLkB 1PACLCSB8q/PsdUeiTlDXW7zHcxtZQ9+ndlEs22RMyXyw3SGwBaq0NNQbffdfBFR1aHd d5fg== X-Gm-Message-State: ALoCoQnYcHOAzVeJ/2evRYDbRYVK7AazD5/OcG4dy+aXwqQjNsRfAdN3wSgQGQeMRDf2/ODyDfEs X-Received: by 10.66.160.129 with SMTP id xk1mr6933795pab.5.1418142956917; Tue, 09 Dec 2014 08:35:56 -0800 (PST) Received: from urahara (static-50-53-82-155.bvtn.or.frontiernet.net. [50.53.82.155]) by mx.google.com with ESMTPSA id nh4sm1932060pdb.37.2014.12.09.08.35.55 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Dec 2014 08:35:56 -0800 (PST) Date: Tue, 9 Dec 2014 08:35:46 -0800 From: Stephen Hemminger To: dev@dpdk.org Message-ID: <20141209083546.12e936b7@urahara> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: [dpdk-dev] [PATCH] rte_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: Tue, 09 Dec 2014 16:35:57 -0000 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 --- 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;