From patchwork Wed Oct 26 19:04:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laszlo Ersek X-Patchwork-Id: 79518 Delivered-To: patch@linaro.org Received: by 10.140.97.247 with SMTP id m110csp227497qge; Wed, 26 Oct 2016 12:07:03 -0700 (PDT) X-Received: by 10.99.50.71 with SMTP id y68mr5698386pgy.111.1477508823601; Wed, 26 Oct 2016 12:07:03 -0700 (PDT) Return-Path: Received: from ml01.01.org (ml01.01.org. [198.145.21.10]) by mx.google.com with ESMTPS id o8si4207777pgi.97.2016.10.26.12.07.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 26 Oct 2016 12:07:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id E6A191A1F34; Wed, 26 Oct 2016 12:06:09 -0700 (PDT) X-Original-To: edk2-devel@ml01.01.org Delivered-To: edk2-devel@ml01.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 7F1211A1E46 for ; Wed, 26 Oct 2016 12:06:08 -0700 (PDT) Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 147A280F95; Wed, 26 Oct 2016 19:06:08 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-27.phx2.redhat.com [10.3.116.27]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u9QJ5709025834; Wed, 26 Oct 2016 15:06:07 -0400 From: Laszlo Ersek To: edk2-devel-01 Date: Wed, 26 Oct 2016 21:04:50 +0200 Message-Id: <20161026190504.9888-34-lersek@redhat.com> In-Reply-To: <20161026190504.9888-1-lersek@redhat.com> References: <20161026190504.9888-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Wed, 26 Oct 2016 19:06:08 +0000 (UTC) Subject: [edk2] [PATCH 33/47] NetworkPkg/IScsiDxe: rebase to ARRAY_SIZE() X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Siyuan Fu , Jiaxin Wu MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" Cc: Jiaxin Wu Cc: Siyuan Fu Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek --- NetworkPkg/IScsiDxe/IScsiConfig.c | 4 ++-- NetworkPkg/IScsiDxe/IScsiDriver.c | 2 +- NetworkPkg/IScsiDxe/IScsiMisc.c | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) -- 2.9.2 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Reviewed-by: Fu Siyuan siyuan.fu@intel.com diff --git a/NetworkPkg/IScsiDxe/IScsiConfig.c b/NetworkPkg/IScsiDxe/IScsiConfig.c index 3631e72e3455..16a90a6206aa 100644 --- a/NetworkPkg/IScsiDxe/IScsiConfig.c +++ b/NetworkPkg/IScsiDxe/IScsiConfig.c @@ -1111,7 +1111,7 @@ IScsiConfigUpdateAttempt ( NET_LIST_FOR_EACH (Entry, &mPrivate->AttemptConfigs) { AttemptConfigData = NET_LIST_USER_STRUCT (Entry, ISCSI_ATTEMPT_CONFIG_NVDATA, Link); - AsciiStrToUnicodeStrS (AttemptConfigData->AttemptName, AttemptName, sizeof (AttemptName) / sizeof (AttemptName[0])); + AsciiStrToUnicodeStrS (AttemptConfigData->AttemptName, AttemptName, ARRAY_SIZE (AttemptName)); UnicodeSPrint (mPrivate->PortString, (UINTN) 128, L"Attempt %s", AttemptName); AttemptConfigData->AttemptTitleToken = HiiSetString ( mCallbackInfo->RegisteredHandle, @@ -1240,7 +1240,7 @@ IScsiConfigDeleteAttempts ( mPrivate->SinglePathCount--; } - AsciiStrToUnicodeStrS (AttemptConfigData->MacString, MacString, sizeof (MacString) / sizeof (MacString[0])); + AsciiStrToUnicodeStrS (AttemptConfigData->MacString, MacString, ARRAY_SIZE (MacString)); UnicodeSPrint ( mPrivate->PortString, diff --git a/NetworkPkg/IScsiDxe/IScsiDriver.c b/NetworkPkg/IScsiDxe/IScsiDriver.c index 279f1c049679..ac10fa26d1b9 100644 --- a/NetworkPkg/IScsiDxe/IScsiDriver.c +++ b/NetworkPkg/IScsiDxe/IScsiDriver.c @@ -673,7 +673,7 @@ IScsiStart ( Session->ConfigData = AttemptConfigData; Session->AuthType = AttemptConfigData->AuthenticationType; - AsciiStrToUnicodeStrS (AttemptConfigData->MacString, MacString, sizeof (MacString) / sizeof (MacString[0])); + AsciiStrToUnicodeStrS (AttemptConfigData->MacString, MacString, ARRAY_SIZE (MacString)); UnicodeSPrint ( mPrivate->PortString, (UINTN) ISCSI_NAME_IFR_MAX_SIZE, diff --git a/NetworkPkg/IScsiDxe/IScsiMisc.c b/NetworkPkg/IScsiDxe/IScsiMisc.c index 64bb2ade7b0a..11a80f2e10e4 100644 --- a/NetworkPkg/IScsiDxe/IScsiMisc.c +++ b/NetworkPkg/IScsiDxe/IScsiMisc.c @@ -1109,7 +1109,7 @@ IScsiGetConfigData ( // // Refresh the state of this attempt to NVR. // - AsciiStrToUnicodeStrS (AttemptTmp->MacString, MacString, sizeof (MacString) / sizeof (MacString[0])); + AsciiStrToUnicodeStrS (AttemptTmp->MacString, MacString, ARRAY_SIZE (MacString)); UnicodeSPrint ( mPrivate->PortString, (UINTN) ISCSI_NAME_IFR_MAX_SIZE, @@ -1148,7 +1148,7 @@ IScsiGetConfigData ( // // Refresh the state of this attempt to NVR. // - AsciiStrToUnicodeStrS (AttemptTmp->MacString, MacString, sizeof (MacString) / sizeof (MacString[0])); + AsciiStrToUnicodeStrS (AttemptTmp->MacString, MacString, ARRAY_SIZE (MacString)); UnicodeSPrint ( mPrivate->PortString, (UINTN) ISCSI_NAME_IFR_MAX_SIZE, @@ -1239,7 +1239,7 @@ IScsiGetConfigData ( // // Refresh the state of this attempt to NVR. // - AsciiStrToUnicodeStrS (AttemptConfigData->MacString, MacString, sizeof (MacString) / sizeof (MacString[0])); + AsciiStrToUnicodeStrS (AttemptConfigData->MacString, MacString, ARRAY_SIZE (MacString)); UnicodeSPrint ( mPrivate->PortString, (UINTN) ISCSI_NAME_IFR_MAX_SIZE,