From patchwork Wed Feb 5 17:03:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leif Lindholm X-Patchwork-Id: 24194 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f70.google.com (mail-oa0-f70.google.com [209.85.219.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8FEF32127D for ; Wed, 5 Feb 2014 17:05:23 +0000 (UTC) Received: by mail-oa0-f70.google.com with SMTP id m1sf3555079oag.1 for ; Wed, 05 Feb 2014 09:05:22 -0800 (PST) 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:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=qc/FvMM9hIUxsrK0mxTNUigHaGYYLmZPtuWbnP1LmiA=; b=kZg2FniWEdyrcIVGVBd1hDi6ERKOA1vvqIPB4SnKw3yONKENLpxFhroESbnkifYD3O mfVGUHC4Hqb2dxn1kouCn8S1VMokpZdJhyuoCgH/+f8/cyN0Ta+zxxzU9+DBX/Fl8xXa 7J3LT5WDgNEXd56M/OZufJ2tABtm9/MTj2DvZncz8Mz5OR4WGkSmQBFo26Uh//SLINwx FwsfUxlHkLm6OBPFqJ8piWGqJk95HHXQLC2q2Zb1tI5zBJywdQBS5JXiKFogMni18eht tK22ielIB5NwlT20sShvUXqyn0JMXZVzEoZu+lkeJwxGQFNroR2wJs2pctiZzSHEFSVy /bFA== X-Gm-Message-State: ALoCoQnQ/zDTwYjGx0tOTf8rQbkTqVmzG1aAiGILfIJN49YDI2pgFhc4mrof8nOKrFpEA+oCwOX9 X-Received: by 10.43.158.9 with SMTP id ls9mr957932icc.18.1391619922699; Wed, 05 Feb 2014 09:05:22 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.22.106 with SMTP id 97ls248638qgm.29.gmail; Wed, 05 Feb 2014 09:05:22 -0800 (PST) X-Received: by 10.52.27.9 with SMTP id p9mr1467117vdg.28.1391619922571; Wed, 05 Feb 2014 09:05:22 -0800 (PST) Received: from mail-vc0-f181.google.com (mail-vc0-f181.google.com [209.85.220.181]) by mx.google.com with ESMTPS id y6si9824614veb.101.2014.02.05.09.05.22 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 05 Feb 2014 09:05:22 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.181 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.181; Received: by mail-vc0-f181.google.com with SMTP id ie18so510923vcb.12 for ; Wed, 05 Feb 2014 09:05:22 -0800 (PST) X-Received: by 10.52.106.166 with SMTP id gv6mr121036vdb.86.1391619922483; Wed, 05 Feb 2014 09:05:22 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp64578vcz; Wed, 5 Feb 2014 09:05:21 -0800 (PST) X-Received: by 10.180.189.169 with SMTP id gj9mr17937192wic.17.1391619917195; Wed, 05 Feb 2014 09:05:17 -0800 (PST) Received: from mail-wi0-f173.google.com (mail-wi0-f173.google.com [209.85.212.173]) by mx.google.com with ESMTPS id ne3si9765029wic.68.2014.02.05.09.05.16 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 05 Feb 2014 09:05:17 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.173 is neither permitted nor denied by best guess record for domain of leif.lindholm@linaro.org) client-ip=209.85.212.173; Received: by mail-wi0-f173.google.com with SMTP id hn9so795515wib.6 for ; Wed, 05 Feb 2014 09:05:16 -0800 (PST) X-Received: by 10.180.207.15 with SMTP id ls15mr3361601wic.50.1391619916534; Wed, 05 Feb 2014 09:05:16 -0800 (PST) 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 p1sm47427211wie.1.2014.02.05.09.05.15 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Feb 2014 09:05:15 -0800 (PST) From: Leif Lindholm To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-efi@vger.kernel.org Cc: patches@linaro.org, Roy Franz , Leif Lindholm Subject: [PATCH 05/22] Add shared printk wrapper for consistent prefixing Date: Wed, 5 Feb 2014 17:03:56 +0000 Message-Id: <1391619853-10601-6-git-send-email-leif.lindholm@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1391619853-10601-1-git-send-email-leif.lindholm@linaro.org> References: <1391619853-10601-1-git-send-email-leif.lindholm@linaro.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.220.181 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 Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: 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 b6bffbf..eb5d2eb 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; }