Message ID | 20230313182918.1312597-32-gregkh@linuxfoundation.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp1356297wrd; Mon, 13 Mar 2023 12:08:17 -0700 (PDT) X-Google-Smtp-Source: AK7set+XKSMVF1g0EcN0jMd74E2GPWd1X/zZRL93dIRg7O2KY3dx0vhwD6HKaSDHYsDyfoOvMkgF X-Received: by 2002:a17:90a:310:b0:237:9fbd:31c8 with SMTP id 16-20020a17090a031000b002379fbd31c8mr36195138pje.15.1678734497466; Mon, 13 Mar 2023 12:08:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678734497; cv=none; d=google.com; s=arc-20160816; b=NR2cJlTZiUEGFHoGQrtb24St606sDTxsSI3Sz+dMLxbU4WXNu+BSdztvh9Qfktn/Aw iQFesQSAPH5df6cRLhgPIV8afENSmgVt0bE53vMeiAjV9Ro3262DIDaG7g7bmrAa8yYY 11EOrcU3SFee2JopL5pfVKYqNriZ+LliX0tG1glbPNnvi5K+vOUATl2WkoEGL2nNrlT2 bfSjpMbbn1Z8vR9bAMdGOO82bY21dGdIT+BWWZ2Df1krvCZHsvWh92BaMnDAqsP/fsRt JORJ33m0pdITGBF9sAg0E91A3pJQZ58zOyJw6vExGAg0AKQ/frmzZuS0x32eIGSlyNXG jXKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=nR8gdlA0yZfAbwQrHTsFCTmyhXF2kRyaBpFWAsQfow0=; b=nwhP/0O4AeGrAq3ZXvcqC8kX2LJ1YaujUcP0mZ4wQ5rH9ggM+Xb0orDHJ8bd8jyYJG HOfp+o+UyUr7qHCgtTyPXGuPyitBBI6VKnH7r4uh3PKBsL0SSTpCuzE3KuDMZ5SyESCm NDCwQBETNLZUV8ZWaawMWN7yNQ5wCB6ncjD6S+K+TaXf69bQQlfX1tzCDvRgwKWvIK/N I1WA4lo+e7ajNHxp1gIFemhLx1ll8hkceGF0NtQrx2Sql9n8SuOc+zi7ONJi8CaObboD 3YxiCO4oRAsKQf/Ze3D5LERe/e8lKTTPna6mb6ejPEju0/kg7woy2ehBNsK723EokaU6 fDQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JZuW8D0A; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m68-20020a632647000000b005089640a405si171121pgm.752.2023.03.13.12.08.04; Mon, 13 Mar 2023 12:08:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JZuW8D0A; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231467AbjCMSh7 (ORCPT <rfc822;realc9580@gmail.com> + 99 others); Mon, 13 Mar 2023 14:37:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231405AbjCMShp (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 13 Mar 2023 14:37:45 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F910222D7; Mon, 13 Mar 2023 11:36:48 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0E54C61464; Mon, 13 Mar 2023 18:30:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2405FC433EF; Mon, 13 Mar 2023 18:30:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1678732225; bh=/YljSSK5bkf0A5p++gDOQhTrbvu0meKM3gc6Wqmpcik=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JZuW8D0A6kYVqF6udIwRPFUbDNKarWp+aG9MdmZAfzvfwL091bU1pRVD06iPU9yQi 69T46Gdn3EtJ1MbLsLah0P0CImxbvPkAnq4/WJz2qjfGZpM/Az5Srox+oono4i3H1L KmNOk7uMQNXhIE3GwY9xte0Bf17QPPPE595IrL1E= From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> To: linux-kernel@vger.kernel.org Cc: rafael@kernel.org, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Fenghua Yu <fenghua.yu@intel.com>, Dave Jiang <dave.jiang@intel.com>, Vinod Koul <vkoul@kernel.org>, dmaengine@vger.kernel.org Subject: [PATCH 32/36] dmaengine: idxd: use const struct bus_type * Date: Mon, 13 Mar 2023 19:29:14 +0100 Message-Id: <20230313182918.1312597-32-gregkh@linuxfoundation.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230313182918.1312597-1-gregkh@linuxfoundation.org> References: <20230313182918.1312597-1-gregkh@linuxfoundation.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1736; i=gregkh@linuxfoundation.org; h=from:subject; bh=/YljSSK5bkf0A5p++gDOQhTrbvu0meKM3gc6Wqmpcik=; b=owGbwMvMwCRo6H6F97bub03G02pJDCn82TX6kZ/vWz5Tste57XYkInulvW3Dsd+vJbdo3OIIn n2O58rajlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZiIaBHD/MAFhiy3Q9NCqiem r3q4bjJbgra+CcM8JY6ke5Pcy60cy4N917PKMUi/nqYGAA== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760280704399548831?= X-GMAIL-MSGID: =?utf-8?q?1760280704399548831?= |
Series |
[01/36] EDAC/sysfs: move to use bus_get_dev_root()
|
|
Commit Message
Greg KH
March 13, 2023, 6:29 p.m. UTC
In the functions unbind_store() and bind_store(), a struct bus_type *
should be a const one, as the driver core bus functions used by this
variable are expecting the pointer to be constant, and these functions
do not modify the pointer at all.
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Dave Jiang <dave.jiang@intel.com>
Cc: Vinod Koul <vkoul@kernel.org>
Cc: dmaengine@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
Note, this is a patch that is a prepatory cleanup as part of a larger
series of patches that is working on resolving some old driver core
design mistakes. It will build and apply cleanly on top of 6.3-rc2 on
its own, but I'd prefer if I could take it through my driver-core tree
so that the driver core changes can be taken through there for 6.4-rc1.
drivers/dma/idxd/compat.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Comments
Hi, Greg, On 3/13/23 11:29, Greg Kroah-Hartman wrote: > In the functions unbind_store() and bind_store(), a struct bus_type * > should be a const one, as the driver core bus functions used by this > variable are expecting the pointer to be constant, and these functions > do not modify the pointer at all. > > Cc: Fenghua Yu <fenghua.yu@intel.com> > Cc: Dave Jiang <dave.jiang@intel.com> > Cc: Vinod Koul <vkoul@kernel.org> > Cc: dmaengine@vger.kernel.org > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> > --- > Note, this is a patch that is a prepatory cleanup as part of a larger > series of patches that is working on resolving some old driver core > design mistakes. It will build and apply cleanly on top of 6.3-rc2 on > its own, but I'd prefer if I could take it through my driver-core tree > so that the driver core changes can be taken through there for 6.4-rc1. > > drivers/dma/idxd/compat.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/dma/idxd/compat.c b/drivers/dma/idxd/compat.c > index 3df21615f888..5fd38d1b9d28 100644 > --- a/drivers/dma/idxd/compat.c > +++ b/drivers/dma/idxd/compat.c > @@ -16,7 +16,7 @@ extern void device_driver_detach(struct device *dev); > > static ssize_t unbind_store(struct device_driver *drv, const char *buf, size_t count) > { > - struct bus_type *bus = drv->bus; > + const struct bus_type *bus = drv->bus; > struct device *dev; > int rc = -ENODEV; > > @@ -32,7 +32,7 @@ static DRIVER_ATTR_IGNORE_LOCKDEP(unbind, 0200, NULL, unbind_store); > > static ssize_t bind_store(struct device_driver *drv, const char *buf, size_t count) > { > - struct bus_type *bus = drv->bus; > + const struct bus_type *bus = drv->bus; > struct device *dev; > struct device_driver *alt_drv = NULL; > int rc = -ENODEV; After applying this patch, warning is reported: drivers/dma/idxd/compat.c: In function ‘bind_store’: drivers/dma/idxd/compat.c:47:47: warning: passing argument 2 of ‘driver_find’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] 47 | alt_drv = driver_find("idxd", bus); | ^~~ In file included from ./include/linux/device.h:32, from drivers/dma/idxd/compat.c:6: ./include/linux/device/driver.h:129:59: note: expected ‘struct bus_type *’ but argument is of type ‘const struct bus_type *’ 129 | struct bus_type *bus); | ~~~~~~~~~~~~~~~~~^~~ Should the "bus" parameter in driver_find() definition be changed to const as well to avoid the warning? Thanks. -Fenghua
On Mon, Mar 13, 2023 at 12:07:27PM -0700, Fenghua Yu wrote: > Hi, Greg, > > On 3/13/23 11:29, Greg Kroah-Hartman wrote: > > In the functions unbind_store() and bind_store(), a struct bus_type * > > should be a const one, as the driver core bus functions used by this > > variable are expecting the pointer to be constant, and these functions > > do not modify the pointer at all. > > > > Cc: Fenghua Yu <fenghua.yu@intel.com> > > Cc: Dave Jiang <dave.jiang@intel.com> > > Cc: Vinod Koul <vkoul@kernel.org> > > Cc: dmaengine@vger.kernel.org > > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> > > --- > > Note, this is a patch that is a prepatory cleanup as part of a larger > > series of patches that is working on resolving some old driver core > > design mistakes. It will build and apply cleanly on top of 6.3-rc2 on > > its own, but I'd prefer if I could take it through my driver-core tree > > so that the driver core changes can be taken through there for 6.4-rc1. > > > > drivers/dma/idxd/compat.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/dma/idxd/compat.c b/drivers/dma/idxd/compat.c > > index 3df21615f888..5fd38d1b9d28 100644 > > --- a/drivers/dma/idxd/compat.c > > +++ b/drivers/dma/idxd/compat.c > > @@ -16,7 +16,7 @@ extern void device_driver_detach(struct device *dev); > > static ssize_t unbind_store(struct device_driver *drv, const char *buf, size_t count) > > { > > - struct bus_type *bus = drv->bus; > > + const struct bus_type *bus = drv->bus; > > struct device *dev; > > int rc = -ENODEV; > > @@ -32,7 +32,7 @@ static DRIVER_ATTR_IGNORE_LOCKDEP(unbind, 0200, NULL, unbind_store); > > static ssize_t bind_store(struct device_driver *drv, const char *buf, size_t count) > > { > > - struct bus_type *bus = drv->bus; > > + const struct bus_type *bus = drv->bus; > > struct device *dev; > > struct device_driver *alt_drv = NULL; > > int rc = -ENODEV; > > After applying this patch, warning is reported: > > drivers/dma/idxd/compat.c: In function ‘bind_store’: > drivers/dma/idxd/compat.c:47:47: warning: passing argument 2 of > ‘driver_find’ discards ‘const’ qualifier from pointer target type > [-Wdiscarded-qualifiers] > 47 | alt_drv = driver_find("idxd", bus); > | ^~~ > In file included from ./include/linux/device.h:32, > from drivers/dma/idxd/compat.c:6: > ./include/linux/device/driver.h:129:59: note: expected ‘struct bus_type *’ > but argument is of type ‘const struct bus_type *’ > 129 | struct bus_type *bus); > | ~~~~~~~~~~~~~~~~~^~~ > > Should the "bus" parameter in driver_find() definition be changed to const > as well to avoid the warning? Oops, yes, it needs an earlier patch in this series, sorry, I didn't call that out properly in the notes section of the patch. So I can just take this through my tree if that's ok. thanks, greg k-h
Hi, Greg, On 3/16/23 03:16, Greg Kroah-Hartman wrote: > On Mon, Mar 13, 2023 at 12:07:27PM -0700, Fenghua Yu wrote: >> Hi, Greg, >> >> On 3/13/23 11:29, Greg Kroah-Hartman wrote: >>> In the functions unbind_store() and bind_store(), a struct bus_type * >>> should be a const one, as the driver core bus functions used by this >>> variable are expecting the pointer to be constant, and these functions >>> do not modify the pointer at all. >>> >>> Cc: Fenghua Yu <fenghua.yu@intel.com> >>> Cc: Dave Jiang <dave.jiang@intel.com> >>> Cc: Vinod Koul <vkoul@kernel.org> >>> Cc: dmaengine@vger.kernel.org >>> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> >>> --- >>> Note, this is a patch that is a prepatory cleanup as part of a larger >>> series of patches that is working on resolving some old driver core >>> design mistakes. It will build and apply cleanly on top of 6.3-rc2 on >>> its own, but I'd prefer if I could take it through my driver-core tree >>> so that the driver core changes can be taken through there for 6.4-rc1. >>> >>> drivers/dma/idxd/compat.c | 4 ++-- >>> 1 file changed, 2 insertions(+), 2 deletions(-) >>> >>> diff --git a/drivers/dma/idxd/compat.c b/drivers/dma/idxd/compat.c >>> index 3df21615f888..5fd38d1b9d28 100644 >>> --- a/drivers/dma/idxd/compat.c >>> +++ b/drivers/dma/idxd/compat.c >>> @@ -16,7 +16,7 @@ extern void device_driver_detach(struct device *dev); >>> static ssize_t unbind_store(struct device_driver *drv, const char *buf, size_t count) >>> { >>> - struct bus_type *bus = drv->bus; >>> + const struct bus_type *bus = drv->bus; >>> struct device *dev; >>> int rc = -ENODEV; >>> @@ -32,7 +32,7 @@ static DRIVER_ATTR_IGNORE_LOCKDEP(unbind, 0200, NULL, unbind_store); >>> static ssize_t bind_store(struct device_driver *drv, const char *buf, size_t count) >>> { >>> - struct bus_type *bus = drv->bus; >>> + const struct bus_type *bus = drv->bus; >>> struct device *dev; >>> struct device_driver *alt_drv = NULL; >>> int rc = -ENODEV; >> >> After applying this patch, warning is reported: >> >> drivers/dma/idxd/compat.c: In function ‘bind_store’: >> drivers/dma/idxd/compat.c:47:47: warning: passing argument 2 of >> ‘driver_find’ discards ‘const’ qualifier from pointer target type >> [-Wdiscarded-qualifiers] >> 47 | alt_drv = driver_find("idxd", bus); >> | ^~~ >> In file included from ./include/linux/device.h:32, >> from drivers/dma/idxd/compat.c:6: >> ./include/linux/device/driver.h:129:59: note: expected ‘struct bus_type *’ >> but argument is of type ‘const struct bus_type *’ >> 129 | struct bus_type *bus); >> | ~~~~~~~~~~~~~~~~~^~~ >> >> Should the "bus" parameter in driver_find() definition be changed to const >> as well to avoid the warning? > > Oops, yes, it needs an earlier patch in this series, sorry, I didn't > call that out properly in the notes section of the patch. > > So I can just take this through my tree if that's ok. Sure. Acked-by: Fenghua Yu <fenghua.yu@intel.com> Thanks. -Fenghua
On 13-03-23, 19:29, Greg Kroah-Hartman wrote: > In the functions unbind_store() and bind_store(), a struct bus_type * > should be a const one, as the driver core bus functions used by this > variable are expecting the pointer to be constant, and these functions > do not modify the pointer at all. Acked-by: Vinod Koul <vkoul@kernel.org>
On 3/13/23 11:29 AM, Greg Kroah-Hartman wrote: > In the functions unbind_store() and bind_store(), a struct bus_type * > should be a const one, as the driver core bus functions used by this > variable are expecting the pointer to be constant, and these functions > do not modify the pointer at all. > > Cc: Fenghua Yu <fenghua.yu@intel.com> > Cc: Dave Jiang <dave.jiang@intel.com> > Cc: Vinod Koul <vkoul@kernel.org> > Cc: dmaengine@vger.kernel.org > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Acked-by: Dave Jiang <dave.jiang@intel.com> > --- > Note, this is a patch that is a prepatory cleanup as part of a larger > series of patches that is working on resolving some old driver core > design mistakes. It will build and apply cleanly on top of 6.3-rc2 on > its own, but I'd prefer if I could take it through my driver-core tree > so that the driver core changes can be taken through there for 6.4-rc1. > > drivers/dma/idxd/compat.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/dma/idxd/compat.c b/drivers/dma/idxd/compat.c > index 3df21615f888..5fd38d1b9d28 100644 > --- a/drivers/dma/idxd/compat.c > +++ b/drivers/dma/idxd/compat.c > @@ -16,7 +16,7 @@ extern void device_driver_detach(struct device *dev); > > static ssize_t unbind_store(struct device_driver *drv, const char *buf, size_t count) > { > - struct bus_type *bus = drv->bus; > + const struct bus_type *bus = drv->bus; > struct device *dev; > int rc = -ENODEV; > > @@ -32,7 +32,7 @@ static DRIVER_ATTR_IGNORE_LOCKDEP(unbind, 0200, NULL, unbind_store); > > static ssize_t bind_store(struct device_driver *drv, const char *buf, size_t count) > { > - struct bus_type *bus = drv->bus; > + const struct bus_type *bus = drv->bus; > struct device *dev; > struct device_driver *alt_drv = NULL; > int rc = -ENODEV;
On Thu, Mar 16, 2023 at 04:57:54PM -0700, Fenghua Yu wrote: > Hi, Greg, > > On 3/16/23 03:16, Greg Kroah-Hartman wrote: > > On Mon, Mar 13, 2023 at 12:07:27PM -0700, Fenghua Yu wrote: > > > Hi, Greg, > > > > > > On 3/13/23 11:29, Greg Kroah-Hartman wrote: > > > > In the functions unbind_store() and bind_store(), a struct bus_type * > > > > should be a const one, as the driver core bus functions used by this > > > > variable are expecting the pointer to be constant, and these functions > > > > do not modify the pointer at all. > > > > > > > > Cc: Fenghua Yu <fenghua.yu@intel.com> > > > > Cc: Dave Jiang <dave.jiang@intel.com> > > > > Cc: Vinod Koul <vkoul@kernel.org> > > > > Cc: dmaengine@vger.kernel.org > > > > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> > > > > --- > > > > Note, this is a patch that is a prepatory cleanup as part of a larger > > > > series of patches that is working on resolving some old driver core > > > > design mistakes. It will build and apply cleanly on top of 6.3-rc2 on > > > > its own, but I'd prefer if I could take it through my driver-core tree > > > > so that the driver core changes can be taken through there for 6.4-rc1. > > > > > > > > drivers/dma/idxd/compat.c | 4 ++-- > > > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > > > > > diff --git a/drivers/dma/idxd/compat.c b/drivers/dma/idxd/compat.c > > > > index 3df21615f888..5fd38d1b9d28 100644 > > > > --- a/drivers/dma/idxd/compat.c > > > > +++ b/drivers/dma/idxd/compat.c > > > > @@ -16,7 +16,7 @@ extern void device_driver_detach(struct device *dev); > > > > static ssize_t unbind_store(struct device_driver *drv, const char *buf, size_t count) > > > > { > > > > - struct bus_type *bus = drv->bus; > > > > + const struct bus_type *bus = drv->bus; > > > > struct device *dev; > > > > int rc = -ENODEV; > > > > @@ -32,7 +32,7 @@ static DRIVER_ATTR_IGNORE_LOCKDEP(unbind, 0200, NULL, unbind_store); > > > > static ssize_t bind_store(struct device_driver *drv, const char *buf, size_t count) > > > > { > > > > - struct bus_type *bus = drv->bus; > > > > + const struct bus_type *bus = drv->bus; > > > > struct device *dev; > > > > struct device_driver *alt_drv = NULL; > > > > int rc = -ENODEV; > > > > > > After applying this patch, warning is reported: > > > > > > drivers/dma/idxd/compat.c: In function ‘bind_store’: > > > drivers/dma/idxd/compat.c:47:47: warning: passing argument 2 of > > > ‘driver_find’ discards ‘const’ qualifier from pointer target type > > > [-Wdiscarded-qualifiers] > > > 47 | alt_drv = driver_find("idxd", bus); > > > | ^~~ > > > In file included from ./include/linux/device.h:32, > > > from drivers/dma/idxd/compat.c:6: > > > ./include/linux/device/driver.h:129:59: note: expected ‘struct bus_type *’ > > > but argument is of type ‘const struct bus_type *’ > > > 129 | struct bus_type *bus); > > > | ~~~~~~~~~~~~~~~~~^~~ > > > > > > Should the "bus" parameter in driver_find() definition be changed to const > > > as well to avoid the warning? > > > > Oops, yes, it needs an earlier patch in this series, sorry, I didn't > > call that out properly in the notes section of the patch. > > > > So I can just take this through my tree if that's ok. > > Sure. > > Acked-by: Fenghua Yu <fenghua.yu@intel.com> Great, thanks for this, I've now queued up the series in my tree. greg k-h
diff --git a/drivers/dma/idxd/compat.c b/drivers/dma/idxd/compat.c index 3df21615f888..5fd38d1b9d28 100644 --- a/drivers/dma/idxd/compat.c +++ b/drivers/dma/idxd/compat.c @@ -16,7 +16,7 @@ extern void device_driver_detach(struct device *dev); static ssize_t unbind_store(struct device_driver *drv, const char *buf, size_t count) { - struct bus_type *bus = drv->bus; + const struct bus_type *bus = drv->bus; struct device *dev; int rc = -ENODEV; @@ -32,7 +32,7 @@ static DRIVER_ATTR_IGNORE_LOCKDEP(unbind, 0200, NULL, unbind_store); static ssize_t bind_store(struct device_driver *drv, const char *buf, size_t count) { - struct bus_type *bus = drv->bus; + const struct bus_type *bus = drv->bus; struct device *dev; struct device_driver *alt_drv = NULL; int rc = -ENODEV;