mirror of
https://github.com/linux-msm/laptops-kernel.git
synced 2026-08-13 14:19:53 -07:00
net/smc: Remove error handling of unregister_dmb()
smcd_buf_free() calls smc_ism_unregister_dmb(lgr->smcd, buf_desc) and then unconditionally frees buf_desc. Remove the cleaning up of fields of buf_desc in smc_ism_unregister_dmb(), because it is not helpful. This removes the only usage of ISM_ERROR from the smc module. So move it to drivers/s390/net/ism.h. Signed-off-by: Alexandra Winter <wintera@linux.ibm.com> Reviewed-by: Mahanta Jambigi <mjambigi@linux.ibm.com> Reviewed-by: Dust Li <dust.li@linux.alibaba.com> Link: https://patch.msgid.link/20250918110500.1731261-2-wintera@linux.ibm.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
committed by
Paolo Abeni
parent
6e2f1484b9
commit
884eee8e43
@@ -10,6 +10,7 @@
|
||||
#include <asm/pci_insn.h>
|
||||
|
||||
#define UTIL_STR_LEN 16
|
||||
#define ISM_ERROR 0xFFFF
|
||||
|
||||
/*
|
||||
* Do not use the first word of the DMB bits to ensure 8 byte aligned access.
|
||||
|
||||
@@ -44,8 +44,6 @@ struct smcd_dmb {
|
||||
|
||||
#define ISM_RESERVED_VLANID 0x1FFF
|
||||
|
||||
#define ISM_ERROR 0xFFFF
|
||||
|
||||
struct smcd_dev;
|
||||
|
||||
struct smcd_gid {
|
||||
|
||||
+5
-9
@@ -205,13 +205,13 @@ out:
|
||||
return rc;
|
||||
}
|
||||
|
||||
int smc_ism_unregister_dmb(struct smcd_dev *smcd, struct smc_buf_desc *dmb_desc)
|
||||
void smc_ism_unregister_dmb(struct smcd_dev *smcd,
|
||||
struct smc_buf_desc *dmb_desc)
|
||||
{
|
||||
struct smcd_dmb dmb;
|
||||
int rc = 0;
|
||||
|
||||
if (!dmb_desc->dma_addr)
|
||||
return rc;
|
||||
return;
|
||||
|
||||
memset(&dmb, 0, sizeof(dmb));
|
||||
dmb.dmb_tok = dmb_desc->token;
|
||||
@@ -219,13 +219,9 @@ int smc_ism_unregister_dmb(struct smcd_dev *smcd, struct smc_buf_desc *dmb_desc)
|
||||
dmb.cpu_addr = dmb_desc->cpu_addr;
|
||||
dmb.dma_addr = dmb_desc->dma_addr;
|
||||
dmb.dmb_len = dmb_desc->len;
|
||||
rc = smcd->ops->unregister_dmb(smcd, &dmb);
|
||||
if (!rc || rc == ISM_ERROR) {
|
||||
dmb_desc->cpu_addr = NULL;
|
||||
dmb_desc->dma_addr = 0;
|
||||
}
|
||||
smcd->ops->unregister_dmb(smcd, &dmb);
|
||||
|
||||
return rc;
|
||||
return;
|
||||
}
|
||||
|
||||
int smc_ism_register_dmb(struct smc_link_group *lgr, int dmb_len,
|
||||
|
||||
+2
-1
@@ -47,7 +47,8 @@ int smc_ism_get_vlan(struct smcd_dev *dev, unsigned short vlan_id);
|
||||
int smc_ism_put_vlan(struct smcd_dev *dev, unsigned short vlan_id);
|
||||
int smc_ism_register_dmb(struct smc_link_group *lgr, int buf_size,
|
||||
struct smc_buf_desc *dmb_desc);
|
||||
int smc_ism_unregister_dmb(struct smcd_dev *dev, struct smc_buf_desc *dmb_desc);
|
||||
void smc_ism_unregister_dmb(struct smcd_dev *dev,
|
||||
struct smc_buf_desc *dmb_desc);
|
||||
bool smc_ism_support_dmb_nocopy(struct smcd_dev *smcd);
|
||||
int smc_ism_attach_dmb(struct smcd_dev *dev, u64 token,
|
||||
struct smc_buf_desc *dmb_desc);
|
||||
|
||||
Reference in New Issue
Block a user