From patchwork Wed May 17 19:56:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corey Minyard X-Patchwork-Id: 100007 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp392122qge; Wed, 17 May 2017 12:56:58 -0700 (PDT) X-Received: by 10.99.97.83 with SMTP id v80mr546507pgb.94.1495051018782; Wed, 17 May 2017 12:56:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1495051018; cv=none; d=google.com; s=arc-20160816; b=VW8i3KCk6jfUdh8o1tiABO+hdoujRmrQcBXbt3WIsY7JSkQtkp6EKQnAeaXaTjH5YG Mo4QpLlew3CZiPQeo7OfT4FvjAuZmrCUlgeu4rz1pm1xY111G0QD77fTGyExM5zmKADJ WW9E720j2Utc5veqeYR3CcHXMARcBE6uJQYzirQdrafBp7mZMdVI7t+LQx8KOZkYXVEp PCXYhFaW5+mnNxAU7uuX+tJ7riTASsDsmsOAbpyLArdgfO+DLvDyj2GwhUjvXvP8ULJt aGQdd5jqQBSfzNDjlIMb4RIjoWRW3qie5F752yaaOgSLD0nRTMIIrM48/lMnHA0Rk71q 8EtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=sBn2QevA4zZeVsUHPTFoWz3VrKfWoWAwZ33IIgnZTZo=; b=D4Xxi/3ybXrns0a2qjZdH+iaFBIT9ieuTVuCUQ20D24d5sFi9dmlJYAo4UxiVpJeD5 VffW9B1BSPnIqOkIlbRlUWPNR6/h/RkgXMq70FmHbGiXWotH3hGR8tyICgDcs0BePqTu AViB7dyIuGpMXcsg/Yi783s9Cbiw63Wy1P3tMJuocU+rSKhjfJrm+w+flvRsxOVHV+Cz 6DrY1SJQF94rR2k032wOo/CUNd3QkQA86gtF8jAYLBX6Sn4TDowlLGnJrEAeWQgT5OMD eiLoLIeQLEH+TN4U0awIEkPhj0sv5Hdqk7HSHFIrtIT8Ivp1HschKpY0Z5qnvem3K0MV sE+A== ARC-Authentication-Results: i=1; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l10si2972162pln.71.2017.05.17.12.56.58; Wed, 17 May 2017 12:56:58 -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 S1753433AbdEQT4f (ORCPT + 25 others); Wed, 17 May 2017 15:56:35 -0400 Received: from mail-oi0-f65.google.com ([209.85.218.65]:34104 "EHLO mail-oi0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752921AbdEQT4d (ORCPT ); Wed, 17 May 2017 15:56:33 -0400 Received: by mail-oi0-f65.google.com with SMTP id w10so3904214oif.1 for ; Wed, 17 May 2017 12:56:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=sBn2QevA4zZeVsUHPTFoWz3VrKfWoWAwZ33IIgnZTZo=; b=crFSMp+z5Xl+Lvj3YosdQEOrVSrZQZJdhuPNWNMUNz6LNMbKWMo+1W98M5sexgySQe rQWH/uBrxV3YaNe8FtYFaUHsP1kCzqqgUfyPvamJheYMLpmbVReLuUPtsMECVrI324xk Dhps8sLun7yAqs51u2Vxxtn3HkTbxhGQQxkjWwI7lbjFk3N/B2/VwzuvpJtp0PTq7+wa LNchRFvItgR41YyTHihZty6GmWmE+IkxhSuYExK/l2My7bwdhYsBfIb0oo8Qi1P4xgCu dXgR10Jxewdosj0Nwnpda5B/G9qFSsQFwsIwpyjWUSFg9kSisXe4mrTZ8DZdMw+VV1aJ 1d3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=sBn2QevA4zZeVsUHPTFoWz3VrKfWoWAwZ33IIgnZTZo=; b=T6PLCB3wKLObML13U3oHqIWz1gZzSyRV49ohQbOBjHCTnBhqSFzjHXKfLs7C2wfmXu JPrSmqx4O5h5p1/DoLufEyz6DlPRu2sTQkuRayFpl+plsM5NhT88ow8U9k01LskCc8V7 pm9uLOGCd0P4J4OFJIQKAeiXOjNMpvOU7WrzQNdgo3qmLyBiRCN9uSpGCra/4e4q0xLJ EmzQx7NtRZRRZyXfZL69ScnsfgZ4uJEaW8lv1p9HccxRl5rT45bhzLtOhZdXRJDbM1tY I3Y5+/bIi03hgzu03fQem38feaaJPXM9+eqAZrGzY64PdRGSlhWlkQezQ+7DYcdyBPyt 9H6A== X-Gm-Message-State: AODbwcBWTilPwJ4ffa0X92/OMX2flCIHEMmZbKaQkF1oanbzIjS8gugP 2XiIPG8LBjyM4A== X-Received: by 10.202.168.140 with SMTP id r134mr250129oie.57.1495050993071; Wed, 17 May 2017 12:56:33 -0700 (PDT) Received: from serve.minyard.net ([47.184.154.34]) by smtp.gmail.com with ESMTPSA id e46sm1504664otc.17.2017.05.17.12.56.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 May 2017 12:56:31 -0700 (PDT) Received: from t430.minyard.net (t430m.minyard.net [192.168.27.3]) by serve.minyard.net (Postfix) with ESMTPA id D62231310; Wed, 17 May 2017 14:56:30 -0500 (CDT) Received: by t430.minyard.net (Postfix, from userid 1000) id ED8BB3029B4; Wed, 17 May 2017 14:56:28 -0500 (CDT) From: minyard@acm.org To: Jean Delvare Cc: openipmi-developer@lists.sourceforge.net, linux-kernel@vger.kernel.org, Andy Lutomirski , Corey Minyard Subject: [PATCH v5 1/5] dmi: remove const from return of dmi_find_device Date: Wed, 17 May 2017 14:56:20 -0500 Message-Id: <1495050984-5602-2-git-send-email-minyard@acm.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1495050984-5602-1-git-send-email-minyard@acm.org> References: <1495050984-5602-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 54be60e..a29e96a 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) { }