Commit da299470 authored by Changcheng Deng's avatar Changcheng Deng Committed by Damien Le Moal
Browse files

ata: libata: use min() to make code cleaner



Use min() in order to make code cleaner.

Reported-by: default avatarZeal Robot <zealci@zte.com.cn>
Signed-off-by: default avatarChangcheng Deng <deng.changcheng@zte.com.cn>
Signed-off-by: default avatarDamien Le Moal <damien.lemoal@opensource.wdc.com>
parent 7b6acb4e
Loading
Loading
Loading
Loading
+2 −8
Original line number Diff line number Diff line
@@ -3591,10 +3591,7 @@ static int ata_mselect_caching(struct ata_queued_cmd *qc,
	 */

	if (len != CACHE_MPAGE_LEN - 2) {
		if (len < CACHE_MPAGE_LEN - 2)
			*fp = len;
		else
			*fp = CACHE_MPAGE_LEN - 2;
		*fp = min(len, CACHE_MPAGE_LEN - 2);
		return -EINVAL;
	}

@@ -3647,10 +3644,7 @@ static int ata_mselect_control(struct ata_queued_cmd *qc,
	 */

	if (len != CONTROL_MPAGE_LEN - 2) {
		if (len < CONTROL_MPAGE_LEN - 2)
			*fp = len;
		else
			*fp = CONTROL_MPAGE_LEN - 2;
		*fp = min(len, CONTROL_MPAGE_LEN - 2);
		return -EINVAL;
	}