From patchwork Wed Apr 27 13:04:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corey Minyard X-Patchwork-Id: 66791 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp2176976qge; Wed, 27 Apr 2016 06:05:50 -0700 (PDT) X-Received: by 10.98.89.194 with SMTP id k63mr11459236pfj.135.1461762350837; Wed, 27 Apr 2016 06:05:50 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q64si4169118pfb.1.2016.04.27.06.05.50; Wed, 27 Apr 2016 06:05:50 -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; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753127AbcD0NFs (ORCPT + 29 others); Wed, 27 Apr 2016 09:05:48 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:33749 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751829AbcD0NEd (ORCPT ); Wed, 27 Apr 2016 09:04:33 -0400 Received: by mail-pf0-f196.google.com with SMTP id e190so5417472pfe.0 for ; Wed, 27 Apr 2016 06:04:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=r/EdpCMTKOpkleIrN54EPFA1vYEOmpVR0/Arw0RGS80=; b=NJduZUoYiF0Y9G14Bx5h1lt3frEjfvgJiuTD2ce5GKOBFrK0MWzjna0eBZG0kAptwi kKIgbhaCEfVWxh0dIWhgSLA24QW/zIUW8HUXE5Pe+MtCAmMTD7rAFnjEuhjPl7hrk4f9 +nX/wna+zvFeg6nBEuA8XYr7Ka0yGsbYnR+0s+DsM/JqWTiBPHv4n8Qw8boLyH2e4GDI 3KcL4Mm/Dvd3x9x0K3PNuBzwLjbI19b7Mf8djcq7Ja0cwrYV/dBcgMquqOs8wkOnVT59 LLt2fnu62p628f3VkLIvxCcvrcAO0ixeLPoovUH0TVKCOe/UcsSg+iTj3CH47tl0xxyF 5tnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=r/EdpCMTKOpkleIrN54EPFA1vYEOmpVR0/Arw0RGS80=; b=VCSJiNs+BGmYPUg/5lE8OffGf+WsKTpAXCSaGC4ONkK8gx6GYL4vWtF9OK85vWg4jJ v7JkCYfoskdPw01k0SUSxdpQoUpCwCKK417enxi1z181mm/mAeB+TP8ENPZ8Vi/TWv4S amZU4m+5K5TMzwSEIuS916x2sARXyWL/bAqJXortb5wJJ3qKqg6GSa29HhQAa+aVy5zZ sSfYjeZWcgJa0Br2IXeXSYYfxSdxRlbkvQhJE9O3tdP1QidNAyLB5Baxu+4O8T8vxiJO E9w3BKS2rMAboge+b7qDtXRJUD9ah6laPZoPmtUzmQxip6dKGIeg23QB+Cmo6ssO0dFN nqjg== X-Gm-Message-State: AOPr4FWO+Hy1+vCR/N5WtnUKcMWzhWrnIO6UTMF7ZKBwsXgoypTARVIlhPR15W/+5g65lQ== X-Received: by 10.98.86.77 with SMTP id k74mr11455158pfb.28.1461762272452; Wed, 27 Apr 2016 06:04:32 -0700 (PDT) Received: from serve.minyard.net ([173.71.13.195]) by smtp.gmail.com with ESMTPSA id fv10sm6719984pad.40.2016.04.27.06.04.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Apr 2016 06:04:30 -0700 (PDT) Received: from t430.minyard.net (unknown [IPv6:2001:470:b8f6:1b:3c36:6e8c:c70a:c6bd]) by serve.minyard.net (Postfix) with ESMTPA id A3D601550; Wed, 27 Apr 2016 08:04:29 -0500 (CDT) Received: by t430.minyard.net (Postfix, from userid 1000) id 9A609300528; Wed, 27 Apr 2016 08:04:27 -0500 (CDT) From: minyard@acm.org To: openipmi-developer@lists.sourceforge.net, linux-kernel@vger.kernel.org, Jean Delvare Cc: Corey Minyard , Andy Lutomirski Subject: [PATCH v3 1/5] dmi: remove const from return of dmi_find_device Date: Wed, 27 Apr 2016 08:04:16 -0500 Message-Id: <1461762260-32454-2-git-send-email-minyard@acm.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1461762260-32454-1-git-send-email-minyard@acm.org> References: <1461762260-32454-1-git-send-email-minyard@acm.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Corey Minyard A fwnode_handle is being added to dmi_device, and that will need to be updated. So remove the const. Signed-off-by: Corey Minyard Cc: Jean Delvare Cc: Andy Lutomirski Tested-by: Andy Lutomirski --- drivers/firmware/dmi_scan.c | 11 +++++------ include/linux/dmi.h | 10 +++++----- 2 files changed, 10 insertions(+), 11 deletions(-) -- 2.7.4 diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c index 88bebe1..da471b2 100644 --- a/drivers/firmware/dmi_scan.c +++ b/drivers/firmware/dmi_scan.c @@ -896,14 +896,13 @@ EXPORT_SYMBOL(dmi_name_in_vendors); * A new search is initiated by passing %NULL as the @from argument. * If @from is not %NULL, searches continue from next device. */ -const struct dmi_device *dmi_find_device(int type, const char *name, - const struct dmi_device *from) +struct dmi_device *dmi_find_device(int type, const char *name, + const struct dmi_device *from) { - const struct list_head *head = from ? &from->list : &dmi_devices; - struct list_head *d; + struct list_head *d = from ? from->list.next : dmi_devices.next; - for (d = head->next; d != &dmi_devices; d = d->next) { - const struct dmi_device *dev = + for (; d != &dmi_devices; d = d->next) { + struct dmi_device *dev = list_entry(d, struct dmi_device, list); if (((type == DMI_DEV_TYPE_ANY) || (dev->type == type)) && diff --git a/include/linux/dmi.h b/include/linux/dmi.h index 5e9c74c..a930a4d 100644 --- a/include/linux/dmi.h +++ b/include/linux/dmi.h @@ -98,9 +98,9 @@ struct dmi_dev_onboard { extern struct kobject *dmi_kobj; extern int dmi_check_system(const struct dmi_system_id *list); const struct dmi_system_id *dmi_first_match(const struct dmi_system_id *list); -extern const char * dmi_get_system_info(int field); -extern const struct dmi_device * dmi_find_device(int type, const char *name, - const struct dmi_device *from); +extern const char *dmi_get_system_info(int field); +extern struct dmi_device *dmi_find_device(int type, const char *name, + const struct dmi_device *from); extern void dmi_scan_machine(void); extern void dmi_memdev_walk(void); extern void dmi_set_dump_stack_arch_desc(void); @@ -116,8 +116,8 @@ extern void dmi_memdev_name(u16 handle, const char **bank, const char **device); #else static inline int dmi_check_system(const struct dmi_system_id *list) { return 0; } -static inline const char * dmi_get_system_info(int field) { return NULL; } -static inline const struct dmi_device * dmi_find_device(int type, const char *name, +static inline const char *dmi_get_system_info(int field) { return NULL; } +static inline struct dmi_device *dmi_find_device(int type, const char *name, const struct dmi_device *from) { return NULL; } static inline void dmi_scan_machine(void) { return; } static inline void dmi_memdev_walk(void) { }