lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <984ff1d6-b661-4fab-9943-44008d5ccf3c@ieee.org>
Date: Mon, 4 Mar 2024 11:52:52 -0600
From: Alex Elder <elder@...e.org>
To: "Ricardo B. Marliere" <ricardo@...liere.net>,
 Johan Hovold <johan@...nel.org>, Alex Elder <elder@...nel.org>,
 Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: greybus-dev@...ts.linaro.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] greybus: move is_gb_* functions out of greybus.h

On 2/26/24 3:05 PM, Ricardo B. Marliere wrote:
> The functions below are only used within the context of
> drivers/greybus/core.c, so move them all into core and drop their 'inline'
> specifiers:
> 
> is_gb_host_device(), is_gb_module(), is_gb_interface(), is_gb_control(),
> is_gb_bundle() and is_gb_svc().
> 
> Suggested-by: Alex Elder <elder@...e.org>
> Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
> Signed-off-by: Ricardo B. Marliere <ricardo@...liere.net>

Looks good to me.

Reviewed-by: Alex Elder <elder@...aro.org>

> ---
>   drivers/greybus/core.c  | 30 ++++++++++++++++++++++++++++++
>   include/linux/greybus.h | 30 ------------------------------
>   2 files changed, 30 insertions(+), 30 deletions(-)
> 
> diff --git a/drivers/greybus/core.c b/drivers/greybus/core.c
> index 5714be740470..f660b213233d 100644
> --- a/drivers/greybus/core.c
> +++ b/drivers/greybus/core.c
> @@ -27,6 +27,36 @@ int greybus_disabled(void)
>   }
>   EXPORT_SYMBOL_GPL(greybus_disabled);
>   
> +static int is_gb_host_device(const struct device *dev)
> +{
> +	return dev->type == &greybus_hd_type;
> +}
> +
> +static int is_gb_module(const struct device *dev)
> +{
> +	return dev->type == &greybus_module_type;
> +}
> +
> +static int is_gb_interface(const struct device *dev)
> +{
> +	return dev->type == &greybus_interface_type;
> +}
> +
> +static int is_gb_control(const struct device *dev)
> +{
> +	return dev->type == &greybus_control_type;
> +}
> +
> +static int is_gb_bundle(const struct device *dev)
> +{
> +	return dev->type == &greybus_bundle_type;
> +}
> +
> +static int is_gb_svc(const struct device *dev)
> +{
> +	return dev->type == &greybus_svc_type;
> +}
> +
>   static bool greybus_match_one_id(struct gb_bundle *bundle,
>   				 const struct greybus_bundle_id *id)
>   {
> diff --git a/include/linux/greybus.h b/include/linux/greybus.h
> index 18c0fb958b74..38c45ec7d099 100644
> --- a/include/linux/greybus.h
> +++ b/include/linux/greybus.h
> @@ -113,36 +113,6 @@ extern struct device_type greybus_control_type;
>   extern struct device_type greybus_bundle_type;
>   extern struct device_type greybus_svc_type;
>   
> -static inline int is_gb_host_device(const struct device *dev)
> -{
> -	return dev->type == &greybus_hd_type;
> -}
> -
> -static inline int is_gb_module(const struct device *dev)
> -{
> -	return dev->type == &greybus_module_type;
> -}
> -
> -static inline int is_gb_interface(const struct device *dev)
> -{
> -	return dev->type == &greybus_interface_type;
> -}
> -
> -static inline int is_gb_control(const struct device *dev)
> -{
> -	return dev->type == &greybus_control_type;
> -}
> -
> -static inline int is_gb_bundle(const struct device *dev)
> -{
> -	return dev->type == &greybus_bundle_type;
> -}
> -
> -static inline int is_gb_svc(const struct device *dev)
> -{
> -	return dev->type == &greybus_svc_type;
> -}
> -
>   static inline bool cport_id_valid(struct gb_host_device *hd, u16 cport_id)
>   {
>   	return cport_id != CPORT_ID_BAD && cport_id < hd->num_cports;
> 
> ---
> base-commit: 70ff1fe626a166dcaadb5a81bfe75e22c91f5dbf
> change-id: 20240226-device_cleanup-greybus2-b763f50221ab
> 
> Best regards,


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ