Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp727816rbb; Sun, 25 Feb 2024 00:33:31 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUeGiq2ktkXrepfsxg+PEs1bvo0JDh0vxGW1dyze9GQmdua0DxEzjsPsC3hi2SYHKi4iAJ9Zp1tvUBeBmI9/02UbuFfZWB8FK0Jq9wEWA== X-Google-Smtp-Source: AGHT+IFGOtDxrrbINnHc3mOnRy7GhPn8TBYYL9YzJeae/XRtFMNZCZFR+BNI4IpaDX+0dg4NjbIJ X-Received: by 2002:a17:902:aa89:b0:1dc:1878:84e2 with SMTP id d9-20020a170902aa8900b001dc187884e2mr3688928plr.54.1708850011654; Sun, 25 Feb 2024 00:33:31 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708850011; cv=pass; d=google.com; s=arc-20160816; b=yFkWRm01C5YrClw4lE+RzOvaZ/J76K0Q1whAdglUh/0n9gQgUR2pV0F9QPc95BPSw9 XahmnKgvuRPCkb0rbFslIF1WJtw35E3Tad12qgyE96j2Icg6CazNQMsVbpW6eWe4oANH bKPMy6bapBqCyIGaUHFn0rMdr6zn2ElZm4C/43rz4ctzdovptqgvRXOSQHbOc3wicS9j ltVJFEERIxAn63F0RrsnzwONnhkzdwfv0ygc17fLZ8UqwTAOa6vIRv0GglyK4QwZEzp4 1sZciphECzwrL1cShWah0SxkgPf9cSRfqYrs76kxk9OFSjdjmQyDe6MiWXQVVFZXUu/a OZnQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=mo2ISPRsU9dScx3HsqRCu0VISEFxlzBDtdixyu+nTzk=; fh=Hpiz2dspsYgE+m5nk2S3rA268kaT8yXE2Hygea3yG0A=; b=X+595favjzAAmHzgNruWM/8CVS/VYLQy+n1418Of3cksJM5n3IWjrqSkSEoT7ttsgp sXAplAb/SXXFzgeMs6hqGcgLNsv3did9Df8hEndCA4Iy7DEpCnI4IPxedFcIs3mtnQUo PIMqCYHfMZCoU1iULJOyGudDcPhHNBNejDXjAMyS5qYNy8jE+fcsgCwV/gArUR3CkrQs 1mDfbxgWtHg6dhFSQtJZ8Z/3Ak93fjrOuwHEEGqyLUIFDfVZPEW4Y9SCmtqf4fdMIl+D pWFmOJP0kLQPt3ZyDBRLyKQahIkkFOHmAnLHkNg1ZsVUgkzEzG+IGEa70pgjfGfm1An4 dvUw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=SrwdVzOf; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-80014-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-80014-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id u17-20020a170902e5d100b001d91b6110c4si1899809plf.487.2024.02.25.00.33.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Feb 2024 00:33:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-80014-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=SrwdVzOf; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-80014-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-80014-linux.lists.archive=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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 3028828223B for ; Sun, 25 Feb 2024 08:33:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7192C8F6A; Sun, 25 Feb 2024 08:33:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="SrwdVzOf" 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 9DB6CDDC9 for ; Sun, 25 Feb 2024 08:33:25 +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=1708850005; cv=none; b=i5I+lvrkJmmek58gwRGklIg7DqrkOPeegs5RWdd0NCX+3AihRfiYDwbvZjUvqPVy72gbt9rSzfTIlPH2fVheGRxT9wZ/Vttm5oqU3Z2AWnluMjxU6XtSIV8QGND3OXEo//dTS89h0tT9RAbPtdJZCyHH5zb4sY/nKtkWnBIN0m8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708850005; c=relaxed/simple; bh=6hgAzKoh0X8Vc/PxuhnIWRzdvMEeWy6T9l/qi5QFODY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ApKyY9yZtFEpbDliFWP6QkOjnwkBlLtiwl4sjVI6ikizni3ot14aI9x23jA7ix9sQsAY6IWeLmahXK6PzFsTiYr2QVy8D0iGW3HKDDPVXNQZMMRpHJncirUK2YswFlB4wqneIc9b8vBpV/DK6aR20WZph3aQkFLV42TdkOcQsVE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=SrwdVzOf; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 13B3BC433F1; Sun, 25 Feb 2024 08:33:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1708850004; bh=6hgAzKoh0X8Vc/PxuhnIWRzdvMEeWy6T9l/qi5QFODY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=SrwdVzOfqd39q8MknfoPT1MJBqXSmE+Jqa3cvGdq571eBG8OqIpJ/+3NR2koZdB99 Kg0OLwXYXR2wUthYisXnjlweeu0+Ahb73Hp0iprI26+t3Nfnsy9if0y51jjm4vWfeh kgvJErhgUrN3nRiRrEMlCDHK3XW/c7ja6kpCX+HA= Date: Sun, 25 Feb 2024 09:33:22 +0100 From: Greg Kroah-Hartman To: "Ricardo B. Marliere" Cc: Alex Elder , Johan Hovold , Alex Elder , greybus-dev@lists.linaro.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] greybus: constify the struct device_type usage Message-ID: <2024022553-deepness-sublevel-73de@gregkh> References: <20240219-device_cleanup-greybus-v1-1-babb3f65e8cc@marliere.net> Precedence: bulk X-Mailing-List: linux-kernel@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: On Sat, Feb 24, 2024 at 05:22:39PM -0300, Ricardo B. Marliere wrote: > On 24 Feb 09:43, Alex Elder wrote: > > On 2/19/24 6:40 AM, Ricardo B. Marliere wrote: > > > Since commit aed65af1cc2f ("drivers: make device_type const"), the driver > > > core can properly handle constant struct device_type. Move the > > > greybus_hd_type, greybus_module_type, greybus_interface_type, > > > greybus_control_type, greybus_bundle_type and greybus_svc_type variables to > > > be constant structures as well, placing it into read-only memory which can > > > not be modified at runtime. > > > > > > Signed-off-by: Ricardo B. Marliere > > > > This looks good to me. Assuming it compiles cleanly: > > > > Reviewed-by: Alex Elder > > Hi Alex! > > Thanks for reviewing. > > > > > On another subject: > > > > Johan might disagree, but I think it would be nice to make > > the definitions of the Greybus device types as static (private) > > and make the is_gb_host_device() etc. functions real functions > > rather than static inlines in . > > > > It turns out that all of the is_gb_*() functions are called only > > from drivers/greybus/core.c; they could all be moved there rather > > than advertising them in . > > I guess it depends whether they would be used somewhere else in the > future. Perhaps it was left there with that intention when it was first > being developed? I agree, though. Will happily send a patch with this if > desired. Let's clean the code up for what we have today. If it's needed in the future, we can move the structures then. thanks, greg k-h