Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756033AbbBCOrN (ORCPT ); Tue, 3 Feb 2015 09:47:13 -0500 Received: from mail-la0-f46.google.com ([209.85.215.46]:40184 "EHLO mail-la0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751725AbbBCOrL (ORCPT ); Tue, 3 Feb 2015 09:47:11 -0500 Message-ID: <54D0DF6A.1090503@linaro.org> Date: Tue, 03 Feb 2015 16:47:06 +0200 From: Ivan Khoronzhuk User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Matt Fleming CC: linux-kernel@vger.kernel.org, ard.biesheuvel@linaro.org, grant.likely@linaro.org, matt.fleming@intel.com, linux-api@vger.kernel.org, "linux-doc@vger.kernel.org" , dmidecode-devel@nongnu.org, leif.lindholm@linaro.org Subject: Re: [Patch v3] firmware: dmi-sysfs: add SMBIOS entry point area raw attribute References: <1422448763-17583-1-git-send-email-ivan.khoronzhuk@linaro.org> <54C906A9.1050001@linaro.org> <20150203104953.GA6461@codeblueprint.co.uk> In-Reply-To: <20150203104953.GA6461@codeblueprint.co.uk> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1620 Lines: 42 On 02/03/2015 12:49 PM, Matt Fleming wrote: > On Wed, 28 Jan, at 05:56:25PM, Ivan Khoronzhuk wrote: >>> diff --git a/drivers/firmware/dmi-sysfs.c b/drivers/firmware/dmi-sysfs.c >>> index e0f1cb3..61b6a38 100644 >>> --- a/drivers/firmware/dmi-sysfs.c >>> +++ b/drivers/firmware/dmi-sysfs.c >>> @@ -29,6 +29,8 @@ >>> #define MAX_ENTRY_TYPE 255 /* Most of these aren't used, but we consider >>> the top entry type is only 8 bits */ >>> +static const u8 *smbios_raw_header; > There appears to be a mixture of u8 and unsigned char going on here, cf. > 'smbios_header'. > > While I'm pretty sure all architectures typedef them to be equivalent, > semantically, as a reviewer this makes me think there are type issues. > > Is there any way to use one data type for the SMBIOS header? Let it be u8 in both cases. >>> @@ -669,6 +699,18 @@ static int __init dmi_sysfs_init(void) >>> goto err; >>> } >>> + smbios_raw_header = dmi_get_smbios_entry_area(&size); >>> + if (!smbios_raw_header) { >>> + pr_debug("dmi-sysfs: SMBIOS raw data is not available.\n"); >>> + error = -ENODATA; >>> + goto err; > Perhaps this should be -EINVAL? -ENODATA implies that if you try again > in the future data might be available, i.e. it's a temporary failure. > That's not the case here since the header is invalid. > Yes, -EINVAL is better. I'll send new patch soon. Thanks! -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/