* [PATCH v1] spi: intel: make mem_ops comparison unique to opcode match
@ 2023-11-17 14:40 Raag Jadav
2023-11-18 6:30 ` Mika Westerberg
2023-11-18 23:58 ` Mark Brown
0 siblings, 2 replies; 3+ messages in thread
From: Raag Jadav @ 2023-11-17 14:40 UTC (permalink / raw)
To: broonie, mika.westerberg, andriy.shevchenko
Cc: linux-spi, linux-kernel, Raag Jadav
Instead of comparing parameters for every supported mem_ops, only compare
on opcode match, which is relatively more efficient.
Signed-off-by: Raag Jadav <raag.jadav@intel.com>
---
drivers/spi/spi-intel.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/spi/spi-intel.c b/drivers/spi/spi-intel.c
index 98ec4dc22b81..3654ae35d2db 100644
--- a/drivers/spi/spi-intel.c
+++ b/drivers/spi/spi-intel.c
@@ -711,8 +711,7 @@ static bool intel_spi_cmp_mem_op(const struct intel_spi_mem_op *iop,
{
if (iop->mem_op.cmd.nbytes != op->cmd.nbytes ||
iop->mem_op.cmd.buswidth != op->cmd.buswidth ||
- iop->mem_op.cmd.dtr != op->cmd.dtr ||
- iop->mem_op.cmd.opcode != op->cmd.opcode)
+ iop->mem_op.cmd.dtr != op->cmd.dtr)
return false;
if (iop->mem_op.addr.nbytes != op->addr.nbytes ||
@@ -737,11 +736,12 @@ intel_spi_match_mem_op(struct intel_spi *ispi, const struct spi_mem_op *op)
const struct intel_spi_mem_op *iop;
for (iop = ispi->mem_ops; iop->mem_op.cmd.opcode; iop++) {
- if (intel_spi_cmp_mem_op(iop, op))
- break;
+ if (iop->mem_op.cmd.opcode == op->cmd.opcode &&
+ intel_spi_cmp_mem_op(iop, op))
+ return iop;
}
- return iop->mem_op.cmd.opcode ? iop : NULL;
+ return NULL;
}
static bool intel_spi_supports_mem_op(struct spi_mem *mem,
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v1] spi: intel: make mem_ops comparison unique to opcode match
2023-11-17 14:40 [PATCH v1] spi: intel: make mem_ops comparison unique to opcode match Raag Jadav
@ 2023-11-18 6:30 ` Mika Westerberg
2023-11-18 23:58 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Mika Westerberg @ 2023-11-18 6:30 UTC (permalink / raw)
To: Raag Jadav; +Cc: broonie, andriy.shevchenko, linux-spi, linux-kernel
On Fri, Nov 17, 2023 at 08:10:53PM +0530, Raag Jadav wrote:
> Instead of comparing parameters for every supported mem_ops, only compare
> on opcode match, which is relatively more efficient.
>
> Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v1] spi: intel: make mem_ops comparison unique to opcode match
2023-11-17 14:40 [PATCH v1] spi: intel: make mem_ops comparison unique to opcode match Raag Jadav
2023-11-18 6:30 ` Mika Westerberg
@ 2023-11-18 23:58 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2023-11-18 23:58 UTC (permalink / raw)
To: mika.westerberg, andriy.shevchenko, Raag Jadav; +Cc: linux-spi, linux-kernel
On Fri, 17 Nov 2023 20:10:53 +0530, Raag Jadav wrote:
> Instead of comparing parameters for every supported mem_ops, only compare
> on opcode match, which is relatively more efficient.
>
>
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next
Thanks!
[1/1] spi: intel: make mem_ops comparison unique to opcode match
commit: 18a813a1f94abbab14248071ca551e491bbc2abe
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-11-18 23:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-17 14:40 [PATCH v1] spi: intel: make mem_ops comparison unique to opcode match Raag Jadav
2023-11-18 6:30 ` Mika Westerberg
2023-11-18 23:58 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox