From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-x22e.google.com (mail-wm0-x22e.google.com [IPv6:2a00:1450:400c:c09::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id ED23E81D9D for ; Fri, 28 Oct 2016 07:48:37 -0700 (PDT) Received: by mail-wm0-x22e.google.com with SMTP id e69so106679931wmg.0 for ; Fri, 28 Oct 2016 07:48:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=GDP/1MjmXQvV/C5UCrmKnoJuazJZazOey/Y8LY+w680=; b=I25LBf+Aev8ZKpBtvaqFpf3l9K0XX8gkRRiaUeQw3P3dRyqDy74RNXdsKugfuokFTg xNzYCT0Ev2q8O09TrLq2Hob4oRGuZFUfvWDQHUnasIgHDc0yM3Y7tGLVOJTMwDFwI5qr D25AVIoFYISZeqC7csdKakf4T2P7kKEVLyMXY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=GDP/1MjmXQvV/C5UCrmKnoJuazJZazOey/Y8LY+w680=; b=W9jLDoTYZksetJhK/snyIvT88Lis6FSYi51x2WyRogzNJhVzaYV9fsx3YdGv1z2cHG nxK03lxQCJJ7ElGCfUe9/OR+45ynQJ26IGBF/rryHYKhi8xuQj21CiwhI9vag5H6Sx9/ bC5iKjWQwBP4P0KMpPvaku7s39fiPvD579HPHHXkXDKhnqJAzoN75yFNGckbfaYmFBNx IBXlPPuA8AOlVb/yTyCUCOgSVZRC4nm1l44xtPsW9q4jcBXTNWvLfYYe3vqVFyDWAVfb esvPP146jJz2O8lNTSXTRcu/kDyPnKL/DnIUhx8kfRztvFvqGaRpL2kei2ZRM41WAZBR HWhg== X-Gm-Message-State: ABUngves+H7GVynYZWHNMacYAe+tPKcE9j0p9GMpKIwPIEmKs/dOuufYLNPdnUa9Yv2PdFB9 X-Received: by 10.194.44.226 with SMTP id h2mr12121085wjm.113.1477666116794; Fri, 28 Oct 2016 07:48:36 -0700 (PDT) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id p4sm14493995wjo.9.2016.10.28.07.48.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Oct 2016 07:48:36 -0700 (PDT) Date: Fri, 28 Oct 2016 15:48:34 +0100 From: Leif Lindholm To: Ard Biesheuvel Cc: edk2-devel@lists.01.org, lersek@redhat.com, ryan.harkin@linaro.org Message-ID: <20161028144834.GU1161@bivouac.eciton.net> References: <1477651721-16958-1-git-send-email-ard.biesheuvel@linaro.org> <1477651721-16958-2-git-send-email-ard.biesheuvel@linaro.org> MIME-Version: 1.0 In-Reply-To: <1477651721-16958-2-git-send-email-ard.biesheuvel@linaro.org> User-Agent: Mutt/1.5.23 (2014-03-12) 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 14:48:38 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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.) > } else { > *Value = '\0'; > } > @@ -410,7 +411,7 @@ ArmFastbootPlatformOemCommand ( > { > CHAR16 CommandUnicode[65]; > > - AsciiStrToUnicodeStr (Command, CommandUnicode); > + AsciiStrToUnicodeStrS (Command, CommandUnicode, ARRAY_SIZE (CommandUnicode)); > > if (AsciiStrCmp (Command, "Demonstrate") == 0) { > DEBUG ((EFI_D_ERROR, "ARM OEM Fastboot command 'Demonstrate' received.\n")); > -- > 2.7.4 >