]> git.baikalelectronics.ru Git - kernel.git/commitdiff
s390/qeth: unify structs for bridge port state
authorJulian Wiedmann <jwi@linux.ibm.com>
Thu, 27 Aug 2020 08:17:04 +0000 (10:17 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 27 Aug 2020 14:42:03 +0000 (07:42 -0700)
The data returned from IPA_SBP_QUERY_BRIDGE_PORTS and
IPA_SBP_BRIDGE_PORT_STATE_CHANGE has the same format. Use a single
struct definition for it.

Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Reviewed-by: Alexandra Winter <wintera@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/s390/net/qeth_core_mpc.h
drivers/s390/net/qeth_l2_main.c

index b459def0fb26c59ec626f61370fba63f62677921..6541bab968220f50f8e8465909db835c308b6f59 100644 (file)
@@ -719,15 +719,8 @@ struct qeth_sbp_port_entry {
                struct net_if_token token;
 } __packed;
 
-struct qeth_sbp_query_ports {
-       __u8 primary_bp_supported;
-       __u8 secondary_bp_supported;
-       __u8 num_entries;
-       __u8 entry_length;
-       struct qeth_sbp_port_entry entry[];
-} __packed;
-
-struct qeth_sbp_state_change {
+/* For IPA_SBP_QUERY_BRIDGE_PORTS, IPA_SBP_BRIDGE_PORT_STATE_CHANGE */
+struct qeth_sbp_port_data {
        __u8 primary_bp_supported;
        __u8 secondary_bp_supported;
        __u8 num_entries;
@@ -741,8 +734,7 @@ struct qeth_ipacmd_setbridgeport {
        union {
                struct qeth_sbp_query_cmds_supp query_cmds_supp;
                struct qeth_sbp_set_primary set_primary;
-               struct qeth_sbp_query_ports query_ports;
-               struct qeth_sbp_state_change state_change;
+               struct qeth_sbp_port_data port_data;
        } data;
 } __packed;
 
index d96636369b4c9d427a88da47ddfb3efcfd63b598..1e3d64ab5e46f9f22a40451cd75cc6d43705cd1c 100644 (file)
@@ -1125,8 +1125,7 @@ static void qeth_bridge_state_change_worker(struct work_struct *work)
 static void qeth_bridge_state_change(struct qeth_card *card,
                                        struct qeth_ipa_cmd *cmd)
 {
-       struct qeth_sbp_state_change *qports =
-                &cmd->data.sbp.data.state_change;
+       struct qeth_sbp_port_data *qports = &cmd->data.sbp.data.port_data;
        struct qeth_bridge_state_data *data;
 
        QETH_CARD_TEXT(card, 2, "brstchng");
@@ -1409,8 +1408,8 @@ static int qeth_bridgeport_query_ports_cb(struct qeth_card *card,
        struct qeth_reply *reply, unsigned long data)
 {
        struct qeth_ipa_cmd *cmd = (struct qeth_ipa_cmd *) data;
-       struct qeth_sbp_query_ports *qports = &cmd->data.sbp.data.query_ports;
        struct _qeth_sbp_cbctl *cbctl = (struct _qeth_sbp_cbctl *)reply->param;
+       struct qeth_sbp_port_data *qports;
        int rc;
 
        QETH_CARD_TEXT(card, 2, "brqprtcb");
@@ -1418,6 +1417,7 @@ static int qeth_bridgeport_query_ports_cb(struct qeth_card *card,
        if (rc)
                return rc;
 
+       qports = &cmd->data.sbp.data.port_data;
        if (qports->entry_length != sizeof(struct qeth_sbp_port_entry)) {
                QETH_CARD_TEXT_(card, 2, "SBPs%04x", qports->entry_length);
                return -EINVAL;