{
if (cl_off == -1) {
unsigned long *word;
- int bit;
+ int bit, bits_per_word = sizeof(*word) * 8;
repeat:
word = last_rcvd_slots;
LBUG();
goto repeat;
}
- cl_off = (word - last_rcvd_slots) * sizeof(*word) + bit;
+ cl_off = (word - last_rcvd_slots) * bits_per_word + bit;
} else {
/* test_and_set_bit can handle cl_off > sizeof(long), so there's
* no need to frob it */
{
struct mds_export_data *med = &exp->exp_mds_data;
unsigned long *word;
- int bit;
+ int bit, bits_per_word = sizeof(*word) * 8;
if (!med->med_mcd)
RETURN(0);
CDEBUG(D_INFO, "freeing client at offset %d with UUID '%s'\n",
med->med_off, med->med_mcd->mcd_uuid);
- word = last_rcvd_slots + med->med_off / sizeof(unsigned long);
- bit = med->med_off % sizeof(unsigned long);
+ word = last_rcvd_slots + med->med_off / bits_per_word;
+ bit = med->med_off % bits_per_word;
if (!test_and_clear_bit(bit, word)) {
CERROR("bit %d already clear in word %d - bad bad\n",