From patchwork Thu Mar 13 22:47:00 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leif Lindholm X-Patchwork-Id: 26238 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f199.google.com (mail-ob0-f199.google.com [209.85.214.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 167DD203AC for ; Thu, 13 Mar 2014 22:52:47 +0000 (UTC) Received: by mail-ob0-f199.google.com with SMTP id wo20sf6224476obc.6 for ; Thu, 13 Mar 2014 15:52:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=eCWiMt3IRA9jj9neqquUGSv6TejsEsk+5fgN1TbHciQ=; b=Y4jYIAyU7SEUO3GobM2DmTh09WT2kcwpLEpcNntIZyl6VI8P3+OU1p4Kq9+Lo1Gg9A HmWuCX/xa57g8K8Aw8QJMuNRwPu2kR4y1cYQ89iqKc21kDQb4h29t8k65rLQF6SIqltA OPb595gUF2V7x4+gCLqGyCTT2Ho/PGXHBch0CQO6BsltnyyJGZ7G5dpEe15pYa7Mpmdq /gf1ZUADrepK+IKoei5z6iXUCs2AQ2IF77ebMGyYmOUPuVExDPe92nyf34JT1n3IxOYK kK0uoGBUBBFtgyl0cF+s+Sc8Lf/H2nKrThr5mTxsbDCzlmfYD4QWa2JQaVqs2syeCLVN u8Lw== X-Gm-Message-State: ALoCoQnbGJxVkjhz+6cx8Be7y3hPpkZyUjwq3FOYVTL9CL7Tfn8BT/3BJFBDsCKhq/7peDhupgcj X-Received: by 10.50.2.65 with SMTP id 1mr1767182igs.1.1394751166627; Thu, 13 Mar 2014 15:52:46 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.30.8 with SMTP id c8ls478743qgc.56.gmail; Thu, 13 Mar 2014 15:52:46 -0700 (PDT) X-Received: by 10.58.161.205 with SMTP id xu13mr3491449veb.4.1394751166528; Thu, 13 Mar 2014 15:52:46 -0700 (PDT) Received: from mail-ve0-f170.google.com (mail-ve0-f170.google.com [209.85.128.170]) by mx.google.com with ESMTPS id wg4si752360vcb.38.2014.03.13.15.52.46 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 13 Mar 2014 15:52:46 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.170 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.170; Received: by mail-ve0-f170.google.com with SMTP id pa12so1890260veb.29 for ; Thu, 13 Mar 2014 15:52:46 -0700 (PDT) X-Received: by 10.52.251.199 with SMTP id zm7mr2993677vdc.21.1394751166444; Thu, 13 Mar 2014 15:52:46 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.78.9 with SMTP id i9csp10411vck; Thu, 13 Mar 2014 15:52:45 -0700 (PDT) X-Received: by 10.66.158.132 with SMTP id wu4mr5475793pab.66.1394751163109; Thu, 13 Mar 2014 15:52:43 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ey10si2365083pab.352.2014.03.13.15.52.42; Thu, 13 Mar 2014 15:52:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755646AbaCMWwh (ORCPT + 26 others); Thu, 13 Mar 2014 18:52:37 -0400 Received: from mail-wg0-f41.google.com ([74.125.82.41]:37949 "EHLO mail-wg0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755355AbaCMWsL (ORCPT ); Thu, 13 Mar 2014 18:48:11 -0400 Received: by mail-wg0-f41.google.com with SMTP id n12so1477469wgh.12 for ; Thu, 13 Mar 2014 15:48:10 -0700 (PDT) X-Received: by 10.194.78.173 with SMTP id c13mr3878486wjx.0.1394750890305; Thu, 13 Mar 2014 15:48:10 -0700 (PDT) Received: from mohikan.mushroom.smurfnet.nu (cpc4-cmbg17-2-0-cust71.5-4.cable.virginm.net. [86.14.224.72]) by mx.google.com with ESMTPSA id dk9sm9072133wjb.4.2014.03.13.15.48.08 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Mar 2014 15:48:09 -0700 (PDT) From: Leif Lindholm To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-efi@vger.kernel.org, catalin.marinas@arm.com, matt.fleming@intel.com Cc: msalter@redhat.com, roy.franz@linaro.org, Leif Lindholm Subject: [PATCH v2 07/15] efi: Add shared printk wrapper for consistent prefixing Date: Thu, 13 Mar 2014 22:47:00 +0000 Message-Id: <1394750828-16351-8-git-send-email-leif.lindholm@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1394750828-16351-1-git-send-email-leif.lindholm@linaro.org> References: <1394750828-16351-1-git-send-email-leif.lindholm@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: leif.lindholm@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.170 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Roy Franz Add a wrapper for printk to standardize the prefix for informational and error messages from the EFI stub. Signed-off-by: Roy Franz Signed-off-by: Leif Lindholm --- drivers/firmware/efi/efi-stub-helper.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/drivers/firmware/efi/efi-stub-helper.c b/drivers/firmware/efi/efi-stub-helper.c index 661f425..4c8ab86 100644 --- a/drivers/firmware/efi/efi-stub-helper.c +++ b/drivers/firmware/efi/efi-stub-helper.c @@ -45,6 +45,9 @@ static void efi_printk(efi_system_table_t *sys_table_arg, char *str) } } +#define pr_efi(sys_table, msg) efi_printk(sys_table, "EFI stub: "msg) +#define pr_efi_err(sys_table, msg) efi_printk(sys_table, "EFI stub: ERROR: "msg) + static efi_status_t efi_get_memory_map(efi_system_table_t *sys_table_arg, efi_memory_desc_t **map, @@ -324,7 +327,7 @@ static efi_status_t handle_cmdline_files(efi_system_table_t *sys_table_arg, nr_files * sizeof(*files), (void **)&files); if (status != EFI_SUCCESS) { - efi_printk(sys_table_arg, "Failed to alloc mem for file handle list\n"); + pr_efi_err(sys_table_arg, "Failed to alloc mem for file handle list\n"); goto fail; } @@ -376,13 +379,13 @@ static efi_status_t handle_cmdline_files(efi_system_table_t *sys_table_arg, image->device_handle, &fs_proto, (void **)&io); if (status != EFI_SUCCESS) { - efi_printk(sys_table_arg, "Failed to handle fs_proto\n"); + pr_efi_err(sys_table_arg, "Failed to handle fs_proto\n"); goto free_files; } status = efi_call_phys2(io->open_volume, io, &fh); if (status != EFI_SUCCESS) { - efi_printk(sys_table_arg, "Failed to open volume\n"); + pr_efi_err(sys_table_arg, "Failed to open volume\n"); goto free_files; } } @@ -390,7 +393,7 @@ static efi_status_t handle_cmdline_files(efi_system_table_t *sys_table_arg, status = efi_call_phys5(fh->open, fh, &h, filename_16, EFI_FILE_MODE_READ, (u64)0); if (status != EFI_SUCCESS) { - efi_printk(sys_table_arg, "Failed to open file: "); + pr_efi_err(sys_table_arg, "Failed to open file: "); efi_char16_printk(sys_table_arg, filename_16); efi_printk(sys_table_arg, "\n"); goto close_handles; @@ -402,7 +405,7 @@ static efi_status_t handle_cmdline_files(efi_system_table_t *sys_table_arg, status = efi_call_phys4(h->get_info, h, &info_guid, &info_sz, NULL); if (status != EFI_BUFFER_TOO_SMALL) { - efi_printk(sys_table_arg, "Failed to get file info size\n"); + pr_efi_err(sys_table_arg, "Failed to get file info size\n"); goto close_handles; } @@ -411,7 +414,7 @@ grow: EFI_LOADER_DATA, info_sz, (void **)&info); if (status != EFI_SUCCESS) { - efi_printk(sys_table_arg, "Failed to alloc mem for file info\n"); + pr_efi_err(sys_table_arg, "Failed to alloc mem for file info\n"); goto close_handles; } @@ -427,7 +430,7 @@ grow: efi_call_phys1(sys_table_arg->boottime->free_pool, info); if (status != EFI_SUCCESS) { - efi_printk(sys_table_arg, "Failed to get file info\n"); + pr_efi_err(sys_table_arg, "Failed to get file info\n"); goto close_handles; } @@ -446,13 +449,13 @@ grow: status = efi_high_alloc(sys_table_arg, file_size_total, 0x1000, &file_addr, max_addr); if (status != EFI_SUCCESS) { - efi_printk(sys_table_arg, "Failed to alloc highmem for files\n"); + pr_efi_err(sys_table_arg, "Failed to alloc highmem for files\n"); goto close_handles; } /* We've run out of free low memory. */ if (file_addr > max_addr) { - efi_printk(sys_table_arg, "We've run out of free low memory\n"); + pr_efi_err(sys_table_arg, "We've run out of free low memory\n"); status = EFI_INVALID_PARAMETER; goto free_file_total; } @@ -473,7 +476,7 @@ grow: &chunksize, (void *)addr); if (status != EFI_SUCCESS) { - efi_printk(sys_table_arg, "Failed to read file\n"); + pr_efi_err(sys_table_arg, "Failed to read file\n"); goto free_file_total; } addr += chunksize; @@ -558,7 +561,7 @@ static efi_status_t efi_relocate_kernel(efi_system_table_t *sys_table_arg, &new_addr); } if (status != EFI_SUCCESS) { - efi_printk(sys_table_arg, "ERROR: Failed to allocate usable memory for kernel.\n"); + pr_efi_err(sys_table_arg, "ERROR: Failed to allocate usable memory for kernel.\n"); return status; }