From patchwork Tue Dec 19 13:52:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 180949 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp1949265dyi; Tue, 19 Dec 2023 05:53:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IHHm2eV8Pl957EqpNBXM/PmueqdV8aIvxwORCsgCVf1rZFKH+PYHh09toocvjrrPPkYJEjK X-Received: by 2002:a05:6a20:734f:b0:18c:5795:669e with SMTP id v15-20020a056a20734f00b0018c5795669emr9542743pzc.19.1702993991989; Tue, 19 Dec 2023 05:53:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702993991; cv=none; d=google.com; s=arc-20160816; b=mcngaToqq9oG6bpBGpCopV2x+Lw0rTOxO9RO7PC0y7nVeRdGSKt7WF5lE/sVVSDscC FNqbnbU9HPDaTV3/B/JWP93Gd5dtxIirrFSyUIuoZxex3TdKM68UA3pH41yXoc6FK5Ak s/ESpTH05dIC6AtwBI30hz7+PXiVDdluzJVwh887OpyFz09sprYuEaFHtE3fcE6kEQgh ww5rxchnXinCks4BIuE6dn8rq683FmO7ufbB4R7HoqejKOIrbuURRCHml56K7aI+vjyh LCp4l366T6FKNtPpL6OQuVij86JoOIlmRp21yt3TFI2cly/ayjOKC9qls4bA6Oz0YsMO 4QZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:lines:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=alQFFMPFN5s+A9F/swsOQ4UNFRrOH21p93wCns1J/kw=; fh=jUXwtF0520eqoQ34ytTRmHhHfmU9hKCLubTc/MmAv2E=; b=OvqiMERw4Io5PS92weBzkT05rPhgCBtEiQlVTaDdUE3Oju7dLThKdb2L47Xv6K4dZY bxPbsx1vG3L/qTpnwilRzJ6SvASNrgmhj9U8Olgsm5jIt5nxgY1lirPu7Hc0HOwNrIDB mieIekO3EhSo5sBMJzEpjFPYeaPTC7lPq3CLBGE530IN09f2vuoS7ih/kZ2S3c84METN 9yTvdUhIGYWaEILYTuPOfQCmW8OdV5Z9tUiDDt8Zl9Nv8i54eIFhGq6++Cy0GksmNnI8 XbN+VhzW26L+KOs1QNiqCB8mcJYRW6ONC54tqMYew8w5VxL8JhrL8odXZJdC6jvuQcDe s5nQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="Qpq1X/xb"; spf=pass (google.com: domain of linux-kernel+bounces-5288-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5288-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 23-20020aa79117000000b006cdaa195ea6si19636987pfh.69.2023.12.19.05.53.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 05:53:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5288-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="Qpq1X/xb"; spf=pass (google.com: domain of linux-kernel+bounces-5288-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5288-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 0928DB23364 for ; Tue, 19 Dec 2023 13:53:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5D5FC19BCB; Tue, 19 Dec 2023 13:52:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="Qpq1X/xb" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6A7AF1BDCD for ; Tue, 19 Dec 2023 13:52:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5B2E9C433C8; Tue, 19 Dec 2023 13:52:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1702993965; bh=y9kMvV4sEkVZ0E0BC98vY+U0QoLkarw+sUxXP25mRp0=; h=From:To:Cc:Subject:Date:From; b=Qpq1X/xbSEQ0zPPckZ1YvQIzAdJRGxTCdMR2TPHWfDM+kqTGUE+lbDUHOlj9k52lM cpFyYni+2WtXWTGeztZm54iqEx3Xn9TD1QWyObZA6gGluQWYzidqsjOBr6X8CaDgg2 7NBz75sEHCfEtr5NmypMKyHpiDE2ETpZF++djxlQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , "Rafael J. Wysocki" Subject: [PATCH] driver core: bus: make bus_sort_breadthfirst() take a const pointer Date: Tue, 19 Dec 2023 14:52:36 +0100 Message-ID: <2023121935-stinking-ditzy-fd5d@gregkh> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Lines: 39 X-Developer-Signature: v=1; a=openpgp-sha256; l=1580; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=y9kMvV4sEkVZ0E0BC98vY+U0QoLkarw+sUxXP25mRp0=; b=owGbwMvMwCRo6H6F97bub03G02pJDKmNC1SEsm7nGutv7o3INZ7OYTSrT2dmx9d7/il7j5ov6 lbWErndEcvCIMjEICumyPJlG8/R/RWHFL0MbU/DzGFlAhnCwMUpABOpOcQwP3mW0qLUlZxy9Ywl P80K8v+dfh+2nmHB5I8sTCunBHK8v33ynWH8Hq/Tx44cAgA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785718627884150286 X-GMAIL-MSGID: 1785718627884150286 For some reason, during the big "clean up the driver core for a const struct bus_type" work, the bus_sort_breadthfirst() call was missed. Fix this up by changing the type to be a const * as it should be. Cc: "Rafael J. Wysocki" Signed-off-by: Greg Kroah-Hartman --- drivers/base/bus.c | 2 +- include/linux/device/bus.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/base/bus.c b/drivers/base/bus.c index dddbaa024583..daee55c9b2d9 100644 --- a/drivers/base/bus.c +++ b/drivers/base/bus.c @@ -1030,7 +1030,7 @@ static void device_insertion_sort_klist(struct device *a, struct list_head *list list_move_tail(&a->p->knode_bus.n_node, list); } -void bus_sort_breadthfirst(struct bus_type *bus, +void bus_sort_breadthfirst(const struct bus_type *bus, int (*compare)(const struct device *a, const struct device *b)) { diff --git a/include/linux/device/bus.h b/include/linux/device/bus.h index ae10c4322754..25127f750349 100644 --- a/include/linux/device/bus.h +++ b/include/linux/device/bus.h @@ -232,7 +232,7 @@ bus_find_device_by_acpi_dev(const struct bus_type *bus, const void *adev) int bus_for_each_drv(const struct bus_type *bus, struct device_driver *start, void *data, int (*fn)(struct device_driver *, void *)); -void bus_sort_breadthfirst(struct bus_type *bus, +void bus_sort_breadthfirst(const struct bus_type *bus, int (*compare)(const struct device *a, const struct device *b)); /*