Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753210AbbKZI1B (ORCPT ); Thu, 26 Nov 2015 03:27:01 -0500 Received: from mx2.suse.de ([195.135.220.15]:44129 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753107AbbKZI06 (ORCPT ); Thu, 26 Nov 2015 03:26:58 -0500 Date: Thu, 26 Nov 2015 09:26:54 +0100 From: Jean Delvare To: Jordan Hargrave Cc: Jordan Hargrave , linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] Save SMBIOS Type 9 System Slots during DMI Scan Message-ID: <20151126092654.3519cef4@endymion.delvare> In-Reply-To: References: <1447884134-31504-1-git-send-email-Jordan_Hargrave@dell.com> <20151125124743.6919eb43@endymion.delvare> Organization: SUSE Linux X-Mailer: Claws Mail 3.10.1 (GTK+ 2.24.23; x86_64-suse-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1331 Lines: 33 On Thu, 26 Nov 2015 02:02:52 -0600, Jordan Hargrave wrote: > On Wed, Nov 25, 2015 at 5:47 AM, Jean Delvare wrote: > > On Wed, 18 Nov 2015 16:02:14 -0600, Jordan Hargrave wrote: > > > +static void __init dmi_save_system_slot(const struct dmi_header *dm) > > > +{ > > > + const char *name; > > > + const u8 *d = (u8*)dm; > > > + > > > + if (dm->type == DMI_ENTRY_SYSTEM_SLOT && dm->length >= 0x11) { > > > > The first half of the test will always succeed so it can be omitted. > > OTOH you do not check the value of d + 0x07 (current usage.) As I > > understand it, you should only consider slots which are in use, so > > where *(d + 0x07) == 0x04? > > Unfortunately BIOS often get 'usage' wrong. And I'd like to keep all slots > recorded if user hotplugs PCIe card. OK, then please add a comment saying so. I'm curious how the BIOS can assign a device number and function when there is no card in the slot. I'm also curious how multi-function cards are handled. I suppose that only the first function has a DMI record? -- Jean Delvare SUSE L3 Support -- 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/