u64 opt0;
        u32 opt2;
        unsigned int mtu_idx;
-       int wscale;
+       u32 wscale;
        int win, sizev4, sizev6, wrlen;
        struct sockaddr_in *la = (struct sockaddr_in *)
                                 &ep->com.local_addr;
        cxgb_best_mtu(ep->com.dev->rdev.lldi.mtus, ep->mtu, &mtu_idx,
                      enable_tcp_timestamps,
                      (ep->com.remote_addr.ss_family == AF_INET) ? 0 : 1);
-       wscale = compute_wscale(rcv_win);
+       wscale = cxgb_compute_wscale(rcv_win);
 
        /*
         * Specify the largest window that will fit in opt0. The
        struct sk_buff *skb;
        struct fw_ofld_connection_wr *req;
        unsigned int mtu_idx;
-       int wscale;
+       u32 wscale;
        struct sockaddr_in *sin;
        int win;
 
        cxgb_best_mtu(ep->com.dev->rdev.lldi.mtus, ep->mtu, &mtu_idx,
                      enable_tcp_timestamps,
                      (ep->com.remote_addr.ss_family == AF_INET) ? 0 : 1);
-       wscale = compute_wscale(rcv_win);
+       wscale = cxgb_compute_wscale(rcv_win);
 
        /*
         * Specify the largest window that will fit in opt0. The
        unsigned int mtu_idx;
        u64 opt0;
        u32 opt2;
-       int wscale;
+       u32 wscale;
        struct cpl_t5_pass_accept_rpl *rpl5 = NULL;
        int win;
        enum chip_type adapter_type = ep->com.dev->rdev.lldi.adapter_type;
        cxgb_best_mtu(ep->com.dev->rdev.lldi.mtus, ep->mtu, &mtu_idx,
                      enable_tcp_timestamps && req->tcpopt.tstamp,
                      (ep->com.remote_addr.ss_family == AF_INET) ? 0 : 1);
-       wscale = compute_wscale(rcv_win);
+       wscale = cxgb_compute_wscale(rcv_win);
 
        /*
         * Specify the largest window that will fit in opt0. The
 
        return cm_id->provider_data;
 }
 
-static inline int compute_wscale(int win)
-{
-       int wscale = 0;
-
-       while (wscale < 14 && (65535<<wscale) < win)
-               wscale++;
-       return wscale;
-}
-
 static inline int ocqp_supported(const struct cxgb4_lld_info *infop)
 {
 #if defined(__i386__) || defined(__x86_64__) || defined(CONFIG_PPC64)
 
        return -ENOMEM;
 }
 
-static u32 cxgbit_compute_wscale(u32 win)
-{
-       u32 wscale = 0;
-
-       while (wscale < 14 && (65535 << wscale) < win)
-               wscale++;
-       return wscale;
-}
-
 static void
 cxgbit_pass_accept_rpl(struct cxgbit_sock *csk, struct cpl_pass_accept_req *req)
 {
        cxgb_best_mtu(csk->com.cdev->lldi.mtus, csk->mtu, &mtu_idx,
                      req->tcpopt.tstamp,
                      (csk->com.remote_addr.ss_family == AF_INET) ? 0 : 1);
-       wscale = cxgbit_compute_wscale(csk->rcv_win);
+       wscale = cxgb_compute_wscale(csk->rcv_win);
        /*
         * Specify the largest window that will fit in opt0. The
         * remainder will be specified in the rx_data_ack.