]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
staging: wilc1000: avoid the use of typedef for function pointers
authorAjay Singh <ajay.kathat@microchip.com>
Thu, 17 Jan 2019 13:21:44 +0000 (13:21 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 18 Jan 2019 09:39:16 +0000 (10:39 +0100)
Remove typedef for function pointers.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wilc1000/host_interface.c
drivers/staging/wilc1000/host_interface.h
drivers/staging/wilc1000/wilc_wlan.c
drivers/staging/wilc1000/wilc_wlan.h
drivers/staging/wilc1000/wilc_wlan_if.h

index f4638654d1a57a536f162499498870d6d6ab0e45..85573eb400af8f3ff4f0bccd7a3819f4b8cf0a82 100644 (file)
@@ -231,9 +231,10 @@ static int handle_scan_done(struct wilc_vif *vif, enum scan_event evt)
 }
 
 int wilc_scan(struct wilc_vif *vif, u8 scan_source, u8 scan_type,
-             u8 *ch_freq_list, u8 ch_list_len, const u8 *ies,
-             size_t ies_len, wilc_scan_result scan_result, void *user_arg,
-             struct wilc_probe_ssid *search)
+             u8 *ch_freq_list, u8 ch_list_len, const u8 *ies, size_t ies_len,
+             void (*scan_result_fn)(enum scan_event,
+                                    struct wilc_rcvd_net_info *, void *),
+             void *user_arg, struct wilc_probe_ssid *search)
 {
        int result = 0;
        struct wid wid_list[5];
@@ -322,7 +323,7 @@ int wilc_scan(struct wilc_vif *vif, u8 scan_source, u8 scan_type,
                goto error;
        }
 
-       hif_drv->usr_scan_req.scan_result = scan_result;
+       hif_drv->usr_scan_req.scan_result = scan_result_fn;
        hif_drv->usr_scan_req.arg = user_arg;
        hif_drv->scan_timer_vif = vif;
        mod_timer(&hif_drv->scan_timer,
@@ -1863,8 +1864,8 @@ void wilc_scan_complete_received(struct wilc *wilc, u8 *buffer, u32 length)
 
 int wilc_remain_on_channel(struct wilc_vif *vif, u32 session_id,
                           u32 duration, u16 chan,
-                          wilc_remain_on_chan_expired expired,
-                          wilc_remain_on_chan_ready ready,
+                          void (*expired)(void *, u32),
+                          void (*ready)(void *),
                           void *user_arg)
 {
        struct remain_ch roc;
index 527ae0523d670d7c6db806ba0c50232573e276b7..7f3fc4c8cb8fe0757411880821864567c0aee588 100644 (file)
@@ -104,12 +104,6 @@ struct wilc_rcvd_net_info {
        struct ieee80211_mgmt *mgmt;
 };
 
-typedef void (*wilc_scan_result)(enum scan_event, struct wilc_rcvd_net_info *,
-                                void *);
-
-typedef void (*wilc_remain_on_chan_expired)(void *, u32);
-typedef void (*wilc_remain_on_chan_ready)(void *);
-
 struct wilc_probe_ssid_info {
        u8 ssid_len;
        u8 *ssid;
@@ -122,7 +116,8 @@ struct wilc_probe_ssid {
 };
 
 struct user_scan_req {
-       wilc_scan_result scan_result;
+       void (*scan_result)(enum scan_event evt,
+                           struct wilc_rcvd_net_info *info, void *priv);
        void *arg;
        u32 ch_cnt;
 };
@@ -145,8 +140,8 @@ struct wilc_conn_info {
 struct remain_ch {
        u16 ch;
        u32 duration;
-       wilc_remain_on_chan_expired expired;
-       wilc_remain_on_chan_ready ready;
+       void (*expired)(void *priv, u32 session_id);
+       void (*ready)(void *priv);
        void *arg;
        u32 id;
 };
@@ -213,9 +208,10 @@ int wilc_disconnect(struct wilc_vif *vif);
 int wilc_set_mac_chnl_num(struct wilc_vif *vif, u8 channel);
 int wilc_get_rssi(struct wilc_vif *vif, s8 *rssi_level);
 int wilc_scan(struct wilc_vif *vif, u8 scan_source, u8 scan_type,
-             u8 *ch_freq_list, u8 ch_list_len, const u8 *ies,
-             size_t ies_len, wilc_scan_result scan_result, void *user_arg,
-             struct wilc_probe_ssid *search);
+             u8 *ch_freq_list, u8 ch_list_len, const u8 *ies, size_t ies_len,
+             void (*scan_result_fn)(enum scan_event,
+                                    struct wilc_rcvd_net_info *, void *),
+             void *user_arg, struct wilc_probe_ssid *search);
 int wilc_hif_set_cfg(struct wilc_vif *vif,
                     struct cfg_param_attr *cfg_param);
 int wilc_init(struct net_device *dev, struct host_if_drv **hif_drv_handler);
@@ -234,8 +230,8 @@ int wilc_setup_multicast_filter(struct wilc_vif *vif, u32 enabled, u32 count,
                                u8 *mc_list);
 int wilc_remain_on_channel(struct wilc_vif *vif, u32 session_id,
                           u32 duration, u16 chan,
-                          wilc_remain_on_chan_expired expired,
-                          wilc_remain_on_chan_ready ready,
+                          void (*expired)(void *, u32),
+                          void (*ready)(void *),
                           void *user_arg);
 int wilc_listen_state_expired(struct wilc_vif *vif, u32 session_id);
 void wilc_frame_register(struct wilc_vif *vif, u16 frame_type, bool reg);
index 16b6c55524321b52cd1ac9e57e2ba843adbe34f0..9d3aaae2e74aa6bb70e2662a8bc009a93cba21f1 100644 (file)
@@ -274,7 +274,8 @@ static int wilc_wlan_txq_add_cfg_pkt(struct wilc_vif *vif, u8 *buffer,
 }
 
 int wilc_wlan_txq_add_net_pkt(struct net_device *dev, void *priv, u8 *buffer,
-                             u32 buffer_size, wilc_tx_complete_func_t func)
+                             u32 buffer_size,
+                             void (*tx_complete_fn)(void *, int))
 {
        struct txq_entry_t *tqe;
        struct wilc_vif *vif = netdev_priv(dev);
@@ -292,7 +293,7 @@ int wilc_wlan_txq_add_net_pkt(struct net_device *dev, void *priv, u8 *buffer,
        tqe->type = WILC_NET_PKT;
        tqe->buffer = buffer;
        tqe->buffer_size = buffer_size;
-       tqe->tx_complete_func = func;
+       tqe->tx_complete_func = tx_complete_fn;
        tqe->priv = priv;
 
        tqe->ack_idx = NOT_TCP_ACK;
@@ -303,7 +304,8 @@ int wilc_wlan_txq_add_net_pkt(struct net_device *dev, void *priv, u8 *buffer,
 }
 
 int wilc_wlan_txq_add_mgmt_pkt(struct net_device *dev, void *priv, u8 *buffer,
-                              u32 buffer_size, wilc_tx_complete_func_t func)
+                              u32 buffer_size,
+                              void (*tx_complete_fn)(void *, int))
 {
        struct txq_entry_t *tqe;
        struct wilc_vif *vif = netdev_priv(dev);
@@ -321,7 +323,7 @@ int wilc_wlan_txq_add_mgmt_pkt(struct net_device *dev, void *priv, u8 *buffer,
        tqe->type = WILC_MGMT_PKT;
        tqe->buffer = buffer;
        tqe->buffer_size = buffer_size;
-       tqe->tx_complete_func = func;
+       tqe->tx_complete_func = tx_complete_fn;
        tqe->priv = priv;
        tqe->ack_idx = NOT_TCP_ACK;
        wilc_wlan_txq_add_to_tail(dev, tqe);
index c8ca13b346910d9a1aca3f29de4c5bc97210928f..388045283dd53eca0a9add684e17e7004d16a769 100644 (file)
@@ -275,7 +275,8 @@ int wilc_wlan_firmware_download(struct wilc *wilc, const u8 *buffer,
 int wilc_wlan_start(struct wilc *wilc);
 int wilc_wlan_stop(struct wilc *wilc);
 int wilc_wlan_txq_add_net_pkt(struct net_device *dev, void *priv, u8 *buffer,
-                             u32 buffer_size, wilc_tx_complete_func_t func);
+                             u32 buffer_size,
+                             void (*tx_complete_fn)(void *, int));
 int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count);
 void wilc_handle_isr(struct wilc *wilc);
 void wilc_wlan_cleanup(struct net_device *dev);
@@ -286,7 +287,7 @@ int wilc_wlan_cfg_get(struct wilc_vif *vif, int start, u16 wid, int commit,
 int wilc_wlan_cfg_get_val(struct wilc *wl, u16 wid, u8 *buffer,
                          u32 buffer_size);
 int wilc_wlan_txq_add_mgmt_pkt(struct net_device *dev, void *priv, u8 *buffer,
-                              u32 buffer_size, wilc_tx_complete_func_t func);
+                              u32 buffer_size, void (*func)(void *, int));
 void wilc_chip_sleep_manually(struct wilc *wilc);
 
 void wilc_enable_tcp_ack_filter(struct wilc_vif *vif, bool value);
index 961b6bb034a839bf0fbeb9d13e259bf064b43026..9370caaf2059d51f2b7517773ce7b96183c75fc7 100644 (file)
@@ -39,8 +39,6 @@ struct tx_complete_data {
        struct sk_buff *skb;
 };
 
-typedef void (*wilc_tx_complete_func_t)(void *, int);
-
 /********************************************
  *
  *      Wlan Configuration ID