From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from e23smtp06.au.ibm.com ([202.81.31.148]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aTqfb-0000Vq-Tq for kexec@lists.infradead.org; Thu, 11 Feb 2016 12:48:28 +0000 Received: from localhost by e23smtp06.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 11 Feb 2016 22:17:47 +1000 Received: from d23relay09.au.ibm.com (d23relay09.au.ibm.com [9.185.63.181]) by d23dlp02.au.ibm.com (Postfix) with ESMTP id 2556C2BB0055 for ; Thu, 11 Feb 2016 23:17:45 +1100 (EST) Received: from d23av02.au.ibm.com (d23av02.au.ibm.com [9.190.235.138]) by d23relay09.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u1BCHb5B29425732 for ; Thu, 11 Feb 2016 23:17:45 +1100 Received: from d23av02.au.ibm.com (localhost [127.0.0.1]) by d23av02.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u1BCHClv023168 for ; Thu, 11 Feb 2016 23:17:12 +1100 Message-ID: <1455193012.2538.318.camel@linux.vnet.ibm.com> Subject: Re: [PATCH v3 19/22] ima: support for kexec image and initramfs From: Mimi Zohar Date: Thu, 11 Feb 2016 07:16:52 -0500 In-Reply-To: References: <1454526390-19792-1-git-send-email-zohar@linux.vnet.ibm.com> <1454526390-19792-20-git-send-email-zohar@linux.vnet.ibm.com> <1455146516.2538.237.camel@linux.vnet.ibm.com> <1455156500.2538.268.camel@linux.vnet.ibm.com> Mime-Version: 1.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "kexec" Errors-To: kexec-bounces+dwmw2=infradead.org@lists.infradead.org To: Dmitry Kasatkin Cc: Dmitry Torokhov , Kees Cook , fsdevel@vger.kernel.org, "Luis R. Rodriguez" , Rusty Russell , kexec@lists.infradead.org, David Howells , linux-security-module , "Eric W. Biederman" , David Woodhouse , linux-modules@vger.kernel.org On Thu, 2016-02-11 at 10:47 +0200, Dmitry Kasatkin wrote: > On Thu, Feb 11, 2016 at 4:08 AM, Mimi Zohar wrote: > static int idmap[] = { > [READING_FIRMWARE] = FIRMWARE_CHECK, > [READING_MODULE] = MODULE_CHECK, > ... > }; That works nicely, even with non-sequential ordering or missing entries. The switch case be replaced with a single line: func = read_idmap[read_id] == 0 ? FILE_CHECK : read_idmap[read_id]; Thank you! Mimi _______________________________________________ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec