From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) (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 1859E1F427E; Tue, 3 Dec 2024 14:07:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.69.126.157 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733234883; cv=none; b=C+f64HY3PmDEcway7F4Ow/a9HNBcn7G0l8bbB3UIqPWZ/N0zlP7uDmT/rKFBHtcYNHTKpZcxrn0c46GZcp3hQZ3QYfUx7lGqA12WgQneV+RwzealkcIvPOs9YRoZeCF7iNCZBEw6dtylFkJPytVo+Zhe3PiQiQs8C+jr1kFuBkY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733234883; c=relaxed/simple; bh=fHTskvsLjld8Oq3wof1WoW/ro1iLNuhMDVshgcSrpsQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=FaQofOoCigMRMKDsMAcTtZnSKYAnF9JdmD9LKSwjdD9iTopG88TjPRnGkTesBUyzWCTZM8JXNob0bMFp4HCxS2pc2zSY1vHi6LdhYRy3HTafthKOStozkpByTpSLcY+q9QsqCexNn3jCW4O80KwEDG0wtGQ0bz8cVhacy2wOc6Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=t-8ch.de; spf=pass smtp.mailfrom=t-8ch.de; dkim=pass (1024-bit key) header.d=t-8ch.de header.i=@t-8ch.de header.b=L1SEFC6C; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=t-8ch.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=t-8ch.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=t-8ch.de header.i=@t-8ch.de header.b="L1SEFC6C" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=t-8ch.de; s=mail; t=1733234875; bh=fHTskvsLjld8Oq3wof1WoW/ro1iLNuhMDVshgcSrpsQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=L1SEFC6CwLYUTcqqqze527r7IWIE4XsyoMQ1CGzSu2Lo7wpen1OO065Nb6zA+snIr s3/fB4myqry70R09PnBsloM8UYaMMYtq2RVACVaLKZRaHFcnQ6Cg6M23NYb/aG/4oS rGquyCmF69KPSlVFe8JS1cvEe5EsWFKP+TSwl24Y= Date: Tue, 3 Dec 2024 15:07:55 +0100 From: Thomas =?utf-8?Q?Wei=C3=9Fschuh?= To: James Bottomley Cc: Zijun Hu , Greg Kroah-Hartman , Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= , "Rafael J. Wysocki" , Chun-Kuang Hu , Philipp Zabel , David Airlie , Simona Vetter , Matthias Brugger , AngeloGioacchino Del Regno , Jean Delvare , Guenter Roeck , Martin Tuma , Mauro Carvalho Chehab , Andreas Noever , Michael Jamet , Mika Westerberg , Yehezkel Bernat , Linus Walleij , Bartosz Golaszewski , Andrew Lunn , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Dan Williams , Vishal Verma , Dave Jiang , Ira Weiny , Takashi Sakamoto , Jiri Slaby , Heikki Krogerus , Srinivas Kandagatla , Lee Duncan , Chris Leech , Mike Christie , "Martin K. Petersen" , Nilesh Javali , Manish Rangankar , GR-QLogic-Storage-Upstream@marvell.com, Davidlohr Bueso , Jonathan Cameron , Alison Schofield , Andreas Larsson , Stuart Yoder , Laurentiu Tudor , Jens Axboe , Sudeep Holla , Cristian Marussi , Ard Biesheuvel , Bjorn Andersson , Mathieu Poirier , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-hwmon@vger.kernel.org, linux-media@vger.kernel.org, linux-usb@vger.kernel.org, linux-gpio@vger.kernel.org, netdev@vger.kernel.org, linux-pwm@vger.kernel.org, nvdimm@lists.linux.dev, linux1394-devel@lists.sourceforge.net, linux-serial@vger.kernel.org, linux-sound@vger.kernel.org, open-iscsi@googlegroups.com, linux-scsi@vger.kernel.org, linux-cxl@vger.kernel.org, sparclinux@vger.kernel.org, linux-block@vger.kernel.org, arm-scmi@vger.kernel.org, linux-efi@vger.kernel.org, linux-remoteproc@vger.kernel.org, Zijun Hu Subject: Re: [PATCH v2 00/32] driver core: Constify API device_find_child() and adapt for various existing usages Message-ID: <8fb887a0-3634-4e07-9f0d-d8d7c72ca802@t-8ch.de> References: <20241203-const_dfc_done-v2-0-7436a98c497f@quicinc.com> <9d34bd6f-b120-428a-837b-5a5813e14618@icloud.com> <2024120320-manual-jockey-dfd1@gregkh> <8eb7c0c54b280b8eb72f82032ede802c001ab087.camel@HansenPartnership.com> Precedence: bulk X-Mailing-List: linux-remoteproc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <8eb7c0c54b280b8eb72f82032ede802c001ab087.camel@HansenPartnership.com> On 2024-12-03 08:58:26-0500, James Bottomley wrote: > On Tue, 2024-12-03 at 21:02 +0800, Zijun Hu wrote: > > On 2024/12/3 20:41, Greg Kroah-Hartman wrote: > > > On Tue, Dec 03, 2024 at 08:23:45PM +0800, Zijun Hu wrote: > [...] > > > > or squash such patch series into a single patch ? > > > > > > > > various subsystem maintainers may not like squashing way. > > > > > > Agreed, so look into either doing it in a bisectable way if at all > > > possible.  As I don't see a full series here, I can't suggest how > > > it needs to happen :( > > > > > > > let me send you a full series later and discuss how to solve this > > issue. > > It's only slightly more complex than what we normally do: modify all > instances and then change the API. In this case you have an additional > problem because the prototype "const void *" will cause a mismatch if a > function has "void *". The easiest way to solve this is probably to > make device_find_child a macro that coerces its function argument to > having a non const "void *" and then passes off to the real function. > If you do that in the first patch, then you can constify all the > consumers and finally remove the macro coercion in the last patch. Casting function pointers like that should be detected and trapped by control flow integrity checking (KCFI). Another possibility would be to use a macro and _Generic to dispatch to two different backing functions. See __BIN_ATTR() in include/linux/sysfs.h for an inspiration. This also enables an incremental migration. Thomas