From mboxrd@z Thu Jan 1 00:00:00 1970 From: "H. Peter Anvin" Subject: Re: [PATCH] Modify UEFI anti-bricking code Date: Wed, 05 Jun 2013 13:19:12 -0700 Message-ID: <51AF9D40.60906@linux.intel.com> References: <1370117180-1712-1-git-send-email-matthew.garrett@nebula.com> <1370276021.30695.4.camel@linux-s257.site> <1370277079.6315.14.camel@x230.lan> <1370316933.30695.7.camel@linux-s257.site> <1370444007.6315.32.camel@x230.lan> <20130605155904.GC30420@console-pimps.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20130605155904.GC30420-HNK1S37rvNbeXh+fF434Mdi2O/JbrIOy@public.gmane.org> Sender: linux-efi-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Matt Fleming Cc: Matthew Garrett , "Fleming, Matt" , joeyli , "rja-sJ/iWh9BUns@public.gmane.org" , "mingo-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org" , "torvalds-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org" , "bp-Gina5bIWoIWzQB+pC5nmwQ@public.gmane.org" , "jkosina-AlSwsSmVLrQ@public.gmane.org" , "linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , "x86-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org" , "linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , "tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org" , "akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org" , "oneukum-l3A5Bk7waGM@public.gmane.org" List-Id: linux-efi@vger.kernel.org On 06/05/2013 08:59 AM, Matt Fleming wrote: > + * There still isn't enough room, so return an error > + */ > + if (remaining_size - size < 5120) > + return EFI_OUT_OF_RESOURCES; > + } Please don't open-code the constant 5120 in this case. We may easily run into a system which needs, say, 7K, and it is error-prone to just replace numbers. -hpa