diff mbox series

[2/3] cxl/pci: Update comment

Message ID 20230426-cxl-fixes-v1-2-870c4c8b463a@intel.com
State New, archived
Headers show
Series cxl: Random clean ups | expand

Commit Message

Ira Weiny May 17, 2023, 9:28 p.m. UTC
The existence of struct cxl_dev_id containing a single member is odd.
The comment made sense when I wrote it but could be clarified.

Update the comment and place it next to the odd looking structure.

Signed-off-by: Ira Weiny <ira.weiny@intel.com>
---
 drivers/cxl/pci.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Dave Jiang May 17, 2023, 9:32 p.m. UTC | #1
On 5/17/23 2:28 PM, Ira Weiny wrote:
> The existence of struct cxl_dev_id containing a single member is odd.
> The comment made sense when I wrote it but could be clarified.
> 
> Update the comment and place it next to the odd looking structure.
> 
> Signed-off-by: Ira Weiny <ira.weiny@intel.com>

Reviewed-by: Dave Jiang <dave.jiang@intel.com>

> ---
>   drivers/cxl/pci.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/cxl/pci.c b/drivers/cxl/pci.c
> index f7a5b8e9c102..ad7a1276fdc5 100644
> --- a/drivers/cxl/pci.c
> +++ b/drivers/cxl/pci.c
> @@ -469,6 +469,10 @@ static int cxl_alloc_irq_vectors(struct pci_dev *pdev)
>   	return 0;
>   }
>   
> +/*
> + * Threaded irq dev_id's must be globally unique.  cxl_dev_id provides a unique
> + * wrapper object for each irq within the same cxlds.
> + */
>   struct cxl_dev_id {
>   	struct cxl_dev_state *cxlds;
>   };
> @@ -506,7 +510,6 @@ static int cxl_event_req_irq(struct cxl_dev_state *cxlds, u8 setting)
>   	if (FIELD_GET(CXLDEV_EVENT_INT_MODE_MASK, setting) != CXL_INT_MSI_MSIX)
>   		return -ENXIO;
>   
> -	/* dev_id must be globally unique and must contain the cxlds */
>   	dev_id = devm_kzalloc(dev, sizeof(*dev_id), GFP_KERNEL);
>   	if (!dev_id)
>   		return -ENOMEM;
>
Jonathan Cameron May 18, 2023, 9:38 a.m. UTC | #2
On Wed, 17 May 2023 14:28:11 -0700
Ira Weiny <ira.weiny@intel.com> wrote:

> The existence of struct cxl_dev_id containing a single member is odd.
> The comment made sense when I wrote it but could be clarified.
> 
> Update the comment and place it next to the odd looking structure.
> 
> Signed-off-by: Ira Weiny <ira.weiny@intel.com>

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

> ---
>  drivers/cxl/pci.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/cxl/pci.c b/drivers/cxl/pci.c
> index f7a5b8e9c102..ad7a1276fdc5 100644
> --- a/drivers/cxl/pci.c
> +++ b/drivers/cxl/pci.c
> @@ -469,6 +469,10 @@ static int cxl_alloc_irq_vectors(struct pci_dev *pdev)
>  	return 0;
>  }
>  
> +/*
> + * Threaded irq dev_id's must be globally unique.  cxl_dev_id provides a unique
> + * wrapper object for each irq within the same cxlds.
> + */
>  struct cxl_dev_id {
>  	struct cxl_dev_state *cxlds;
>  };
> @@ -506,7 +510,6 @@ static int cxl_event_req_irq(struct cxl_dev_state *cxlds, u8 setting)
>  	if (FIELD_GET(CXLDEV_EVENT_INT_MODE_MASK, setting) != CXL_INT_MSI_MSIX)
>  		return -ENXIO;
>  
> -	/* dev_id must be globally unique and must contain the cxlds */
>  	dev_id = devm_kzalloc(dev, sizeof(*dev_id), GFP_KERNEL);
>  	if (!dev_id)
>  		return -ENOMEM;
>
diff mbox series

Patch

diff --git a/drivers/cxl/pci.c b/drivers/cxl/pci.c
index f7a5b8e9c102..ad7a1276fdc5 100644
--- a/drivers/cxl/pci.c
+++ b/drivers/cxl/pci.c
@@ -469,6 +469,10 @@  static int cxl_alloc_irq_vectors(struct pci_dev *pdev)
 	return 0;
 }
 
+/*
+ * Threaded irq dev_id's must be globally unique.  cxl_dev_id provides a unique
+ * wrapper object for each irq within the same cxlds.
+ */
 struct cxl_dev_id {
 	struct cxl_dev_state *cxlds;
 };
@@ -506,7 +510,6 @@  static int cxl_event_req_irq(struct cxl_dev_state *cxlds, u8 setting)
 	if (FIELD_GET(CXLDEV_EVENT_INT_MODE_MASK, setting) != CXL_INT_MSI_MSIX)
 		return -ENXIO;
 
-	/* dev_id must be globally unique and must contain the cxlds */
 	dev_id = devm_kzalloc(dev, sizeof(*dev_id), GFP_KERNEL);
 	if (!dev_id)
 		return -ENOMEM;