From patchwork Fri Sep 21 10:29:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 973139 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ovCacUW7"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="l5IVqiFV"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42GqmL5kPrz9s7T for ; Fri, 21 Sep 2018 20:37:22 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=hwpH1Z0lLH2wiy6FvoWpI4TTIAObVG8SOxM0ocRX1c8=; b=ovCacUW7F5rjGC GaqC2u6mbXTkUei+nbGq709jUVr6xNEdtyKAVMrbi1ms91OznyCQ8GwtPdtJhrRteTlqwqKgkQbWl hGFJZMLZr5F9vWN7XOuMUDI4kVAM2RDMe6sGgv+ZJgWJylzvHzJ7hloDrJXkws7cfu6O/F5ayA17v rzO/i5IA6kTm+mX8IK+dHOaI8rqi/deP4kB6ofhPKuue/WGqLN40yJnqPYDSBeg/JHUkaD8QQ0XCK Ya/VKglG4AMLIYFi7FODval2CWPP7/vVyRcSLg4LD3idqbOOcKZT+s1au7J+AYzrmA71I7iAKfdFr F5n9KOe5XHc69MH/p8Jg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1g3Io7-0000SV-9j; Fri, 21 Sep 2018 10:37:07 +0000 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1g3Ihf-0003ai-A8 for linux-mtd@lists.infradead.org; Fri, 21 Sep 2018 10:32:27 +0000 Received: by mail-wr1-x442.google.com with SMTP id 20-v6so12325552wrb.12 for ; Fri, 21 Sep 2018 03:30:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=UdARNFAJ5ijh3ybSKJa9nmt5Z3EXObF5UVXI5Dvdy0U=; b=l5IVqiFVkxNwBH8D6rZ4yW7vQHF2nrHngPB7fBqwU2l2Z2wZ7TzEKBIkoKXX+9eh5x 8gpxarcftOSGkEWcJhHNwxSncpdKPuhm4k856Bey3h7T0IorgM668Dza+Kiqcib0rZn0 tpxwWgRO2704hheWRq4UGgwKM+b4XzYmrzOPhFYtUQ4jmlJLgTEIbPvgMEPRljamdQ84 abttGCgrUchlyi2ZHgDS70KP5TELuvpydOZ1uUYvc6E46oR6pHoDYm0vdE0NUcsRPxSO BbZwfn7wyc+Jwv/eIK1+ZvTY58x9veHsCQGASC9GPtaA/BJqN5B7/eJXn9XYNvfcT0ZM Yw3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=UdARNFAJ5ijh3ybSKJa9nmt5Z3EXObF5UVXI5Dvdy0U=; b=Cqm9bE4kosfnKhDZSWqVw61YlihptIC8c2YrbZU2IrALJgBuMs3M5q8iKbrH1rBLrD MAHVhP8HEEpAcDHOFyAr/x51dQ4SYRskuRIcpuj0sqLy2jYKij5nrZShrf8e+6U1t/7e 5wjUU1OHHSLbBpFaJgfjm4noq3kErNAoZxizuqizkg26xIzBQUvRKBAC3v2dF52GfH3n oA7doEU8gTrQEcpuGQVZX4xzoy1RzhlACOChkBq3M/lIkGe1YKWExmt0GFG3eMEmC/4K VzR9NbwZQq/ZeMzRZ29dco0wffnvJuM/u2K0hx4hIT0ncodGMigoVnbc4lAbIjXssP0C w0pw== X-Gm-Message-State: ABuFfoi7V5kGuUVZfxL7ZKxIA7DQvu3pUTeHlQrfpje3t5hOxm2rnQKT hLgdVq9HyocIfTqfl4bhH3Fqmz0hK4W8ew== X-Google-Smtp-Source: ACcGV61KCl9oiWBHDrukWbStlVYAulsJSoOE0BhkZ3EcPb68uSeIPCRbAqz/3E9eKzXC4URsL2sMTg== X-Received: by 2002:adf:df0f:: with SMTP id y15-v6mr5624919wrl.26.1537525815108; Fri, 21 Sep 2018 03:30:15 -0700 (PDT) Received: from localhost.localdomain ([2a01:4f8:10b:24a5::2]) by smtp.gmail.com with ESMTPSA id s2-v6sm31991868wrn.83.2018.09.21.03.30.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 21 Sep 2018 03:30:14 -0700 (PDT) From: Nathan Chancellor To: Marek Vasut , David Woodhouse , Brian Norris , Boris Brezillon Subject: [PATCH] mtd: spi-nor: cadence-quadspi: Use proper enum for dma_unmap_single Date: Fri, 21 Sep 2018 03:29:45 -0700 Message-Id: <20180921102944.27968-1-natechancellor@gmail.com> X-Mailer: git-send-email 2.19.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180921_033027_473502_FEA9E607 X-CRM114-Status: GOOD ( 12.96 ) X-Spam-Note: SpamAssassin invocation failed X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Richard Weinberger , Nathan Chancellor , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Clang warns when one enumerated type is converted implicitly to another. drivers/mtd/spi-nor/cadence-quadspi.c:962:47: warning: implicit conversion from enumeration type 'enum dma_transfer_direction' to different enumeration type 'enum dma_data_direction' [-Wenum-conversion] dma_dst = dma_map_single(nor->dev, buf, len, DMA_DEV_TO_MEM); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~ ./include/linux/dma-mapping.h:428:66: note: expanded from macro 'dma_map_single' #define dma_map_single(d, a, s, r) dma_map_single_attrs(d, a, s, r, 0) ~~~~~~~~~~~~~~~~~~~~ ^ drivers/mtd/spi-nor/cadence-quadspi.c:997:43: warning: implicit conversion from enumeration type 'enum dma_transfer_direction' to different enumeration type 'enum dma_data_direction' [-Wenum-conversion] dma_unmap_single(nor->dev, dma_dst, len, DMA_DEV_TO_MEM); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~ ./include/linux/dma-mapping.h:429:70: note: expanded from macro 'dma_unmap_single' #define dma_unmap_single(d, a, s, r) dma_unmap_single_attrs(d, a, s, r, 0) ~~~~~~~~~~~~~~~~~~~~~~ ^ 2 warnings generated. Use the proper enums from dma_data_direction to satisfy Clang. DMA_TO_DEVICE = DMA_MEM_TO_DEV = 1 DMA_FROM_DEVICE = DMA_DEV_TO_MEM = 2 Link: https://github.com/ClangBuiltLinux/linux/issues/108 Signed-off-by: Nathan Chancellor Reviewed-by: Tudor Ambarus for v2! :) --- drivers/mtd/spi-nor/cadence-quadspi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/spi-nor/cadence-quadspi.c b/drivers/mtd/spi-nor/cadence-quadspi.c index 8e714fbfa521..d0e57ac81098 100644 --- a/drivers/mtd/spi-nor/cadence-quadspi.c +++ b/drivers/mtd/spi-nor/cadence-quadspi.c @@ -959,7 +959,7 @@ static int cqspi_direct_read_execute(struct spi_nor *nor, u_char *buf, return 0; } - dma_dst = dma_map_single(nor->dev, buf, len, DMA_DEV_TO_MEM); + dma_dst = dma_map_single(nor->dev, buf, len, DMA_FROM_DEVICE); if (dma_mapping_error(nor->dev, dma_dst)) { dev_err(nor->dev, "dma mapping failed\n"); return -ENOMEM; @@ -994,7 +994,7 @@ static int cqspi_direct_read_execute(struct spi_nor *nor, u_char *buf, } err_unmap: - dma_unmap_single(nor->dev, dma_dst, len, DMA_DEV_TO_MEM); + dma_unmap_single(nor->dev, dma_dst, len, DMA_TO_DEVICE); return 0; }