Skip to contentSkip to conversation

misc: ocxl: link: Remove unnecessary (void*) conversions

PATCH Applied Li zeming 4 participants 4 messages Nov 13, 2023 – Dec 7, 2023

Subsystems (2)
lore
Share & tools
lore

Li zeming

author
#0 lore raw

PATCH 1/1 misc: ocxl: link: Remove unnecessary (void*) conversions

The link pointer does not need to cast the type.

---
 drivers/misc/ocxl/link.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/misc/ocxl/link.c +7 -7
index c06c699c0e7b1..03402203cacdb 100644
@@ -188,7 +188,7 @@ static void xsl_fault_handler_bh(struct work_struct *fault_work)
 
 static irqreturn_t xsl_fault_handler(int irq, void *data)
 {
-	struct ocxl_link *link = (struct ocxl_link *) data;
+	struct ocxl_link *link = data;
 	struct spa *spa = link->spa;
 	u64 dsisr, dar, pe_handle;
 	struct pe_data *pe_data;
@@ -483,7 +483,7 @@ static void release_xsl(struct kref *ref)
 
 void ocxl_link_release(struct pci_dev *dev, void *link_handle)
 {
-	struct ocxl_link *link = (struct ocxl_link *) link_handle;
+	struct ocxl_link *link = link_handle;
 
 	mutex_lock(&links_list_lock);
 	kref_put(&link->ref, release_xsl);
@@ -540,7 +540,7 @@ int ocxl_link_add_pe(void *link_handle, int pasid, u32 pidr, u32 tidr,
 		void (*xsl_err_cb)(void *data, u64 addr, u64 dsisr),
 		void *xsl_err_data)
 {
-	struct ocxl_link *link = (struct ocxl_link *) link_handle;
+	struct ocxl_link *link = link_handle;
 	struct spa *spa = link->spa;
 	struct ocxl_process_element *pe;
 	int pe_handle, rc = 0;
@@ -630,7 +630,7 @@ EXPORT_SYMBOL_GPL(ocxl_link_add_pe);
 
 int ocxl_link_update_pe(void *link_handle, int pasid, __u16 tid)
 {
-	struct ocxl_link *link = (struct ocxl_link *) link_handle;
+	struct ocxl_link *link = link_handle;
 	struct spa *spa = link->spa;
 	struct ocxl_process_element *pe;
 	int pe_handle, rc;
@@ -666,7 +666,7 @@ int ocxl_link_update_pe(void *link_handle, int pasid, __u16 tid)
 
 int ocxl_link_remove_pe(void *link_handle, int pasid)
 {
-	struct ocxl_link *link = (struct ocxl_link *) link_handle;
+	struct ocxl_link *link = link_handle;
 	struct spa *spa = link->spa;
 	struct ocxl_process_element *pe;
 	struct pe_data *pe_data;
@@ -752,7 +752,7 @@ EXPORT_SYMBOL_GPL(ocxl_link_remove_pe);
 
 int ocxl_link_irq_alloc(void *link_handle, int *hw_irq)
 {
-	struct ocxl_link *link = (struct ocxl_link *) link_handle;
+	struct ocxl_link *link = link_handle;
 	int irq;
 
 	if (atomic_dec_if_positive(&link->irq_available) < 0)
@@ -771,7 +771,7 @@ EXPORT_SYMBOL_GPL(ocxl_link_irq_alloc);
 
 void ocxl_link_free_irq(void *link_handle, int hw_irq)
 {
-	struct ocxl_link *link = (struct ocxl_link *) link_handle;
+	struct ocxl_link *link = link_handle;
 
 	xive_native_free_irq(hw_irq);
 	atomic_inc(&link->irq_available);
Signature · 1 line
2.18.2
Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · Li zeming

The link pointer does not need to cast the type.

---

Fred

Quoted 70 lines
  drivers/misc/ocxl/link.c | 14 +++++++-------
  1 file changed, 7 insertions(+), 7 deletions(-)
drivers/misc/ocxl/link.c +7 -7
index c06c699c0e7b1..03402203cacdb 100644
@@ -188,7 +188,7 @@ static void xsl_fault_handler_bh(struct work_struct *fault_work)
 
  static irqreturn_t xsl_fault_handler(int irq, void *data)
  {
-	struct ocxl_link *link = (struct ocxl_link *) data;
+	struct ocxl_link *link = data;
  	struct spa *spa = link->spa;
  	u64 dsisr, dar, pe_handle;
  	struct pe_data *pe_data;
@@ -483,7 +483,7 @@ static void release_xsl(struct kref *ref)
 
  void ocxl_link_release(struct pci_dev *dev, void *link_handle)
  {
-	struct ocxl_link *link = (struct ocxl_link *) link_handle;
+	struct ocxl_link *link = link_handle;
 
  	mutex_lock(&links_list_lock);
  	kref_put(&link->ref, release_xsl);
@@ -540,7 +540,7 @@ int ocxl_link_add_pe(void *link_handle, int pasid, u32 pidr, u32 tidr,
  		void (*xsl_err_cb)(void *data, u64 addr, u64 dsisr),
  		void *xsl_err_data)
  {
-	struct ocxl_link *link = (struct ocxl_link *) link_handle;
+	struct ocxl_link *link = link_handle;
  	struct spa *spa = link->spa;
  	struct ocxl_process_element *pe;
  	int pe_handle, rc = 0;
@@ -630,7 +630,7 @@ EXPORT_SYMBOL_GPL(ocxl_link_add_pe);
 
  int ocxl_link_update_pe(void *link_handle, int pasid, __u16 tid)
  {
-	struct ocxl_link *link = (struct ocxl_link *) link_handle;
+	struct ocxl_link *link = link_handle;
  	struct spa *spa = link->spa;
  	struct ocxl_process_element *pe;
  	int pe_handle, rc;
@@ -666,7 +666,7 @@ int ocxl_link_update_pe(void *link_handle, int pasid, __u16 tid)
 
  int ocxl_link_remove_pe(void *link_handle, int pasid)
  {
-	struct ocxl_link *link = (struct ocxl_link *) link_handle;
+	struct ocxl_link *link = link_handle;
  	struct spa *spa = link->spa;
  	struct ocxl_process_element *pe;
  	struct pe_data *pe_data;
@@ -752,7 +752,7 @@ EXPORT_SYMBOL_GPL(ocxl_link_remove_pe);
 
  int ocxl_link_irq_alloc(void *link_handle, int *hw_irq)
  {
-	struct ocxl_link *link = (struct ocxl_link *) link_handle;
+	struct ocxl_link *link = link_handle;
  	int irq;
 
  	if (atomic_dec_if_positive(&link->irq_available) < 0)
@@ -771,7 +771,7 @@ EXPORT_SYMBOL_GPL(ocxl_link_irq_alloc);
 
  void ocxl_link_free_irq(void *link_handle, int hw_irq)
  {
-	struct ocxl_link *link = (struct ocxl_link *) link_handle;
+	struct ocxl_link *link = link_handle;
 
  	xive_native_free_irq(hw_irq);
  	atomic_inc(&link->irq_available);
Acked-by on v1 1/1
#2 lore raw
In reply to Li zeming
Quoted 3 lines · Li zeming

The link pointer does not need to cast the type.

Quoted 74 lines

---
 drivers/misc/ocxl/link.c | 14 +++++++-------

 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/misc/ocxl/link.c +0 -0
index c06c699c0e7b1..03402203cacdb 100644
@@ -188,7 +188,7 @@ static void xsl_fault_handler_bh(struct
 work_struct *fault_work)


 static irqreturn_t xsl_fault_handler(int irq, void *data) {

drivers/misc/ocxl/link.c +1 -1
-	struct ocxl_link *link = (struct ocxl_link *) data;
+	struct ocxl_link *link = data;

  struct spa *spa = link->spa;
  u64 dsisr, dar, pe_handle;
  struct pe_data *pe_data;

drivers/misc/ocxl/link.c +0 -0
@@ -483,7 +483,7 @@ static void release_xsl(struct kref *ref)


 void ocxl_link_release(struct pci_dev *dev, void *link_handle) {

drivers/misc/ocxl/link.c +1 -1
-	struct ocxl_link *link = (struct ocxl_link *) link_handle;
+	struct ocxl_link *link = link_handle;


  mutex_lock(&links_list_lock);
  kref_put(&link->ref, release_xsl);

drivers/misc/ocxl/link.c +1 -1
@@ -540,7 +540,7 @@ int ocxl_link_add_pe(void *link_handle, int
 pasid, u32 pidr, u32 tidr,
  		void (*xsl_err_cb)(void *data, u64 addr, u64 dsisr),
  		void *xsl_err_data)
  {
-	struct ocxl_link *link = (struct ocxl_link *) link_handle;
+	struct ocxl_link *link = link_handle;
  	struct spa *spa = link->spa;
  	struct ocxl_process_element *pe;

  int pe_handle, rc = 0;

drivers/misc/ocxl/link.c +0 -0
@@ -630,7 +630,7 @@ EXPORT_SYMBOL_GPL(ocxl_link_add_pe);


 int ocxl_link_update_pe(void *link_handle, int pasid, __u16 tid) {

drivers/misc/ocxl/link.c +1 -1
-	struct ocxl_link *link = (struct ocxl_link *) link_handle;
+	struct ocxl_link *link = link_handle;

  struct spa *spa = link->spa;
  struct ocxl_process_element *pe;
  int pe_handle, rc;

drivers/misc/ocxl/link.c +0 -0
@@ -666,7 +666,7 @@ int ocxl_link_update_pe(void *link_handle, int
 pasid, __u16 tid)


 int ocxl_link_remove_pe(void *link_handle, int pasid) {

drivers/misc/ocxl/link.c +1 -1
-	struct ocxl_link *link = (struct ocxl_link *) link_handle;
+	struct ocxl_link *link = link_handle;

  struct spa *spa = link->spa;
  struct ocxl_process_element *pe;
  struct pe_data *pe_data;

drivers/misc/ocxl/link.c +0 -0
@@ -752,7 +752,7 @@ EXPORT_SYMBOL_GPL(ocxl_link_remove_pe);


 int ocxl_link_irq_alloc(void *link_handle, int *hw_irq) {

drivers/misc/ocxl/link.c +1 -1
-	struct ocxl_link *link = (struct ocxl_link *) link_handle;
+	struct ocxl_link *link = link_handle;

  int irq;

  if (atomic_dec_if_positive(&link->irq_available) < 0)

drivers/misc/ocxl/link.c +0 -0
@@ -771,7 +771,7 @@ EXPORT_SYMBOL_GPL(ocxl_link_irq_alloc);


 void ocxl_link_free_irq(void *link_handle, int hw_irq) {

drivers/misc/ocxl/link.c +1 -1
-	struct ocxl_link *link = (struct ocxl_link *) link_handle;
+	struct ocxl_link *link = link_handle;


  xive_native_free_irq(hw_irq);
  atomic_inc(&link->irq_available);

Signature · 2 lines
Andrew Donnellan    OzLabs, ADL Canberra
[email protected]   IBM Australia Limited