libata-scsi: avoid repeated calculation of number of TRIM ranges
authorTom Yan <tom.ty89@gmail.com>
Tue, 12 Jul 2016 20:31:23 +0000 (04:31 +0800)
committerTejun Heo <tj@kernel.org>
Tue, 12 Jul 2016 20:37:17 +0000 (16:37 -0400)
commit2983860c766870b701c4a34f435c1e18db086244
treec9c084dc70f54fd860baead437e37f3e1ae9844b
parent5c79097a28c2525740dd9e4470676ec9d25bee45
libata-scsi: avoid repeated calculation of number of TRIM ranges

Currently libata statically allows only 1-block (512-byte) payload
for each TRIM command. Each payload can carry 64 TRIM ranges since
each range requires 8 bytes.

It is silly to keep doing the calculation (512 / 8) in different
places. Hence, define the new ATA_MAX_TRIM_RNUM for the result.

Signed-off-by: Tom Yan <tom.ty89@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
drivers/ata/libata-scsi.c
include/linux/ata.h