Received: from list by lists.gnu.org with archive (Exim 4.71) id 1emGtF-0001IN-4v for mharc-grub-devel@gnu.org; Thu, 15 Feb 2018 05:35:45 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53816) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1emGtD-0001Gz-CH for grub-devel@gnu.org; Thu, 15 Feb 2018 05:35:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1emGt9-00008r-E0 for grub-devel@gnu.org; Thu, 15 Feb 2018 05:35:43 -0500 Received: from aserp2120.oracle.com ([141.146.126.78]:55724) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1emGt9-00008d-7X for grub-devel@gnu.org; Thu, 15 Feb 2018 05:35:39 -0500 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w1FAVvsD139963; Thu, 15 Feb 2018 10:35:38 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2017-10-26; bh=5SHbzfBJBz3VqIGEDdOt5ENC80fMu+mHsXKbFSN1z2A=; b=SEc4CyqZoznm64ZBfY6JKXmOEtG8C9x1+le2AybdIZrpJ3s5dOhyn+VIJTgMjFWm3edF 5ZwwExVBMXVl2r6bmnSncDZ3yL/5nb9QVdLDLQDFnjJl4Avs7Ye6lT8eXPqLj4AIpFzY Vaih8XgSlTwAv5vrycP2SkYxJkpWNTEjAwYpytAp84r/krvIfwJUL3r1oU0Hfh00MK+D HsTMxmn5p+VpCTAgZFUCSUWZCQsm4e9vJwRpPmsIn2caFEUqcqoIAfIavUT5rKtTQHho 9AiS0wptiK2Frsj3OUu7IMw2jsIN9i5lARwFRgqV9Fe8YX+6vwaFSWYJZgxEF/zeZYID EA== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp2120.oracle.com with ESMTP id 2g58ecg2u6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 15 Feb 2018 10:35:37 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w1FAUad9012120 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 15 Feb 2018 10:30:36 GMT Received: from abhmp0007.oracle.com (abhmp0007.oracle.com [141.146.116.13]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w1FAUaO1010549; Thu, 15 Feb 2018 10:30:36 GMT Received: from olila.local.net-space.pl (/10.175.214.62) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 15 Feb 2018 02:30:36 -0800 Date: Thu, 15 Feb 2018 11:30:32 +0100 From: Daniel Kiper To: Leif Lindholm Cc: grub-devel@gnu.org Subject: Re: [PATCH 09/10] commands/file: use definitions from arm/linux.h Message-ID: <20180215103032.GP19041@olila.local.net-space.pl> References: <20180201181858.1472-1-leif.lindholm@linaro.org> <20180201181858.1472-10-leif.lindholm@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180201181858.1472-10-leif.lindholm@linaro.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8805 signatures=668671 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1802150131 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 141.146.126.78 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Feb 2018 10:35:44 -0000 On Thu, Feb 01, 2018 at 06:18:57PM +0000, Leif Lindholm wrote: > Clean up code for matching IS_ARM slightly by making use of struct > linux_arm_kernel_header and GRUB_LINUX_ARM_MAGIC_SIGNATURE. > > Signed-off-by: Leif Lindholm > --- > grub-core/commands/file.c | 14 ++++++-------- > 1 file changed, 6 insertions(+), 8 deletions(-) > > diff --git a/grub-core/commands/file.c b/grub-core/commands/file.c > index 63c84499b..fad191202 100644 > --- a/grub-core/commands/file.c > +++ b/grub-core/commands/file.c > @@ -27,6 +27,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -383,21 +384,18 @@ grub_cmd_file (grub_extcmd_context_t ctxt, int argc, char **args) > } > case IS_ARM_LINUX: > { > - grub_uint32_t sig, sig_pi; > - if (grub_file_read (file, &sig_pi, 4) != 4) > + struct linux_arm_kernel_header lh; > + if (grub_file_read (file, &lh, sizeof (lh)) != sizeof (lh)) > break; > /* Raspberry pi. */ > - if (sig_pi == grub_cpu_to_le32_compile_time (0xea000006)) > + if (lh.code0 == grub_cpu_to_le32_compile_time (0xea000006)) Could you define 0xea000006 as a constant? If you add the comment what does it mean that will be perfect. Daniel