> + pmap = kmap_atomic(iv.bv_page) + iv.bv_offset; > + p = pmap; Maybe: pmap = p = kmap_atomic(iv.bv_page) + iv.bv_offset; > + for (j = 0; j < iv.bv_len; j += tuple_sz) { > + pi = (struct t10_pi_tuple *)p; No need for the cast, also the pi declaration can be moved into the inner scope: struct t10_pi_tuple *pi = p; > + pmap = kmap_atomic(iv.bv_page) + iv.bv_offset; > + p = pmap; > + for (j = 0; j < iv.bv_len; j += tuple_sz) { > + if (intervals == 0) { > + kunmap_atomic(pmap); > + return; > + } > + pi = (struct t10_pi_tuple *)p; Same here. Also the intervals check would make sense in the for loop I think, e.g.: pmap = p = kmap_atomic(iv.bv_page) + iv.bv_offset; for (j = 0; j < iv.bv_len && intervals; j += tuple_sz) { struct t10_pi_tuple *pi = p;