s390/ism: Cleanups
authorStefan Raspl <raspl@linux.ibm.com>
Mon, 25 Jul 2022 14:09:58 +0000 (16:09 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 27 Jul 2022 12:24:42 +0000 (13:24 +0100)
Reworked signature of the function to retrieve the system EID: No plausible
reason to use a double pointer. And neither to pass in the device as an
argument, as this identifier is by definition per system, not per device.
Plus some minor consistency edits.

Signed-off-by: Stefan Raspl <raspl@linux.ibm.com>
Signed-off-by: Wenjia Zhang < wenjia@linux.ibm.com>
Reviewed-by: Tony Lu <tonylu@linux.alibaba.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/s390/net/ism_drv.c
include/net/smc.h
net/smc/smc_ism.c

index 5f7e28de8b1504e9570593266889ac726307aec3..4665e9a0e0484d80c7511872a5642cf2d9be2ff8 100644 (file)
@@ -409,20 +409,19 @@ static void ism_create_system_eid(void)
        memcpy(&SYSTEM_EID.type, tmp, 4);
 }
 
-static void ism_get_system_eid(struct smcd_dev *smcd, u8 **eid)
+static u8 *ism_get_system_eid(void)
 {
-       *eid = &SYSTEM_EID.seid_string[0];
+       return SYSTEM_EID.seid_string;
 }
 
 static u16 ism_get_chid(struct smcd_dev *smcd)
 {
-       struct ism_dev *ismdev;
+       struct ism_dev *ism = (struct ism_dev *)smcd->priv;
 
-       ismdev = (struct ism_dev *)smcd->priv;
-       if (!ismdev || !ismdev->pdev)
+       if (!ism || !ism->pdev)
                return 0;
 
-       return to_zpci(ismdev->pdev)->pchid;
+       return to_zpci(ism->pdev)->pchid;
 }
 
 static void ism_handle_event(struct ism_dev *ism)
index 37f829d9c6e5c33ffb13deb02bae8705bfdff93c..1868a5014dea702e90f6293b8269412738056200 100644 (file)
@@ -72,7 +72,7 @@ struct smcd_ops {
        int (*move_data)(struct smcd_dev *dev, u64 dmb_tok, unsigned int idx,
                         bool sf, unsigned int offset, void *data,
                         unsigned int size);
-       void (*get_system_eid)(struct smcd_dev *dev, u8 **eid);
+       u8* (*get_system_eid)(void);
        u16 (*get_chid)(struct smcd_dev *dev);
 };
 
index c656ef25ee4bb4f172ab3bb2cf0aa203f585d85a..e51c0cdff8e018bcec7c9cf2b16db083f6a6fc67 100644 (file)
@@ -429,7 +429,7 @@ int smcd_register_dev(struct smcd_dev *smcd)
        if (list_empty(&smcd_dev_list.list)) {
                u8 *system_eid = NULL;
 
-               smcd->ops->get_system_eid(smcd, &system_eid);
+               system_eid = smcd->ops->get_system_eid();
                if (system_eid[24] != '0' || system_eid[28] != '0') {
                        smc_ism_v2_capable = true;
                        memcpy(smc_ism_v2_system_eid, system_eid,