From patchwork Thu Aug 7 04:51:00 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Krause X-Patchwork-Id: 4689251 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 30C999F375 for ; Thu, 7 Aug 2014 04:50:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3B5AB20125 for ; Thu, 7 Aug 2014 04:50:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 562FE201CE for ; Thu, 7 Aug 2014 04:50:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757212AbaHGEuw (ORCPT ); Thu, 7 Aug 2014 00:50:52 -0400 Received: from mail-yh0-f68.google.com ([209.85.213.68]:57238 "EHLO mail-yh0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756481AbaHGEuv (ORCPT ); Thu, 7 Aug 2014 00:50:51 -0400 Received: by mail-yh0-f68.google.com with SMTP id b6so644002yha.11 for ; Wed, 06 Aug 2014 21:50:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id; bh=baD2v9LJlvT2FQwqadZkh6H7W0KMpi0blC+wV/vnIp4=; b=SM2sMm0C26SBu3qzmN7lHCMPktjyS5hz9VkVkwGkgmwo330wgkyCqa04+Phv4Coibq ZKcWlnXyL6RppoP3/dvYmmJKk239W2la/h+siX2ln9oMSLGJvvw/g+PlDUSM5jkO4C+K iibHaZyM/FxAqJsunrRDXnGudEk77ob62au0eWQT9Es3OkAAvK3gWU+3JeC2Bc2ZvYCl wQlt2OMoPOHJnnEP5gBJykmSJeiBVjujrK0zmT0XCdJR3oZAOgqsBAmkMVixbcmPWIMv n2/EVj526v/Hj90QMuNK9qVEys5BIaU7XBHKFFQ17WFnTn9+WLZnnwHjjui1nDhKdJmx WXUw== X-Received: by 10.236.21.193 with SMTP id r41mr174029yhr.179.1407387050725; Wed, 06 Aug 2014 21:50:50 -0700 (PDT) Received: from debian.gateway.pace.com (108-232-152-155.lightspeed.tukrga.sbcglobal.net. [108.232.152.155]) by mx.google.com with ESMTPSA id g25sm5654178yhc.25.2014.08.06.21.50.49 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 06 Aug 2014 21:50:50 -0700 (PDT) From: Nick Krause To: Mark Brown , linux-spi@vger.kernel.org (open list:SPI SUBSYSTEM), linux-kernel@vger.kernel.org (open list) Subject: [PATCH] spi: Initialize variable to prevent uninitialized warning Date: Thu, 7 Aug 2014 06:51:00 +0200 Message-Id: <1407387060-28992-1-git-send-email-xerofoiify@gmail.com> X-Mailer: git-send-email 2.0.1 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham 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 While compiling we see the following waring drivers/spi/spi-bfin5xx.c: In function 'bfin_spi_pump_transfers': drivers/spi/spi-bfin5xx.c:695:6: warning: 'cr_width' may be used uninitialized in this function [-Wuninitialized] Initialize it to prevent the above warning Signed-off-by: Nick Krause --- drivers/spi/spi-bfin5xx.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/spi/spi-bfin5xx.c b/drivers/spi/spi-bfin5xx.c index ebf720b..f268bf4 100644 --- a/drivers/spi/spi-bfin5xx.c +++ b/drivers/spi/spi-bfin5xx.c @@ -559,7 +559,7 @@ static void bfin_spi_pump_transfers(unsigned long data) struct spi_transfer *previous = NULL; struct bfin_spi_slave_data *chip = NULL; unsigned int bits_per_word; - u16 cr, cr_width, dma_width, dma_config; + u16 cr, cr_width = 0, dma_width, dma_config; u32 tranf_success = 1; u8 full_duplex = 0; @@ -648,7 +648,6 @@ static void bfin_spi_pump_transfers(unsigned long data) } else if (bits_per_word == 8) { drv_data->n_bytes = bits_per_word/8; drv_data->len = transfer->len; - cr_width = 0; drv_data->ops = &bfin_bfin_spi_transfer_ops_u8; } cr = bfin_read(&drv_data->regs->ctl) & ~(BIT_CTL_TIMOD | BIT_CTL_WORDSIZE);