From patchwork Fri Jan 10 16:30:11 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roy Franz X-Patchwork-Id: 23092 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f200.google.com (mail-ob0-f200.google.com [209.85.214.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 43734216DB for ; Fri, 10 Jan 2014 16:30:32 +0000 (UTC) Received: by mail-ob0-f200.google.com with SMTP id wm4sf16614523obc.11 for ; Fri, 10 Jan 2014 08:30:31 -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=zw1xAa7fmcDwOr/pdUvnOuofRVd/6uuVPIf0uVJ1CEQ=; b=BnDcRH0Bcu+MpM2kWXITUnZgQLSZUjRx40n1iF88UuWH+9onvWa9QUiCTcBwMtHJlF hqrAJIP/DuXzRkyewgM+ErbXUAbG4fG9gJ1er+JGnQtThJgJC4DxBZ/zap8aQLVfPQDX dsckNeHr6cgLdB37Z3EpOM7Xl3a7vHRhUf9mIrCX/J2TLdNMnOF52SExeg5WSr/lZq66 VgUPqwcUFOTnvGYsbIoFfP66YFKXpTT70LTNNxAsTCtGAwCE3uDsLBJNcN0K+7NlgR9+ yCXmi9Mynf2OpxGCuCTUK7zNBuIliEkwZ9/ULKmln+o7OwyykgctEo32wtK9IPndHjsq kgFw== X-Gm-Message-State: ALoCoQloyVoFP6OWiZ4m6ZtJP4I+1iuS3JhG5AZwrZ9gjviE+pyVAhk9XH30N12Smhcaf9yu5aXy X-Received: by 10.182.213.5 with SMTP id no5mr3811717obc.15.1389371431434; Fri, 10 Jan 2014 08:30:31 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.106.102 with SMTP id gt6ls1541538qeb.78.gmail; Fri, 10 Jan 2014 08:30:31 -0800 (PST) X-Received: by 10.58.152.130 with SMTP id uy2mr320253veb.71.1389371431332; Fri, 10 Jan 2014 08:30:31 -0800 (PST) Received: from mail-vb0-f45.google.com (mail-vb0-f45.google.com [209.85.212.45]) by mx.google.com with ESMTPS id sp7si5248428vdc.73.2014.01.10.08.30.31 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 10 Jan 2014 08:30:31 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.45 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.45; Received: by mail-vb0-f45.google.com with SMTP id m10so628201vbh.32 for ; Fri, 10 Jan 2014 08:30:31 -0800 (PST) X-Received: by 10.52.248.69 with SMTP id yk5mr7301281vdc.31.1389371431196; Fri, 10 Jan 2014 08:30:31 -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.59.13.131 with SMTP id ey3csp100815ved; Fri, 10 Jan 2014 08:30:30 -0800 (PST) X-Received: by 10.68.191.73 with SMTP id gw9mr12510321pbc.158.1389371429847; Fri, 10 Jan 2014 08:30:29 -0800 (PST) Received: from mail-pd0-f182.google.com (mail-pd0-f182.google.com [209.85.192.182]) by mx.google.com with ESMTPS id wm3si7620828pab.194.2014.01.10.08.30.29 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 10 Jan 2014 08:30:29 -0800 (PST) Received-SPF: neutral (google.com: 209.85.192.182 is neither permitted nor denied by best guess record for domain of roy.franz@linaro.org) client-ip=209.85.192.182; Received: by mail-pd0-f182.google.com with SMTP id v10so4758807pde.13 for ; Fri, 10 Jan 2014 08:30:29 -0800 (PST) X-Received: by 10.68.130.10 with SMTP id oa10mr12722149pbb.160.1389371429334; Fri, 10 Jan 2014 08:30:29 -0800 (PST) Received: from rfranz-i7.local (c-24-10-97-91.hsd1.ca.comcast.net. [24.10.97.91]) by mx.google.com with ESMTPSA id nw11sm23388124pab.13.2014.01.10.08.30.27 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Jan 2014 08:30:28 -0800 (PST) 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 Cc: leif.lindholm@linaro.org, grant.likely@linaro.org, dave.martin@arm.com, msalter@redhat.com, patches@linaro.org, Roy Franz Subject: [PATCH V6 2/8] Add shared printk wrapper for consistent prefixing Date: Fri, 10 Jan 2014 08:30:11 -0800 Message-Id: <1389371417-379-3-git-send-email-roy.franz@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1389371417-379-1-git-send-email-roy.franz@linaro.org> References: <1389371417-379-1-git-send-email-roy.franz@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: roy.franz@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.45 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: , Add a wrapper for printk to standardize the prefix for informational and error messages from the EFI stub. Signed-off-by: Roy Franz --- 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; }