Re: [PATCH v9 6/9] spi: cadence: Add Marvell xfer operation support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jun 19, 2024 at 07:17:12AM -0700, Witold Sadowski wrote:

> +		while (t->len) {
> +
> +			current_cycle_count = t->len > max_len ? max_len : t->len;

cycle_count seems like a weird name?

In general please try to avoid overusing the ternery operator, it
doesn't help legibility.  Just write normal conditional statements, or
in this case use max().

> +				cdns_xspi->current_xfer_qword += current_cycle_count /
> +								 MRVL_XFER_QWORD_BYTECOUNT;
> +				if (current_cycle_count % MRVL_XFER_QWORD_BYTECOUNT)
> +					cdns_xspi->current_xfer_qword++;
> +
> +				cdns_xspi->current_xfer_qword %= MRVL_XFER_QWORD_COUNT;
> +			}
> +			cs_change = t->cs_change;
> +			t->len -= current_cycle_count;
> +		}
> +	}

This loop doesn't implement any of the delay stuff, ideally it either
would or would reject transfers that request transfers.

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux