From patchwork Thu Jul 14 16:34:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corey Minyard X-Patchwork-Id: 72036 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp169762qga; Thu, 14 Jul 2016 09:35:11 -0700 (PDT) X-Received: by 10.98.110.195 with SMTP id j186mr13988086pfc.49.1468514111663; Thu, 14 Jul 2016 09:35:11 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id db1si3744125pac.123.2016.07.14.09.35.11; Thu, 14 Jul 2016 09:35:11 -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 S1751926AbcGNQey (ORCPT + 30 others); Thu, 14 Jul 2016 12:34:54 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:34817 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751613AbcGNQeL (ORCPT ); Thu, 14 Jul 2016 12:34:11 -0400 Received: by mail-pf0-f193.google.com with SMTP id t190so4991452pfb.2 for ; Thu, 14 Jul 2016 09:34:10 -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=o2z9FQFY6a/YBGAacMSeQzD4Ddlm/JRiJeAVEaqq848DBAejclT4yVCiz4nW/6TLIu Cgs2s8RWh/vHwPe1JEtxLgtwJFsO4UmE8MKpOFT8xlC+Jfp84Zo8qaOMLv/jqEKZ0uQH EB56OKA4qxpoucQoO6bFWcAi5j+7+sTwdTF0+amGUm2yfmTItuj2jMmgjirAgSJzPARU MVNkSTeLJdqT80/Pmokyi7vF+CDw4QIJ0k411teRzkogEBRj9s0IUOeXF1JhrQohdhWM eMg6JOB+3oM3sEVyCTib3njswv0UaJnLrfiKFj20+gLhzELDshPsSx/arudyuKCuTgW3 YpBA== 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=PpN6YjnwyqCbZdVqeJ/ensl4fVaM7op38AxWM89uFsfBBZrK5uPSDuZOjx94EQDCpO RIOBJXAHGyFcgAV+1MJl8TP/SHxbSP7WWAYEErZAYFVcwdcaJYz5i5wAZxNvdi2R1WyI l70tQ4LnpGMcKR4Q/1t2cgek7qVfpkNcAlSd4XGbphkUiXfh3sh5jNTmb95Jr20suIdH RElPtQEaN6+A1qw0Sppv3cdgXWGXPfvHRdD/B8taHYVuqj4akxPR3xIKcoR1+qVdLd0g 4WveVr56IdE0ZeEF20bR5BRcLKWfV90N+8RkoSoc1WHGNDvRu4T02hWgAfiGdvFAP0IM Ik4A== X-Gm-Message-State: ALyK8tJ+udQH139raRO/WTN6Lt04+Xz7Q6IusvqlsxoqHWDMsgC/dh0iS4p2DifW6bkKkw== X-Received: by 10.98.107.129 with SMTP id g123mr14014618pfc.62.1468514050292; Thu, 14 Jul 2016 09:34:10 -0700 (PDT) Received: from serve.minyard.net (serve.minyard.net. [2001:470:b8f6:1b::1]) by smtp.gmail.com with ESMTPSA id x184sm6446101pfd.70.2016.07.14.09.34.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Jul 2016 09:34:09 -0700 (PDT) Received: from t430.minyard.net (unknown [IPv6:2001:470:b8f6:1b:91d:ffc3:b8d2:3732]) by serve.minyard.net (Postfix) with ESMTPA id 394BA19A2; Thu, 14 Jul 2016 11:34:07 -0500 (CDT) Received: by t430.minyard.net (Postfix, from userid 1000) id 75F763012B3; Thu, 14 Jul 2016 11:34:04 -0500 (CDT) From: minyard@acm.org To: linux-kernel@vger.kernel.org, Jean Delvare , openipmi-developer@lists.sourceforge.net Cc: Corey Minyard , Andy Lutomirski Subject: [PATCH v4 1/4] dmi: remove const from return of dmi_find_device Date: Thu, 14 Jul 2016 11:34:00 -0500 Message-Id: <1468514043-21081-2-git-send-email-minyard@acm.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1468514043-21081-1-git-send-email-minyard@acm.org> References: <1468514043-21081-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) { }