From mboxrd@z Thu Jan 1 00:00:00 1970 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 D168013AA2E; Tue, 13 Aug 2024 09:45:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723542349; cv=none; b=Sr1vO233UvUnTLC3XEdK54Wd3BCXEEWnHBpaBC6WcLfRLpE2HBE4xh0oQMuhnviUy60+0n533txWUtVzt/oebGTJbbqArfrp17ddfbggFU7e1MYehqP6RBKCiHbpitqhFwlMV1FgYWk/HQGH2zTo7WIek999Ec4x3eLope/cvLU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723542349; c=relaxed/simple; bh=dr505emU6fLKiiCedG7OK03aaqdZZc69vWq72dXDH44=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=PdUSvg2r5IUOmWYnijAAZSPwUxFEuh02iChwreZbb/7NifBuJgDk4q73KiXh0lET47q0sbe4u/tUo1EeriiSWpl2GjoXMnuV+tIyoNLAHHHHRs30zfTERfmiJaE02uDb3x5rBLTrw4RVoj3Qeuu1Q5s4/cOu/KTOSVtOizlivpc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=x40ehJjg; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="x40ehJjg" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B0343C4AF0B; Tue, 13 Aug 2024 09:45:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1723542349; bh=dr505emU6fLKiiCedG7OK03aaqdZZc69vWq72dXDH44=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=x40ehJjgu9UfDoqGkEtY9q/RLv4J61FbjRspEZDI9YV5/utHT7lbsmPuaGdvS6f6j /fIM2HSrAO9NVcrxadGa1PBEBM+VDWQrglcCWPpxMCXqI6jGe+SuIfLVjZDglqX4p7 +uzyeqIsVvborBa3U8LWD+T1Yli0if9AyA6RS+Nw= Date: Tue, 13 Aug 2024 11:45:46 +0200 From: Greg Kroah-Hartman To: Zijun Hu Cc: "Rafael J. Wysocki" , Davidlohr Bueso , Jonathan Cameron , Dave Jiang , Alison Schofield , Vishal Verma , Ira Weiny , Dan Williams , Takashi Sakamoto , Timur Tabi , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-kernel@vger.kernel.org, linux-cxl@vger.kernel.org, linux1394-devel@lists.sourceforge.net, netdev@vger.kernel.org, Zijun Hu Subject: Re: [PATCH 2/5] driver core: Introduce an API constify_device_find_child_helper() Message-ID: <2024081314-marbling-clasp-442a@gregkh> References: <20240811-const_dfc_prepare-v1-0-d67cc416b3d3@quicinc.com> <20240811-const_dfc_prepare-v1-2-d67cc416b3d3@quicinc.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240811-const_dfc_prepare-v1-2-d67cc416b3d3@quicinc.com> On Sun, Aug 11, 2024 at 08:18:08AM +0800, Zijun Hu wrote: > From: Zijun Hu > > Introduce constify_device_find_child_helper() to replace existing > device_find_child()'s usages whose match functions will modify > caller's match data. Ick, that's not a good name, it should be "noun_verb" with the subsystem being on the prefix always. But why is this even needed? Device pointers are NOT const for the obvious reason that they can be changed by loads of different things. Trying to force them to be const is going to be hard, if not impossible. thanks, greg k-h