qed: Fix bitmap_weight() check
[sfrench/cifs-2.6.git] / drivers / net / ethernet / qlogic / qed / qed_dev.c
index cff141077558c8c3abbe5909b23549f05aad2b60..9b41e4ba53e5b58ffdab2c63c8dee26f01efee9a 100644 (file)
@@ -485,8 +485,11 @@ static u16 *qed_init_qm_get_idx_from_flags(struct qed_hwfn *p_hwfn,
        struct qed_qm_info *qm_info = &p_hwfn->qm_info;
 
        /* Can't have multiple flags set here */
-       if (bitmap_weight((unsigned long *)&pq_flags, sizeof(pq_flags)) > 1)
+       if (bitmap_weight((unsigned long *)&pq_flags,
+                         sizeof(pq_flags) * BITS_PER_BYTE) > 1) {
+               DP_ERR(p_hwfn, "requested multiple pq flags 0x%x\n", pq_flags);
                goto err;
+       }
 
        switch (pq_flags) {
        case PQ_FLAGS_RLS: