From patchwork Wed Aug 7 03:45:09 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roy Franz X-Patchwork-Id: 2839938 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 38E169F479 for ; Wed, 7 Aug 2013 07:01:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 153B120179 for ; Wed, 7 Aug 2013 07:01:44 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D591A20166 for ; Wed, 7 Aug 2013 07:01:42 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V6ujS-00045N-D1; Wed, 07 Aug 2013 03:48:20 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1V6uif-0001Sa-Hx; Wed, 07 Aug 2013 03:47:29 +0000 Received: from mail-gh0-f170.google.com ([209.85.160.170]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V6uhC-0001E7-Tz for linux-arm-kernel@lists.infradead.org; Wed, 07 Aug 2013 03:46:04 +0000 Received: by mail-gh0-f170.google.com with SMTP id z10so394392ghb.29 for ; Tue, 06 Aug 2013 20:45:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=GyotMbY2n81eSf3ge79bYrTq1NKhuPAIUttk5KYrKYM=; b=TQOoC4Gf5e38/pcXbWvoEOZQtPhtqcjWjGvom0JyHCllqU6P9EBsa9e7F3PsUSgRaj saI8k3+EnXHgU+WFhDllNlWLb380AKNTXBwReUbzFhgDPB4IlDeZ/+HXfO82r3irF/yn sLNTDAwMIYvdUtm9kN+KQgoFzjNGbaa4GukqQ0Vxza0uhciOSq3BWqui6BYh4gfGwAuM xozRJk0570mOZbvpuT/AfFU8Pg6bex0JGH2J7ifPDbvBU6DpIEma/1fUFo1Umlt2iZk1 CUgqXE+Bhi6CGjZ7zomE92R/WD5th+LAT/6E2xxUXccl8Xn03+7bDI2ojT8FVogRVa7L MRcQ== X-Gm-Message-State: ALoCoQkv2wTFfcdKtR0I92eL0wKMptmd6TqxI7glZWcE33oAAoEALkPdd6bIQ9n2f04bwXOcAAjp X-Received: by 10.236.1.165 with SMTP id 25mr729086yhd.108.1375847139567; Tue, 06 Aug 2013 20:45:39 -0700 (PDT) Received: from rfranz-v430.caveonetworks.com (64.2.3.195.ptr.us.xo.net. [64.2.3.195]) by mx.google.com with ESMTPSA id s65sm6814380yhs.14.2013.08.06.20.45.38 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 06 Aug 2013 20:45:39 -0700 (PDT) From: Roy Franz To: linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, matt.fleming@intel.com, linux@arm.linux.org.uk Subject: [PATCH 13/17] Fix types in EFI calls to match EFI function definitions. Date: Tue, 6 Aug 2013 20:45:09 -0700 Message-Id: <1375847113-24884-14-git-send-email-roy.franz@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1375847113-24884-1-git-send-email-roy.franz@linaro.org> References: <1375847113-24884-1-git-send-email-roy.franz@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130806_234559_069977_410DB3C2 X-CRM114-Status: UNSURE ( 8.82 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.6 (--) Cc: Roy Franz , dave.martin@arm.com, leif.lindholm@linaro.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP EFI calls can made directly on ARM, so the function pointers are directly invoked. This allows types to be checked at compile time, so here we ensure that the parameters match the function signature. Signed-off-by: Roy Franz --- drivers/firmware/efi/efi-stub-helper.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/firmware/efi/efi-stub-helper.c b/drivers/firmware/efi/efi-stub-helper.c index 521a4c4..bbe02fd 100644 --- a/drivers/firmware/efi/efi-stub-helper.c +++ b/drivers/firmware/efi/efi-stub-helper.c @@ -321,7 +321,7 @@ static efi_status_t handle_cmdline_files(efi_system_table_t *sys_table_arg, status = efi_call_phys3(sys_table_arg->boottime->allocate_pool, EFI_LOADER_DATA, nr_files * sizeof(*files), - &files); + (void **)&files); if (status != EFI_SUCCESS) { efi_printk(sys_table_arg, "Failed to alloc mem for file handle list\n"); goto fail; @@ -372,7 +372,8 @@ static efi_status_t handle_cmdline_files(efi_system_table_t *sys_table_arg, boottime = sys_table_arg->boottime; status = efi_call_phys3(boottime->handle_protocol, - image->device_handle, &fs_proto, &io); + image->device_handle, &fs_proto, + (void **)&io); if (status != EFI_SUCCESS) { efi_printk(sys_table_arg, "Failed to handle fs_proto\n"); goto free_files; @@ -406,7 +407,8 @@ static efi_status_t handle_cmdline_files(efi_system_table_t *sys_table_arg, grow: status = efi_call_phys3(sys_table_arg->boottime->allocate_pool, - EFI_LOADER_DATA, info_sz, &info); + EFI_LOADER_DATA, info_sz, + (void **)&info); if (status != EFI_SUCCESS) { efi_printk(sys_table_arg, "Failed to alloc mem for file info\n"); goto close_handles; @@ -456,18 +458,19 @@ grow: addr = file_addr; for (j = 0; j < nr_files; j++) { - u64 size; + unsigned long size; size = files[j].size; while (size) { - u64 chunksize; + unsigned long chunksize; if (size > EFI_READ_CHUNK_SIZE) chunksize = EFI_READ_CHUNK_SIZE; else chunksize = size; status = efi_call_phys3(fh->read, files[j].handle, - &chunksize, addr); + &chunksize, + (void *)addr); if (status != EFI_SUCCESS) { efi_printk(sys_table_arg, "Failed to read file\n"); goto free_file_total;