From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 4172A81DB3 for ; Fri, 28 Oct 2016 08:08:14 -0700 (PDT) Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (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 4C68A804F2; Fri, 28 Oct 2016 15:08:14 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-38.phx2.redhat.com [10.3.116.38]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u9SF8CjN024804; Fri, 28 Oct 2016 11:08:13 -0400 To: Ard Biesheuvel , Leif Lindholm References: <1477651721-16958-1-git-send-email-ard.biesheuvel@linaro.org> <1477651721-16958-2-git-send-email-ard.biesheuvel@linaro.org> <20161028144834.GU1161@bivouac.eciton.net> Cc: edk2-devel-01 , Ryan Harkin From: Laszlo Ersek Message-ID: Date: Fri, 28 Oct 2016 17:08:12 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Fri, 28 Oct 2016 15:08:14 +0000 (UTC) Subject: Re: [PATCH v2 1/2] ArmPlatformPkg/ArmVExpressFastBootDxe: eliminate deprecated string functions 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: , X-List-Received-Date: Fri, 28 Oct 2016 15:08:14 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit On 10/28/16 17:02, Ard Biesheuvel wrote: > On 28 October 2016 at 15:48, Leif Lindholm wrote: >> On Fri, Oct 28, 2016 at 11:48:40AM +0100, Ard Biesheuvel wrote: >>> Get rid of functions that are no longer available when defining >>> DISABLE_NEW_DEPRECATED_INTERFACES >>> >>> Contributed-under: TianoCore Contribution Agreement 1.0 >>> Signed-off-by: Ard Biesheuvel >>> --- >>> ArmPlatformPkg/ArmVExpressPkg/ArmVExpressFastBootDxe/ArmVExpressFastBoot.c | 9 +++++---- >>> 1 file changed, 5 insertions(+), 4 deletions(-) >>> >>> diff --git a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpressFastBootDxe/ArmVExpressFastBoot.c b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpressFastBootDxe/ArmVExpressFastBoot.c >>> index 4d0811cc5eaf..64b25f8a8c45 100644 >>> --- a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpressFastBootDxe/ArmVExpressFastBoot.c >>> +++ b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpressFastBootDxe/ArmVExpressFastBoot.c >>> @@ -269,7 +269,7 @@ ArmFastbootPlatformInit ( >>> >>> // Copy handle and partition name >>> Entry->PartitionHandle = AllHandles[LoopIndex]; >>> - StrnCpy ( >>> + CopyMem ( >>> Entry->PartitionName, >>> PartitionEntries[PartitionNode->PartitionNumber - 1].PartitionName, // Partition numbers start from 1. >>> PARTITION_NAME_MAX_LENGTH >>> @@ -320,7 +320,8 @@ ArmFastbootPlatformFlashPartition ( >>> CHAR16 PartitionNameUnicode[60]; >>> BOOLEAN PartitionFound; >>> >>> - AsciiStrToUnicodeStr (PartitionName, PartitionNameUnicode); >>> + AsciiStrToUnicodeStrS (PartitionName, PartitionNameUnicode, >>> + ARRAY_SIZE (PartitionNameUnicode)); >>> >>> PartitionFound = FALSE; >>> Entry = (FASTBOOT_PARTITION_LIST *) GetFirstNode (&(mPartitionListHead)); >>> @@ -396,7 +397,7 @@ ArmFastbootPlatformGetVar ( >>> ) >>> { >>> if (AsciiStrCmp (Name, "product")) { >>> - AsciiStrCpy (Value, FixedPcdGetPtr (PcdFirmwareVendor)); >>> + AsciiStrCpyS (Value, 61, FixedPcdGetPtr (PcdFirmwareVendor)); >> >> I'm totally OK with the reason for hard-coding this, but could you add >> the comment from the feedback on previous version?: >> // FASTBOOT_COMMAND_MAX_LENGTH - 4 + NULL terminator >> (Or if there's a better way of putting it.) >> > > What if I decorate each entry point with the comment block from the > associated protocol header file instead? (in a follow up patch) > That is common practice in Tianocore anyway, Indeed it is. Laszlo