From patchwork Wed Apr 8 06:41:24 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Hershberger X-Patchwork-Id: 459132 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id AF65D140082 for ; Wed, 8 Apr 2015 16:47:16 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B3491A744E; Wed, 8 Apr 2015 08:46:15 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GMElY89QnyU0; Wed, 8 Apr 2015 08:46:15 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 72272A744C; Wed, 8 Apr 2015 08:45:32 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 33AE7A7443 for ; Wed, 8 Apr 2015 08:43:34 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VgM93gn-wMcw for ; Wed, 8 Apr 2015 08:43:34 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from ni.com (skprod3.natinst.com [130.164.80.24]) by theia.denx.de (Postfix) with ESMTPS id 1B247A744E for ; Wed, 8 Apr 2015 08:43:28 +0200 (CEST) Received: from us-aus-mgwout2.amer.corp.natinst.com (nb-snip2-1338.natinst.com [130.164.19.135]) by us-aus-skprod3.natinst.com (8.15.0.59/8.15.0.59) with ESMTP id t386hRDl003916 for ; Wed, 8 Apr 2015 01:43:27 -0500 Received: from linux-xvxi.natinst.com ([130.164.14.198]) by us-aus-mgwout2.amer.corp.natinst.com (Lotus Domino Release 8.5.3FP6) with ESMTP id 2015040801432720-960412 ; Wed, 8 Apr 2015 01:43:27 -0500 From: Joe Hershberger To: u-boot@lists.denx.de Date: Wed, 8 Apr 2015 01:41:24 -0500 Message-Id: <1428475285-25836-25-git-send-email-joe.hershberger@ni.com> X-Mailer: git-send-email 1.7.11.5 In-Reply-To: <1428475285-25836-1-git-send-email-joe.hershberger@ni.com> References: <1428095695-23368-1-git-send-email-joe.hershberger@ni.com> <1428475285-25836-1-git-send-email-joe.hershberger@ni.com> X-MIMETrack: Itemize by SMTP Server on US-AUS-MGWOut2/AUS/H/NIC(Release 8.5.3FP6|November 21, 2013) at 04/08/2015 01:43:27 AM, Serialize by Router on US-AUS-MGWOut2/AUS/H/NIC(Release 8.5.3FP6|November 21, 2013) at 04/08/2015 01:43:27 AM, Serialize complete at 04/08/2015 01:43:27 AM X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2015-04-08_03:, , signatures=0 Cc: Joe Hershberger Subject: [U-Boot] [PATCH v2 24/25] net: Fix compile errors when SNTP enabled and not DATE X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" When SNTP is enabled and DATE is not, to_tm() is not built in. It could be defined when TIMESTAMP is defined, so check for that. Signed-off-by: Joe Hershberger Acked-by: Simon Glass --- Changes in v2: -New to series net/sntp.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/net/sntp.c b/net/sntp.c index d3427d8..6422eef 100644 --- a/net/sntp.c +++ b/net/sntp.c @@ -50,17 +50,20 @@ static void sntp_timeout_handler(void) static void sntp_handler(uchar *pkt, unsigned dest, struct in_addr sip, unsigned src, unsigned len) { +#ifdef CONFIG_TIMESTAMP struct sntp_pkt_t *rpktp = (struct sntp_pkt_t *)pkt; struct rtc_time tm; ulong seconds; +#endif debug("%s\n", __func__); if (dest != sntp_our_port) return; +#ifdef CONFIG_TIMESTAMP /* - * As the RTC's used in U-Boot sepport second resolution only + * As the RTC's used in U-Boot support second resolution only * we simply ignore the sub-second field. */ memcpy(&seconds, &rpktp->transmit_timestamp, sizeof(ulong)); @@ -72,6 +75,7 @@ static void sntp_handler(uchar *pkt, unsigned dest, struct in_addr sip, printf("Date: %4d-%02d-%02d Time: %2d:%02d:%02d\n", tm.tm_year, tm.tm_mon, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec); +#endif net_set_state(NETLOOP_SUCCESS); }