Trivial simplification to logic of last commit

This commit is contained in:
Gregory Nutt 2015-11-11 15:17:36 -06:00
parent 003e022ce9
commit b05fb671ff
1 changed files with 2 additions and 9 deletions

View File

@ -1569,9 +1569,6 @@ static int qspi_memory(struct qspi_dev_s *dev,
struct qspi_meminfo_s *meminfo)
{
struct sam_qspidev_s *priv = (struct sam_qspidev_s *)dev;
#ifdef CONFIG_SAMV7_QSPI_DMA
bool aligned;
#endif
DEBUGASSERT(priv != NULL && meminfo != NULL);
@ -1584,16 +1581,12 @@ static int qspi_memory(struct qspi_dev_s *dev,
qspivdbg(" buffer/length: %p/%d\n", meminfo->buffer, meminfo->buflen);
#ifdef CONFIG_SAMV7_QSPI_DMA
/* Check for attempt to do unaligned read */
aligned = IS_ALIGNED((uintptr_t)meminfo->buffer) &&
IS_ALIGNED(meminfo->buflen);
/* Can we perform DMA? Should we perform DMA? */
if (priv->candma &&
meminfo->buflen > CONFIG_SAMV7_QSPI_DMATHRESHOLD &&
aligned)
IS_ALIGNED((uintptr_t)meminfo->buffer) &&
IS_ALIGNED(meminfo->buflen))
{
return qspi_memory_dma(priv, meminfo);
}