On Mon, Jul 14, 2025 at 08:35:33AM -0700, Bart Van Assche wrote: > On 7/14/25 6:48 AM, John Garry wrote: >> since you are touching this code: >> >> bio_for_each_segment(bv, bio, iter) { >> num_sectors += bv.bv_len >> SECTOR_SHIFT; >> if (++i == BIO_MAX_VECS) >> break; >> } >> >> if efficiency is a concern, then it seems better to keep the running total >> in bytes and then >> SECTOR_SHIFT > Anyone who cares about efficiency should support encryption in hardware > instead of using the software fallback code. As far as I know, on > Android phones, the crypto fallback code is only used during hardware > bringup and not on any devices that are shipped to consumers. I don't think that's a good argument to not clean something so obvious up. It doesn't belong into this patch, but if you touch the area anyway it would be really helpful if you added another patch for this trivial cleanup and obvious optimization.