Well it is exactly what the patch does. We no longer do the "divide it by 8" thing each time we want to know the now defined TRIM_RANGE_NUM. ata_set_lba_range_entries() has only been used by ata_scsi_write_same_xlat() (http://lxr.free-electrons.com/ident?i=ata_set_lba_range_entries, although the comment of it seems to tell otherwise). That's why I (could) changed the function itself and the param ("512") ata_scsi_write_same_xlat() passes to it. On 5 July 2016 at 19:04, Sergei Shtylyov <sergei.shtylyov@xxxxxxxxxxxxxxxxxx> wrote: > Hello. > > On 7/5/2016 9:45 AM, tom.ty89@xxxxxxxxx wrote: > >> From: Tom Yan <tom.ty89@xxxxxxxxx> >> >> Define TRIM_RANGE_SIZE and TRIM_RANGE_NUM so that the corresponding >> functions can be more generalized. Also, conform to SBC by rejecting >> WRITE SAME (16) commands with number of blocks that exceeds the limit >> that is defined in the SATL. >> >> Signed-off-by: Tom Yan <tom.ty89@xxxxxxxxx> > > > [...] > >> diff --git a/include/linux/ata.h b/include/linux/ata.h >> index 99346be..0971c3f 100644 >> --- a/include/linux/ata.h >> +++ b/include/linux/ata.h >> @@ -1071,7 +1071,7 @@ static inline unsigned >> ata_set_lba_range_entries(void *_buffer, >> __le64 *buffer = _buffer; >> unsigned i = 0, used_bytes; >> >> - while (i < buf_size / 8 ) { /* 6-byte LBA + 2-byte range per entry >> */ >> + while (i < buf_size) { > > > BTW, this change doesn't seem to be documented in the patch description? > > [...] > > MBR, Sergei > -- To unsubscribe from this list: send the line "unsubscribe linux-ide" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html