From patchwork Wed Nov 14 12:36:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Patchwork-Id: 10682559 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2093F139B for ; Wed, 14 Nov 2018 13:08:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 121D328500 for ; Wed, 14 Nov 2018 13:08:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0634E28A5A; Wed, 14 Nov 2018 13:08:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B06CD28500 for ; Wed, 14 Nov 2018 13:08:16 +0000 (UTC) Received: from localhost ([::1]:59991 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gMutz-0008LH-WC for patchwork-qemu-devel@patchwork.kernel.org; Wed, 14 Nov 2018 08:08:16 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60459) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gMuWE-0004vI-Km for qemu-devel@nongnu.org; Wed, 14 Nov 2018 07:43:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gMuWC-0004TE-PF for qemu-devel@nongnu.org; Wed, 14 Nov 2018 07:43:42 -0500 Received: from mx1.redhat.com ([209.132.183.28]:60718) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gMuWA-0004Rh-V9 for qemu-devel@nongnu.org; Wed, 14 Nov 2018 07:43:39 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B1873307EA8A; Wed, 14 Nov 2018 12:43:37 +0000 (UTC) Received: from localhost (ovpn-112-55.ams2.redhat.com [10.36.112.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0AAE21054FAE; Wed, 14 Nov 2018 12:43:28 +0000 (UTC) From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= To: qemu-devel@nongnu.org Date: Wed, 14 Nov 2018 16:36:39 +0400 Message-Id: <20181114123643.24091-38-marcandre.lureau@redhat.com> In-Reply-To: <20181114123643.24091-1-marcandre.lureau@redhat.com> References: <20181114123643.24091-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Wed, 14 Nov 2018 12:43:37 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH for-3.2 37/41] slirp: replace ARRAY_SIZE with G_N_ELEMENTS X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: samuel.thibault@ens-lyon.org, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , rjones@redhat.com, stefanha@redhat.com, renzo@cs.unibo.it Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Do not require QEMU macro. Signed-off-by: Marc-André Lureau Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Daniel P. Berrangé --- slirp/ncsi.c | 2 +- slirp/tftp.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/slirp/ncsi.c b/slirp/ncsi.c index 10decfb5ef..8594382270 100644 --- a/slirp/ncsi.c +++ b/slirp/ncsi.c @@ -128,7 +128,7 @@ void ncsi_input(Slirp *slirp, const uint8_t *pkt, int pkt_len) memset(reh->h_source, 0xff, ETH_ALEN); reh->h_proto = htons(ETH_P_NCSI); - for (i = 0; i < ARRAY_SIZE(ncsi_rsp_handlers); i++) { + for (i = 0; i < G_N_ELEMENTS(ncsi_rsp_handlers); i++) { if (ncsi_rsp_handlers[i].type == nh->type + 0x80) { handler = &ncsi_rsp_handlers[i]; break; diff --git a/slirp/tftp.c b/slirp/tftp.c index dddb614b8a..ef8d0352b4 100644 --- a/slirp/tftp.c +++ b/slirp/tftp.c @@ -360,7 +360,7 @@ static void tftp_handle_rrq(Slirp *slirp, struct sockaddr_storage *srcsas, return; } - while (k < pktlen && nb_options < ARRAY_SIZE(option_name)) { + while (k < pktlen && nb_options < G_N_ELEMENTS(option_name)) { const char *key, *value; key = &tp->x.tp_buf[k]; @@ -404,7 +404,7 @@ static void tftp_handle_rrq(Slirp *slirp, struct sockaddr_storage *srcsas, } if (nb_options > 0) { - assert(nb_options <= ARRAY_SIZE(option_name)); + assert(nb_options <= G_N_ELEMENTS(option_name)); tftp_send_oack(spt, option_name, option_value, nb_options, tp); return; }