mmc: sdhci: Fix ADMA table size warning
authorAdrian Hunter <adrian.hunter@intel.com>
Tue, 4 Nov 2014 10:42:37 +0000 (12:42 +0200)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 10 Nov 2014 11:40:49 +0000 (12:40 +0100)
The intent of the warning is to warn if the ADMA table
overflows.  However there can be one more 'end' entry
so the condition should be adjusted accordingly.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/sdhci.c

index e7593578d5b2318e79a37b52e6638296e0911fcd..4436f77f5d38a8db728befba8936d2d669c6ad5f 100644 (file)
@@ -555,7 +555,7 @@ static int sdhci_adma_table_pre(struct sdhci_host *host,
                 * If this triggers then we have a calculation bug
                 * somewhere. :/
                 */
-               WARN_ON((desc - host->adma_desc) > ADMA_SIZE);
+               WARN_ON((desc - host->adma_desc) >= ADMA_SIZE);
        }
 
        if (host->quirks & SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC) {