From patchwork Fri Apr 4 12:25:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leif Lindholm X-Patchwork-Id: 27811 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f199.google.com (mail-ie0-f199.google.com [209.85.223.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id AABC720369 for ; Fri, 4 Apr 2014 12:28:01 +0000 (UTC) Received: by mail-ie0-f199.google.com with SMTP id rl12sf11414025iec.10 for ; Fri, 04 Apr 2014 05:28:01 -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=C9YhpoyAty4ruyRYAV5D6+p28JEEFGKViNSU1kSpIcY=; b=ghKzPzCUPQ9sCkguOutY1DLfFCNiKGv/P8XQnhoybEwIv9PdVkxW9FnkWRa1eXGYrl 7fhqeGjI8rLyy2c1R0UuHqBm2u9baGZ5zlhLotHWiD4W4SvSJUr5hDtFRN2YdYasIxc2 e3rCvhGEIrxH3Jm90oot7JUZoYoL9xiB3ysGwdXlXAuI++GoF1o1KAhRlebJ48M5ARp8 c2eZhiO+od5TGWIQPLbMh/I9Egz/xWb+cNWj+kFYo05qNNCTAz/P+xTFKFMnTy31xYs1 Z/UQKCJyT7Wg/g2wHlhbZgtZm4J/Zdaae5q//MKRoAXJh5LLHtSDcQgeAhMmDaekALWc j/Rg== X-Gm-Message-State: ALoCoQl7p5alfcxeuse24HvTiQ9PcHDzZskSYni7nXotrl2gXLyLBpnQeH9/dg+aLB2qRXdb56Z8 X-Received: by 10.50.70.66 with SMTP id k2mr1804842igu.7.1396614480928; Fri, 04 Apr 2014 05:28:00 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.41.40 with SMTP id y37ls1035154qgy.10.gmail; Fri, 04 Apr 2014 05:28:00 -0700 (PDT) X-Received: by 10.58.122.164 with SMTP id lt4mr4912598veb.2.1396614480810; Fri, 04 Apr 2014 05:28:00 -0700 (PDT) Received: from mail-ve0-f178.google.com (mail-ve0-f178.google.com [209.85.128.178]) by mx.google.com with ESMTPS id tm8si1745289vdc.188.2014.04.04.05.28.00 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 04 Apr 2014 05:28:00 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.178 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.178; Received: by mail-ve0-f178.google.com with SMTP id jw12so1400512veb.9 for ; Fri, 04 Apr 2014 05:28:00 -0700 (PDT) X-Received: by 10.58.23.6 with SMTP id i6mr4825520vef.12.1396614480662; Fri, 04 Apr 2014 05:28:00 -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.12.8 with SMTP id v8csp109729vcv; Fri, 4 Apr 2014 05:28:00 -0700 (PDT) X-Received: by 10.66.119.172 with SMTP id kv12mr14936501pab.34.1396614479842; Fri, 04 Apr 2014 05:27:59 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id tk5si4548170pbc.123.2014.04.04.05.27.59; Fri, 04 Apr 2014 05:27:59 -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 S1753001AbaDDM0x (ORCPT + 27 others); Fri, 4 Apr 2014 08:26:53 -0400 Received: from mail-wi0-f169.google.com ([209.85.212.169]:57396 "EHLO mail-wi0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752953AbaDDM0l (ORCPT ); Fri, 4 Apr 2014 08:26:41 -0400 Received: by mail-wi0-f169.google.com with SMTP id hm4so2545975wib.4 for ; Fri, 04 Apr 2014 05:26:40 -0700 (PDT) X-Received: by 10.180.24.134 with SMTP id u6mr4122177wif.41.1396614399959; Fri, 04 Apr 2014 05:26:39 -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 u8sm855089wjq.1.2014.04.04.05.26.38 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Apr 2014 05:26:39 -0700 (PDT) From: Leif Lindholm To: linux-efi@vger.kernel.org, matt.fleming@intel.com Cc: linux-kernel@vger.kernel.org, Roy Franz , Leif Lindholm Subject: [PATCH 4/5] efi: Add shared printk wrapper for consistent prefixing Date: Fri, 4 Apr 2014 13:25:49 +0100 Message-Id: <1396614350-20889-5-git-send-email-leif.lindholm@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1396614350-20889-1-git-send-email-leif.lindholm@linaro.org> References: <1396614350-20889-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.178 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 | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/firmware/efi/efi-stub-helper.c b/drivers/firmware/efi/efi-stub-helper.c index 3cc5ebe..183289c 100644 --- a/drivers/firmware/efi/efi-stub-helper.c +++ b/drivers/firmware/efi/efi-stub-helper.c @@ -33,6 +33,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, @@ -310,7 +313,7 @@ static efi_status_t handle_cmdline_files(efi_system_table_t *sys_table_arg, status = efi_call_early(allocate_pool, EFI_LOADER_DATA, 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; } @@ -374,13 +377,13 @@ static efi_status_t handle_cmdline_files(efi_system_table_t *sys_table_arg, 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; } @@ -401,7 +404,7 @@ static efi_status_t handle_cmdline_files(efi_system_table_t *sys_table_arg, &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; @@ -486,7 +489,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; }