From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=209.132.183.28; helo=mx1.redhat.com; envelope-from=lersek@redhat.com; receiver=edk2-devel@lists.01.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 7223020356897 for ; Mon, 13 Nov 2017 05:23:25 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4696561D0E; Mon, 13 Nov 2017 13:27:31 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-120-226.rdu2.redhat.com [10.10.120.226]) by smtp.corp.redhat.com (Postfix) with ESMTP id CB2DD78DDE; Mon, 13 Nov 2017 13:27:29 +0000 (UTC) To: Thiebaud Weksteen , edk2-devel@lists.01.org, Daryl McDaniel , Jaben Carsey Cc: erik.c.bjorge@intel.com References: <2c8db66b18b93d008b1bb8028c23f51ce2b76b29.1509011535.git.tweek@google.com> From: Laszlo Ersek Message-ID: Date: Mon, 13 Nov 2017 14:27:28 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <2c8db66b18b93d008b1bb8028c23f51ce2b76b29.1509011535.git.tweek@google.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 13 Nov 2017 13:27:31 +0000 (UTC) Subject: Re: [PATCH] StdLib/BsdSocketLib: Remove unused variables X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Nov 2017 13:23:25 -0000 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Jaben, Daryl, can you please review this patch? Thiebaud: best CC the package maintainers from Maintainers.txt on patches. Thanks! Laszlo On 10/26/17 11:58, Thiebaud Weksteen wrote: > TianoCore BZ#677 > > Remove unused variables and turn nsdispatch macro into a function. This > is not what is recommended in the bug ticket but avoid heavier > modification of the code (and deviation from upsteam). > > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Thiebaud Weksteen > --- > StdLib/BsdSocketLib/getaddrinfo.c | 10 ++++++---- > StdLib/BsdSocketLib/gethostbydns.c | 2 ++ > 2 files changed, 8 insertions(+), 4 deletions(-) > > diff --git a/StdLib/BsdSocketLib/getaddrinfo.c b/StdLib/BsdSocketLib/getaddrinfo.c > index 5a0baf6d45..9d1acdb3fb 100644 > --- a/StdLib/BsdSocketLib/getaddrinfo.c > +++ b/StdLib/BsdSocketLib/getaddrinfo.c > @@ -92,7 +92,6 @@ __RCSID("$NetBSD: getaddrinfo.c,v 1.91.6.1 2009/01/26 00:27:34 snj Exp $"); > #include > > #define endservent_r(svd) endservent() > -#define nsdispatch(pResult,dtab,database,routine,files,hostname,pai) NS_NOTFOUND > #define res_nmkquery(state,op,dname,class,type,data,datalen,newrr_in,buf,buflen) res_mkquery( op, dname, class, type, data, datalen, newrr_in, buf, buflen ) > #define res_nsend(state,buf,buflen,ans,anssiz) res_send ( buf, buflen, ans, anssiz ) > > @@ -306,6 +305,12 @@ do { \ > #define MATCH(x, y, w) \ > ((x) == (y) || (/*CONSTCOND*/(w) && ((x) == ANY || (y) == ANY))) > > +int nsdispatch(void *result, const ns_dtab dist_tab[], const char* database, > + const char *method, const ns_src defaults[], ...) > +{ > + return NS_NOTFOUND; > +} > + > const char * > gai_strerror(int ecode) > { > @@ -1062,9 +1067,6 @@ ip6_str2scopeid(char *scope, struct sockaddr_in6 *sin6, u_int32_t *scopeid) > > /* code duplicate with gethnamaddr.c */ > > -static const char AskedForGot[] = > - "gethostby*.getanswer: asked for \"%s\", got \"%s\""; > - > static struct addrinfo * > getanswer(const querybuf *answer, int anslen, const char *qname, int qtype, > const struct addrinfo *pai) > diff --git a/StdLib/BsdSocketLib/gethostbydns.c b/StdLib/BsdSocketLib/gethostbydns.c > index 25e7c3b142..17c43ba59c 100644 > --- a/StdLib/BsdSocketLib/gethostbydns.c > +++ b/StdLib/BsdSocketLib/gethostbydns.c > @@ -129,8 +129,10 @@ u_int16_t _getshort(const u_char *src); > #define MAXALIASES 35 > #define MAXADDRS 35 > > +#ifdef _ORG_FREEBSD_ > static const char AskedForGot[] = > "gethostby*.gethostanswer: asked for \"%s\", got \"%s\""; > +#endif > > static char *h_addr_ptrs[MAXADDRS + 1]; > >