From patchwork Fri Apr 3 08:45:27 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 6154631 Return-Path: X-Original-To: patchwork-linux-spi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D8A9B9F398 for ; Fri, 3 Apr 2015 08:45:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 21915203B6 for ; Fri, 3 Apr 2015 08:45:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3B51D2037D for ; Fri, 3 Apr 2015 08:45:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753017AbbDCIpl (ORCPT ); Fri, 3 Apr 2015 04:45:41 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:32297 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752756AbbDCIpk (ORCPT ); Fri, 3 Apr 2015 04:45:40 -0400 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id t338jZJT004201 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 3 Apr 2015 08:45:35 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0022.oracle.com (8.13.8/8.13.8) with ESMTP id t338jYBe013499 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Fri, 3 Apr 2015 08:45:34 GMT Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by userv0121.oracle.com (8.13.8/8.13.8) with ESMTP id t338jYT4014269; Fri, 3 Apr 2015 08:45:34 GMT Received: from mwanda (/154.0.139.178) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 03 Apr 2015 01:45:33 -0700 Date: Fri, 3 Apr 2015 11:45:27 +0300 From: Dan Carpenter To: Mark Brown , Hiep Cao Minh Cc: linux-spi@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [patch] spi: signedness bug in qspi_trigger_transfer_out_int() Message-ID: <20150403084527.GA27292@mwanda> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-Source-IP: aserv0022.oracle.com [141.146.126.234] Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We need "ret" to be unsigned for the error handling to work. The signedness of "i" and "n" don't matter but qspi_set_send_trigger() returns an int so I've changed them to int as well. Fixes: 4b6fe3edcbba ('spi: Using Trigger number to transmit/receive data') Signed-off-by: Dan Carpenter --- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/spi/spi-rspi.c b/drivers/spi/spi-rspi.c index b3871d8..f6bac9e 100644 --- a/drivers/spi/spi-rspi.c +++ b/drivers/spi/spi-rspi.c @@ -727,7 +727,7 @@ static int rspi_rz_transfer_one(struct spi_master *master, static int qspi_trigger_transfer_out_int(struct rspi_data *rspi, const u8 *tx, u8 *rx, unsigned int len) { - unsigned int i, n, ret; + int i, n, ret; int error; while (len > 0) {