From patchwork Mon Mar 11 23:27:34 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Devendra Naga X-Patchwork-Id: 2251951 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id E46DBDF5B1 for ; Mon, 11 Mar 2013 23:27:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754753Ab3CKX1t (ORCPT ); Mon, 11 Mar 2013 19:27:49 -0400 Received: from mail-pb0-f49.google.com ([209.85.160.49]:36858 "EHLO mail-pb0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754427Ab3CKX1s (ORCPT ); Mon, 11 Mar 2013 19:27:48 -0400 Received: by mail-pb0-f49.google.com with SMTP id xa12so4249075pbc.8 for ; Mon, 11 Mar 2013 16:27:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:mime-version :content-type:content-transfer-encoding; bh=XLSAsUC/VAsOL4tTUTZC5cc5JcDwDeZ0YZ27IKEx0UI=; b=iCMNWTdTxyl1e6JwH5YuErpOKanszmhJ3f2Ni/Og6lLJR/q8NsvIv9GGRD8cKr5iBv mIqALF3UgCmPmb6E5vF1Ac3Fo13XqTb8WRLK3XzdQT60Aa7WgXXCEMRYFbjAHRsE60Hm AwGMt8vkD8AY8xnrsz5v9NKcowYIOaCyUKVP7Lrget0hFMU6DW3a+WvcEfvasvNhEhoO 096X1QV6jEWGc2O8B757K3mtXDXU2UIcTTyZhZKAU6/70cca591td8WcrHtWrsr+IsZX MpdiUPYU0je7ojXcZyfvQ/2os0SBU4xPrzEDPhURiEb2arq3L6KbtKhwA+YVtfOXhkfC c+dA== X-Received: by 10.68.245.229 with SMTP id xr5mr32396847pbc.163.1363044467553; Mon, 11 Mar 2013 16:27:47 -0700 (PDT) Received: from localhost.localdomain ([122.172.13.144]) by mx.google.com with ESMTPS id y1sm2829809pbg.10.2013.03.11.16.27.43 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 11 Mar 2013 16:27:46 -0700 (PDT) From: Devendra Naga To: Andrew Morton , device-drivers-devel@blackfin.uclinux.org, linux-fbdev@vger.kernel.org Cc: Devendra Naga , Jingoo Han , Michael Hennerich , Richard Purdie Subject: [PATCH v2] video: backlight: adp5520: fix compiler warning in adp5520_show Date: Mon, 11 Mar 2013 19:27:34 -0400 Message-Id: <1363044454-25111-1-git-send-email-devendra.aaru@gmail.com> X-Mailer: git-send-email 1.8.1.2 MIME-Version: 1.0 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org while compiling with make W=1 (gcc gcc (GCC) 4.7.2 20121109 (Red Hat 4.7.2-8)) found the following warning drivers/video/backlight/adp5520_bl.c: In function ‘adp5520_show’: drivers/video/backlight/adp5520_bl.c:146:6: warning: variable ‘error’ set but not used [-Wunused-but-set-variable] fixed by checking the return value of the variable Cc: Jingoo Han Cc: Michael Hennerich Cc: Richard Purdie Signed-off-by: Devendra Naga Acked-by: Jingoo Han --- drivers/video/backlight/adp5520_bl.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/video/backlight/adp5520_bl.c b/drivers/video/backlight/adp5520_bl.c index a1e41d4..d923f23 100644 --- a/drivers/video/backlight/adp5520_bl.c +++ b/drivers/video/backlight/adp5520_bl.c @@ -143,13 +143,16 @@ static int adp5520_bl_setup(struct backlight_device *bl) static ssize_t adp5520_show(struct device *dev, char *buf, int reg) { struct adp5520_bl *data = dev_get_drvdata(dev); - int error; + int ret; uint8_t reg_val; mutex_lock(&data->lock); - error = adp5520_read(data->master, reg, ®_val); + ret = adp5520_read(data->master, reg, ®_val); mutex_unlock(&data->lock); + if (ret < 0) + return ret; + return sprintf(buf, "%u\n", reg_val); }