From patchwork Fri May 4 07:25:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cornelia Huck X-Patchwork-Id: 10380095 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5B5FA60159 for ; Fri, 4 May 2018 07:35:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4A16329236 for ; Fri, 4 May 2018 07:35:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3E85A2932A; Fri, 4 May 2018 07:35:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D51BA29236 for ; Fri, 4 May 2018 07:35:43 +0000 (UTC) Received: from localhost ([::1]:32787 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fEVFn-0004Yc-3l for patchwork-qemu-devel@patchwork.kernel.org; Fri, 04 May 2018 03:35:43 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34138) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fEV63-0004Pb-AU for qemu-devel@nongnu.org; Fri, 04 May 2018 03:25:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fEV60-0007HE-HB for qemu-devel@nongnu.org; Fri, 04 May 2018 03:25:39 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:56664 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fEV60-0007GV-CL; Fri, 04 May 2018 03:25:36 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F074C4026129; Fri, 4 May 2018 07:25:35 +0000 (UTC) Received: from localhost (dhcp-192-222.str.redhat.com [10.33.192.222]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A7E592022C00; Fri, 4 May 2018 07:25:35 +0000 (UTC) From: Cornelia Huck To: Peter Maydell Date: Fri, 4 May 2018 09:25:06 +0200 Message-Id: <20180504072514.8450-8-cohuck@redhat.com> In-Reply-To: <20180504072514.8450-1-cohuck@redhat.com> References: <20180504072514.8450-1-cohuck@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Fri, 04 May 2018 07:25:36 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Fri, 04 May 2018 07:25:36 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'cohuck@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 07/15] pc-bios/s390-ccw: rename MAX_TABLE_ENTRIES to MAX_BOOT_ENTRIES X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , David Hildenbrand , Alexander Graf , qemu-devel@nongnu.org, Christian Borntraeger , qemu-s390x@nongnu.org, Collin Walling , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Collin Walling The MAX_TABLE_ENTRIES constant has a name that is too generic. As we want to declare a limit for boot menu entries, let's rename it to a more fitting MAX_BOOT_ENTRIES and set its value to 31 (30 boot entries and 1 default entry). Also we move it from bootmap.h to s390-ccw.h to make it available for menu.c in a later patch. Signed-off-by: Collin Walling Reviewed-by: Thomas Huth Reviewed-by: Janosch Frank Signed-off-by: Thomas Huth --- pc-bios/s390-ccw/bootmap.c | 6 +++--- pc-bios/s390-ccw/bootmap.h | 2 -- pc-bios/s390-ccw/s390-ccw.h | 2 ++ 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pc-bios/s390-ccw/bootmap.c b/pc-bios/s390-ccw/bootmap.c index 9287b7a70f..b767fa2afc 100644 --- a/pc-bios/s390-ccw/bootmap.c +++ b/pc-bios/s390-ccw/bootmap.c @@ -297,7 +297,7 @@ static void run_eckd_boot_script(block_number_t bmt_block_nr, } debug_print_int("loadparm", loadparm); - IPL_assert(loadparm <= MAX_TABLE_ENTRIES, "loadparm value greater than" + IPL_assert(loadparm < MAX_BOOT_ENTRIES, "loadparm value greater than" " maximum number of boot entries allowed"); memset(sec, FREE_SPACE_FILLER, sizeof(sec)); @@ -585,7 +585,7 @@ static void ipl_scsi(void) read_block(mbr->pt.blockno, sec, "Error reading Program Table"); IPL_assert(magic_match(sec, ZIPL_MAGIC), "No zIPL magic in PT"); - while (program_table_entries <= MAX_TABLE_ENTRIES) { + while (program_table_entries < MAX_BOOT_ENTRIES) { if (!prog_table->entry[program_table_entries].scsi.blockno) { break; } @@ -600,7 +600,7 @@ static void ipl_scsi(void) } debug_print_int("loadparm", loadparm); - IPL_assert(loadparm <= MAX_TABLE_ENTRIES, "loadparm value greater than" + IPL_assert(loadparm < MAX_BOOT_ENTRIES, "loadparm value greater than" " maximum number of boot entries allowed"); zipl_run(&prog_table->entry[loadparm].scsi); /* no return */ diff --git a/pc-bios/s390-ccw/bootmap.h b/pc-bios/s390-ccw/bootmap.h index 07eb600b00..732c1112ce 100644 --- a/pc-bios/s390-ccw/bootmap.h +++ b/pc-bios/s390-ccw/bootmap.h @@ -57,8 +57,6 @@ typedef union BootMapPointer { ExtEckdBlockPtr xeckd; } __attribute__ ((packed)) BootMapPointer; -#define MAX_TABLE_ENTRIES 30 - /* aka Program Table */ typedef struct BootMapTable { uint8_t magic[4]; diff --git a/pc-bios/s390-ccw/s390-ccw.h b/pc-bios/s390-ccw/s390-ccw.h index fd18da22c6..2c9e6017b7 100644 --- a/pc-bios/s390-ccw/s390-ccw.h +++ b/pc-bios/s390-ccw/s390-ccw.h @@ -94,6 +94,8 @@ bool menu_is_enabled_zipl(void); int menu_get_enum_boot_index(int entries); bool menu_is_enabled_enum(void); +#define MAX_BOOT_ENTRIES 31 + static inline void fill_hex(char *out, unsigned char val) { const char hex[] = "0123456789abcdef";