]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
staging: wfx: drop useless union hif_indication_data
authorJérôme Pouiller <jerome.pouiller@silabs.com>
Mon, 7 Sep 2020 10:15:14 +0000 (12:15 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 13 Sep 2020 07:23:05 +0000 (09:23 +0200)
The union hif_indication_data is never used in the driver. So, it is not
necessary to declare it separately from hif_ind_generic.

In add, drop prefix 'indication_' from the names 'indication_type' and
'indication_data' since it is redundant with the name of the struct.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200907101521.66082-25-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wfx/hif_api_general.h
drivers/staging/wfx/hif_rx.c

index 4058016ec6640c117d7f318dd9426a348399c288..da63ba6f51483ecfb1e4464a48d0bcd4533ec850 100644 (file)
@@ -221,15 +221,12 @@ struct hif_tx_power_loop_info {
        u8     reserved;
 } __packed;
 
-union hif_indication_data {
-       struct hif_rx_stats rx_stats;
-       struct hif_tx_power_loop_info tx_power_loop_info;
-       u8     raw_data[1];
-};
-
 struct hif_ind_generic {
-       __le32 indication_type;
-       union hif_indication_data indication_data;
+       __le32 type;
+       union {
+               struct hif_rx_stats rx_stats;
+               struct hif_tx_power_loop_info tx_power_loop_info;
+       } data;
 } __packed;
 
 enum hif_error {
index 798167aa4c7fee9dac72aff9ad7c5b520b925b9e..6950b3e9d7cfeb215ec628ea45e0bb5766fcfb9f 100644 (file)
@@ -225,29 +225,28 @@ static int hif_generic_indication(struct wfx_dev *wdev,
                                  const struct hif_msg *hif, const void *buf)
 {
        const struct hif_ind_generic *body = buf;
-       int type = le32_to_cpu(body->indication_type);
+       int type = le32_to_cpu(body->type);
 
        switch (type) {
        case HIF_GENERIC_INDICATION_TYPE_RAW:
                return 0;
        case HIF_GENERIC_INDICATION_TYPE_STRING:
-               dev_info(wdev->dev, "firmware says: %s\n",
-                        (char *)body->indication_data.raw_data);
+               dev_info(wdev->dev, "firmware says: %s\n", (char *)&body->data);
                return 0;
        case HIF_GENERIC_INDICATION_TYPE_RX_STATS:
                mutex_lock(&wdev->rx_stats_lock);
                // Older firmware send a generic indication beside RxStats
                if (!wfx_api_older_than(wdev, 1, 4))
                        dev_info(wdev->dev, "Rx test ongoing. Temperature: %d°C\n",
-                                body->indication_data.rx_stats.current_temp);
-               memcpy(&wdev->rx_stats, &body->indication_data.rx_stats,
+                                body->data.rx_stats.current_temp);
+               memcpy(&wdev->rx_stats, &body->data.rx_stats,
                       sizeof(wdev->rx_stats));
                mutex_unlock(&wdev->rx_stats_lock);
                return 0;
        case HIF_GENERIC_INDICATION_TYPE_TX_POWER_LOOP_INFO:
                mutex_lock(&wdev->tx_power_loop_info_lock);
                memcpy(&wdev->tx_power_loop_info,
-                      &body->indication_data.tx_power_loop_info,
+                      &body->data.tx_power_loop_info,
                       sizeof(wdev->tx_power_loop_info));
                mutex_unlock(&wdev->tx_power_loop_info_lock);
                return 0;