Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1370730ybi; Fri, 14 Jun 2019 13:33:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqyWK6lYfu5+/D/lfZLSHfSr2IP0pwv+jlfN9D3EfgjdnB4iElSuwC3w2NXkYPWFUMVckB1b X-Received: by 2002:a63:d512:: with SMTP id c18mr18958303pgg.397.1560544404934; Fri, 14 Jun 2019 13:33:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560544404; cv=none; d=google.com; s=arc-20160816; b=csiHk7bHUZ4RaMCRvmnlR7rZS51vYnn4iVdYtn6LfqKM+7i8Ym1z8xzjN+BAfJEA/F ljUf0lw/uj62S3mlerO3MYu6D0u/abtutUn11PJh9JuAB08SGlge5mZfKFuM0fLEqpd+ UP+phvVVR6EnTTseeTNzLxsnbB73810PgYMo1EMerW31EZ5oxNW5OhLqBBzPdDtXcJF5 s8LIiE1zAe/ss8ohH2DwctlBIY855P+wmbqzlRW/Fdhx4x89zcH/jBRnpnn5jiYHc/ik CMrCiB3Y61KFSV2VRoBnPa+dPzJuUKMqGmdp37Zy4GTIekXEBDX3J4Gu2szHKYVKPlGR TiuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=UYHcUsZn7IY4j3rhapZ7JulDiqvw+0TKjrmMtb6wcOc=; b=zoPukNz3P46lXhsMrZq91Ors30RRw8+78YKufv1PEz8EDgSwOx3FRRwEYsvAbmNWEg PNfog77yQQsBBX4E87oj36/L2GO6/6qBbfXjyaIQVKObbu9LSje7ts86NcQxVma8fmuX G2xwo2H25C7Ro6HS2/d8etfHkzcdCL+iDg57KKXa6kfMNsljd388EGgge+q1Yp8lJD+t LxYMz9zgWhqvTyaBbCroxrwXavOUHVRsXlvs5EpAp8lqYmpbb496wAHZFpHlNlRT/Ykd Ene8ziJ61EyBNuS1jjE158g96/4r+OW+9vMza5jzIfvd2GQ76KwH6/sPoKqx/cUE8W3W Ia4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="Sx81Q/xp"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h2si3221658plh.380.2019.06.14.13.33.10; Fri, 14 Jun 2019 13:33:24 -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=pass header.i=@kernel.org header.s=default header.b="Sx81Q/xp"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727944AbfFNUat (ORCPT + 99 others); Fri, 14 Jun 2019 16:30:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:54310 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727872AbfFNUap (ORCPT ); Fri, 14 Jun 2019 16:30:45 -0400 Received: from mail-qt1-f170.google.com (mail-qt1-f170.google.com [209.85.160.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 793E421897 for ; Fri, 14 Jun 2019 20:30:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1560544244; bh=mGWwuvYHtCOEdqUhryn/C5GcCwcG5zTHTlMA26N2pvo=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=Sx81Q/xpvwk4mFA/RoOKvG+QEjJIGN65Z2wayQOScvrbjGUaFxkkl/qN1cBp1Hbw5 0EcRu3IJwiI1KBX2GNsbwbJrCdyBiDNpGQutFZDd1WJkAxH2FCmhT+rlijUA7hEIHi U+0QReilDuUyHSZ87o9v3uWqeVFUgwti/gdDS1+k= Received: by mail-qt1-f170.google.com with SMTP id n11so4011464qtl.5 for ; Fri, 14 Jun 2019 13:30:44 -0700 (PDT) X-Gm-Message-State: APjAAAXly3OKvQFWmjFUcH78kEiBfzJoFfWVah4RSqde0NWDraEJU0DZ bQNR07HhqQHkvZUvyfVjrXLEVGPpx8yVd5SKsg== X-Received: by 2002:ac8:3908:: with SMTP id s8mr81739065qtb.224.1560544243650; Fri, 14 Jun 2019 13:30:43 -0700 (PDT) MIME-Version: 1.0 References: <1560534863-15115-1-git-send-email-suzuki.poulose@arm.com> <1560534863-15115-5-git-send-email-suzuki.poulose@arm.com> In-Reply-To: <1560534863-15115-5-git-send-email-suzuki.poulose@arm.com> From: Rob Herring Date: Fri, 14 Jun 2019 14:30:31 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 04/28] bus_find_device: Unify the match callback with class_find_device To: Suzuki K Poulose Cc: "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , "Rafael J. Wysocki" , Alexander Shishkin , Andrew Lunn , Andreas Noever , Arnd Bergmann , Bjorn Helgaas , Corey Minyard , Christian Borntraeger , David Kershner , "David S. Miller" , David Airlie , Felipe Balbi , Frank Rowand , Grygorii Strashko , Harald Freudenberger , Hartmut Knaack , Heiko Stuebner , Jason Gunthorpe , Jonathan Cameron , "James E.J. Bottomley" , Len Brown , Mark Brown , Michael Ellerman , Michael Jamet , "Martin K. Petersen" , Peter Oberparleiter , Sebastian Ott , Srinivas Kandagatla , Yehezkel Bernat , Wolfram Sang Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 14, 2019 at 11:54 AM Suzuki K Poulose wrote: > > There is an arbitrary difference between the prototypes of > bus_find_device() and class_find_device() preventing their callers > from passing the same pair of data and match() arguments to both of > them, which is the const qualifier used in the prototype of > class_find_device(). If that qualifier is also used in the > bus_find_device() prototype, it will be possible to pass the same > match() callback function to both bus_find_device() and > class_find_device(), which will allow some optimizations to be made in > order to avoid code duplication going forward. Also with that, constify > the "data" parameter as it is passed as a const to the match function. > > For this reason, change the prototype of bus_find_device() to match > the prototype of class_find_device() and adjust its callers to use the > const qualifier in accordance with the new prototype of it. > > Cc: Alexander Shishkin > Cc: Andrew Lunn > Cc: Andreas Noever > Cc: Arnd Bergmann > Cc: Bjorn Helgaas > Cc: Corey Minyard > Cc: Christian Borntraeger > Cc: David Kershner > Cc: "David S. Miller" > Cc: David Airlie > Cc: Felipe Balbi > Cc: Frank Rowand > Cc: Grygorii Strashko > Cc: Harald Freudenberger > Cc: Hartmut Knaack > Cc: Heiko Stuebner > Cc: Jason Gunthorpe > Cc: Jonathan Cameron > Cc: Jonathan Cameron > Cc: "James E.J. Bottomley" > Cc: Len Brown > Cc: Mark Brown > Cc: Michael Ellerman > Cc: Michael Jamet > Cc: "Martin K. Petersen" > Cc: Peter Oberparleiter > Cc: Rob Herring > Cc: Sebastian Ott > Cc: Srinivas Kandagatla > Cc: Yehezkel Bernat > Cc: Wolfram Sang > Cc: rafael@kernel.org > Cc: Greg Kroah-Hartman > Acked-by: Corey Minyard > Acked-by: David Kershner > Acked-by: Mark Brown > Acked-by: Rafael J. Wysocki > Acked-by: Srinivas Kandagatla > Signed-off-by: Suzuki K Poulose Acked-by: Rob Herring