From patchwork Wed Sep 9 21:59:41 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rasmus Villemoes X-Patchwork-Id: 7149401 X-Patchwork-Delegate: rjw@sisk.pl Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id F2D4F9F1D3 for ; Wed, 9 Sep 2015 21:59:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1BF06209AC for ; Wed, 9 Sep 2015 21:59:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0CBDE209A0 for ; Wed, 9 Sep 2015 21:59:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752520AbbIIV74 (ORCPT ); Wed, 9 Sep 2015 17:59:56 -0400 Received: from mail-la0-f46.google.com ([209.85.215.46]:33879 "EHLO mail-la0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751870AbbIIV74 (ORCPT ); Wed, 9 Sep 2015 17:59:56 -0400 Received: by laeb10 with SMTP id b10so16348393lae.1 for ; Wed, 09 Sep 2015 14:59:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; h=from:to:cc:subject:date:message-id; bh=vb296pTW8tp3jetYz1bLmOShDJ7hTCy3f3RtxzX0iZ4=; b=hCd8Y5lggLo5JmA0CKqygDr8ddBi/makpMujLz6SyUtfqhoBWgqDkM7JqffI9axuYV 4oOEgmozFmcT5VfuB9d7DycK2fb3kGbmA7hxIxHqf3VB5t/fIpdVy+eeG1rvD+DeySpe HmepiMFE5NcuYMkEAFk46xIp/O5pYRuPrhFag= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=vb296pTW8tp3jetYz1bLmOShDJ7hTCy3f3RtxzX0iZ4=; b=lz8O2vMZyDZOb9DTgx2Zx4hFOy8CBSJfbA5vi8d2LFny0ZwMy4ipVsTNC6xVOzV5No 1IzP0Vs9bEnQanDUqwHCzlujHsGZ09lfYGnhy6h74dYucZByRZYgtNp9IcAOV9IWr/VQ KIE9uLnyGToxSGacubJqKhjzEEHzfowk2Qh0YcChnCxADDa0bMQUbiZ3Yq4yi88phRaH Xq5gx6eSpMpstCPL88nfqWFCrfV68eiiThHQVtHEfqwcPz9GuVDjUsgTneGLpxWFpK6+ ZKqCrpDEj748NvDVePAIZMBc256eMuaXtZgC2fIkma1FJ7bNz/j6tpbshhJoubB7oFdg zuvw== X-Gm-Message-State: ALoCoQk0GMKeQfbiJTT6TWk1KHsV7ldY2ovjcw97lWuw/CGmvwUmylU2lc6QlesGNX4mWdKHk3Ki X-Received: by 10.112.64.228 with SMTP id r4mr30456982lbs.80.1441835994645; Wed, 09 Sep 2015 14:59:54 -0700 (PDT) Received: from spencer.imf.au.dk ([130.225.20.51]) by smtp.gmail.com with ESMTPSA id f10sm2123029lae.23.2015.09.09.14.59.53 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Sep 2015 14:59:54 -0700 (PDT) From: Rasmus Villemoes To: "Rafael J. Wysocki" , Len Brown , Robert Moore , Lv Zheng Cc: Rasmus Villemoes , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, devel@acpica.org Subject: [PATCH 1/3] ACPI: constify first argument of struct acpi_scan_handler::match Date: Wed, 9 Sep 2015 23:59:41 +0200 Message-Id: <1441835983-15197-1-git-send-email-linux@rasmusvillemoes.dk> X-Mailer: git-send-email 2.1.3 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP One wouldn't expect a "match" function modify the string it searches for, and indeed the only instance of the struct acpi_scan_handler::match callback, acpi_pnp_match, can easily be changed. While there, update its helper matching_id(). This is also preparation for constifying struct acpi_hardware_id::id. Signed-off-by: Rasmus Villemoes --- drivers/acpi/acpi_pnp.c | 4 ++-- include/acpi/acpi_bus.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/acpi/acpi_pnp.c b/drivers/acpi/acpi_pnp.c index c58940b231d6..48fc3ad13a4b 100644 --- a/drivers/acpi/acpi_pnp.c +++ b/drivers/acpi/acpi_pnp.c @@ -316,7 +316,7 @@ static const struct acpi_device_id acpi_pnp_device_ids[] = { {""}, }; -static bool matching_id(char *idstr, char *list_id) +static bool matching_id(const char *idstr, const char *list_id) { int i; @@ -333,7 +333,7 @@ static bool matching_id(char *idstr, char *list_id) return true; } -static bool acpi_pnp_match(char *idstr, const struct acpi_device_id **matchid) +static bool acpi_pnp_match(const char *idstr, const struct acpi_device_id **matchid) { const struct acpi_device_id *devid; diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index 5ba8fb64f664..9a1b46c64fc1 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h @@ -129,7 +129,7 @@ static inline struct acpi_hotplug_profile *to_acpi_hotplug_profile( struct acpi_scan_handler { const struct acpi_device_id *ids; struct list_head list_node; - bool (*match)(char *idstr, const struct acpi_device_id **matchid); + bool (*match)(const char *idstr, const struct acpi_device_id **matchid); int (*attach)(struct acpi_device *dev, const struct acpi_device_id *id); void (*detach)(struct acpi_device *dev); void (*bind)(struct device *phys_dev);