RE: [PATCH rdma-next 1/6] IB/umad: Define and use macro for infiniband_mad class name

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> Subject: [PATCH rdma-next 1/6] IB/umad: Define and use macro for
> infiniband_mad class name
> 
> From: Parav Pandit <parav@xxxxxxxxxxxx>
> 
> Define a class name macro for infiniband_mad class and use it in procedure
> calls (replacing the explicit string argument).
> 
> Signed-off-by: Parav Pandit <parav@xxxxxxxxxxxx>
> Reviewed-by: Jack Morgenstein <jackm@xxxxxxxxxxxxxxxxxx>
> Signed-off-by: Leon Romanovsky <leonro@xxxxxxxxxxxx>
> ---
>  drivers/infiniband/core/user_mad.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/infiniband/core/user_mad.c
> b/drivers/infiniband/core/user_mad.c
> index f55f48f6b272..6ca5b517a944 100644
> --- a/drivers/infiniband/core/user_mad.c
> +++ b/drivers/infiniband/core/user_mad.c
> @@ -61,6 +61,8 @@ MODULE_AUTHOR("Roland Dreier");
> MODULE_DESCRIPTION("InfiniBand userspace MAD packet access");
> MODULE_LICENSE("Dual BSD/GPL");
> 
> +#define IB_UMAD_CLASS_NAME "infiniband_mad"

I think "IB_UMAD_CLASS_NAME" is going to be confusing here because this implies you are referring to some management class.  How about IB_UMAD_SYSFS_CLASS_NAME?  I know it is long but when I first saw this I immediately was trying to figure out what management class this was referring to...

Generally good idea though.

Reviewed-by: Ira Weiny <ira.weiny@xxxxxxxxx>

Sorry,
Ira


> +
>  enum {
>  	IB_UMAD_MAX_PORTS  = RDMA_MAX_PORTS,
>  	IB_UMAD_MAX_AGENTS = 32,
> @@ -1338,7 +1340,7 @@ static int __init ib_umad_init(void)
> 
>  	ret = register_chrdev_region(base_umad_dev,
>  				     IB_UMAD_NUM_FIXED_MINOR * 2,
> -				     "infiniband_mad");
> +				     IB_UMAD_CLASS_NAME);
>  	if (ret) {
>  		pr_err("couldn't register device number\n");
>  		goto out;
> @@ -1346,14 +1348,14 @@ static int __init ib_umad_init(void)
> 
>  	ret = alloc_chrdev_region(&dynamic_umad_dev, 0,
>  				  IB_UMAD_NUM_DYNAMIC_MINOR * 2,
> -				  "infiniband_mad");
> +				  IB_UMAD_CLASS_NAME);
>  	if (ret) {
>  		pr_err("couldn't register dynamic device number\n");
>  		goto out_alloc;
>  	}
>  	dynamic_issm_dev = dynamic_umad_dev +
> IB_UMAD_NUM_DYNAMIC_MINOR;
> 
> -	umad_class = class_create(THIS_MODULE, "infiniband_mad");
> +	umad_class = class_create(THIS_MODULE, IB_UMAD_CLASS_NAME);
>  	if (IS_ERR(umad_class)) {
>  		ret = PTR_ERR(umad_class);
>  		pr_err("couldn't create class infiniband_mad\n");
> --
> 2.19.1




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux