From: "Jan Beulich" Subject: Re: [PATCH V5] x86, amd_ucode: Support multiple container files appended together Date: Fri, 04 Jul 2014 11:22:30 +0100 Message-ID: <53B69C860200007800020A2A@mail.emea.novell.com> References: <1404402440-339-1-git-send-email-aravind.gopalakrishnan@amd.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1404402440-339-1-git-send-email-aravind.gopalakrishnan@amd.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Aravind Gopalakrishnan Cc: boris.ostrovsky@oracle.com, keir@xen.org, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org >>> On 03.07.14 at 17:47, wrote: > @@ -236,7 +251,14 @@ static int get_ucode_from_buffer_amd( > mpbuf = (const struct mpbhdr *)&bufp[off]; > if ( mpbuf->type != UCODE_UCODE_TYPE ) > { > - printk(KERN_ERR "microcode: Wrong microcode payload type field\n"); > + /* > + * In a situation where ucode update has succeeded; > + * but there is a subsequent container file being parsed, > + * then, there is no need of this ERR message to be printed. > + */ > + if ( *(const uint32_t *)buf != UCODE_MAGIC ) Don't you need to use mpbuf here (which is equal to buf only when off == 0)? > + printk(KERN_ERR "microcode: Wrong microcode payload type field\n"); > + > return -EINVAL; > } Also, wouldn't it help the caller (in not having to peek into the buffer another time) if you returned a different value in that case, e.g. a positive one? Jan