From patchwork Mon Dec 10 02:32:18 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 1855221 Return-Path: X-Original-To: patchwork-spi-devel-general@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by patchwork2.kernel.org (Postfix) with ESMTP id 07C1ADF230 for ; Mon, 10 Dec 2012 02:32:45 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=sfs-ml-4.v29.ch3.sourceforge.com) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1ThtAh-0001CA-Sc; Mon, 10 Dec 2012 02:32:43 +0000 Received: from sog-mx-4.v43.ch3.sourceforge.com ([172.29.43.194] helo=mx.sourceforge.net) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1ThtAf-0001C3-Ho for spi-devel-general@lists.sourceforge.net; Mon, 10 Dec 2012 02:32:42 +0000 Received-SPF: pass (sog-mx-4.v43.ch3.sourceforge.com: domain of gmail.com designates 209.85.213.47 as permitted sender) client-ip=209.85.213.47; envelope-from=festevam@gmail.com; helo=mail-yh0-f47.google.com; Received: from mail-yh0-f47.google.com ([209.85.213.47]) by sog-mx-4.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1ThtAd-0006mp-OB for spi-devel-general@lists.sourceforge.net; Mon, 10 Dec 2012 02:32:41 +0000 Received: by mail-yh0-f47.google.com with SMTP id g23so483062yhg.34 for ; Sun, 09 Dec 2012 18:32:34 -0800 (PST) Received: by 10.236.48.37 with SMTP id u25mr19544932yhb.4.1355106754411; Sun, 09 Dec 2012 18:32:34 -0800 (PST) Received: from localhost.localdomain ([186.207.91.39]) by mx.google.com with ESMTPS id a7sm24450614yhe.14.2012.12.09.18.32.32 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 09 Dec 2012 18:32:33 -0800 (PST) From: Fabio Estevam To: grant.likely@secretlab.ca Subject: [PATCH] spi: spi.c: Provide cast to avoid warning Date: Mon, 10 Dec 2012 00:32:18 -0200 Message-Id: <1355106738-14191-1-git-send-email-festevam@gmail.com> X-Mailer: git-send-email 1.7.9.5 X-Spam-Score: -1.6 (-) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (festevam[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-Headers-End: 1ThtAd-0006mp-OB Cc: Fabio Estevam , spi-devel-general@lists.sourceforge.net, broonie@opensource.wolfsonmicro.com X-BeenThere: spi-devel-general@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: Linux SPI core/device drivers discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: spi-devel-general-bounces@lists.sourceforge.net From: Fabio Estevam commit b3a223ee2d (spi: Remove SPI_BUFSIZ restriction on spi_write_then_read()) introduced the following build warning: drivers/spi/spi.c:1655:355: warning: comparison of distinct pointer types lacks a cast [enabled by default] Provide the cast to avoid the warning. Signed-off-by: Fabio Estevam --- drivers/spi/spi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 224b7bc..78fcff0 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -1652,7 +1652,8 @@ int spi_write_then_read(struct spi_device *spi, * using the pre-allocated buffer or the transfer is too large. */ if ((n_tx + n_rx) > SPI_BUFSIZ || !mutex_trylock(&lock)) { - local_buf = kmalloc(max(SPI_BUFSIZ, n_tx + n_rx), GFP_KERNEL); + local_buf = kmalloc(max((unsigned)SPI_BUFSIZ, n_tx + n_rx), + GFP_KERNEL); if (!local_buf) return -ENOMEM; } else {