e100: Fix passing zero to 'PTR_ERR' warning in e100_load_ucode_wait
[linux] / drivers / net / ethernet / intel / e100.c
index 7c4b554..0fd2680 100644 (file)
@@ -1345,8 +1345,8 @@ static inline int e100_load_ucode_wait(struct nic *nic)
 
        fw = e100_request_firmware(nic);
        /* If it's NULL, then no ucode is required */
-       if (!fw || IS_ERR(fw))
-               return PTR_ERR(fw);
+       if (IS_ERR_OR_NULL(fw))
+               return PTR_ERR_OR_ZERO(fw);
 
        if ((err = e100_exec_cb(nic, (void *)fw, e100_setup_ucode)))
                netif_err(nic, probe, nic->netdev,
@@ -2225,11 +2225,13 @@ static int e100_poll(struct napi_struct *napi, int budget)
        e100_rx_clean(nic, &work_done, budget);
        e100_tx_clean(nic);
 
-       /* If budget not fully consumed, exit the polling mode */
-       if (work_done < budget) {
-               napi_complete_done(napi, work_done);
+       /* If budget fully consumed, continue polling */
+       if (work_done == budget)
+               return budget;
+
+       /* only re-enable interrupt if stack agrees polling is really done */
+       if (likely(napi_complete_done(napi, work_done)))
                e100_enable_irq(nic);
-       }
 
        return work_done;
 }