From patchwork Sun Jul 6 18:20:47 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rickard Strandqvist X-Patchwork-Id: 4490441 Return-Path: X-Original-To: patchwork-linux-fbdev@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 2056E9F36A for ; Sun, 6 Jul 2014 18:19:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 34DD7202A1 for ; Sun, 6 Jul 2014 18:19:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 37A34202EC for ; Sun, 6 Jul 2014 18:19:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751798AbaGFSTd (ORCPT ); Sun, 6 Jul 2014 14:19:33 -0400 Received: from mail-we0-f178.google.com ([74.125.82.178]:53626 "EHLO mail-we0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751696AbaGFSTc (ORCPT ); Sun, 6 Jul 2014 14:19:32 -0400 Received: by mail-we0-f178.google.com with SMTP id x48so3443425wes.37 for ; Sun, 06 Jul 2014 11:19:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=RyczQ/J+rDJqWJ7y+uJuVWyfe6FLXOQjnYY+b08pCCo=; b=a7SwOrcfkvrcbMPeBi2jBZNNMnmG5AN6rCC2NABxl4BlycgCBDGRTu3BQGu5ZcHUnW fKXwCw+phLgZG/HZ+3cP5NlLxIRRr/QMUvu/z7tXkc1KfLHC1Nyor1QVnEEw8MO/1PGY Do+yrwlpih0Bqpp8KkhywUuyT4SyruuBxvJ51xCXQvtQckf8JfyS/nlSsd45M3woVeyA u/YW+n5OmkRe1+w8FeZJVAx43nLvE1GjrImYN3CkAcSxqGGBL41+/5Mv8LfeEt0ZN1Cf Rv2yGF+rbT1Fceeo3nCB2hv5oobQOFU0kbrElFwcgWo2yvk0RJWOUoJKL0nxqQQXVnKA QLxw== X-Gm-Message-State: ALoCoQkFiJgJXPrdNzHtb/KhJmB12zhgGt5IRgSal5/BtwbXhRz8blrWIndXT64gUSGoWDPKMCiz X-Received: by 10.194.6.134 with SMTP id b6mr27328671wja.64.1404670771261; Sun, 06 Jul 2014 11:19:31 -0700 (PDT) Received: from localhost.localdomain (h-245-62.a218.priv.bahnhof.se. [85.24.245.62]) by mx.google.com with ESMTPSA id o9sm58899072wib.22.2014.07.06.11.19.29 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 06 Jul 2014 11:19:30 -0700 (PDT) From: Rickard Strandqvist To: Jingoo Han , Bryan Wu Cc: Rickard Strandqvist , Lee Jones , Jean-Christophe Plagniol-Villard , Tomi Valkeinen , linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] video: backlight: ili922x.c: Cleaning up variable that is never used Date: Sun, 6 Jul 2014 20:20:47 +0200 Message-Id: <1404670847-17249-1-git-send-email-rickard_strandqvist@spectrumdigital.se> X-Mailer: git-send-email 1.7.10.4 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, 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 Variable ar assigned a value that is never used. I have also removed all the code that thereby serves no purpose. This was found using a static code analysis program called cppcheck Signed-off-by: Rickard Strandqvist --- drivers/video/backlight/ili922x.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/video/backlight/ili922x.c b/drivers/video/backlight/ili922x.c index ea67fe1..06936c8 100644 --- a/drivers/video/backlight/ili922x.c +++ b/drivers/video/backlight/ili922x.c @@ -251,7 +251,7 @@ static int ili922x_write(struct spi_device *spi, u8 reg, u16 value) struct spi_transfer xfer_regindex, xfer_regvalue; unsigned char tbuf[CMD_BUFSIZE]; unsigned char rbuf[CMD_BUFSIZE]; - int ret, len = 0; + int ret; memset(&xfer_regindex, 0, sizeof(struct spi_transfer)); memset(&xfer_regvalue, 0, sizeof(struct spi_transfer)); @@ -273,7 +273,6 @@ static int ili922x_write(struct spi_device *spi, u8 reg, u16 value) ret = spi_sync(spi, &msg); spi_message_init(&msg); - len = 0; tbuf[0] = set_tx_byte(START_BYTE(ili922x_id, START_RS_REG, START_RW_WRITE)); tbuf[1] = set_tx_byte((value & 0xFF00) >> 8);