From patchwork Wed Jun 1 08:37:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 9146439 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8753660757 for ; Wed, 1 Jun 2016 08:38:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 790D9200E7 for ; Wed, 1 Jun 2016 08:38:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6DBF826538; Wed, 1 Jun 2016 08:38:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E68E4200E7 for ; Wed, 1 Jun 2016 08:38:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757519AbcFAIiI (ORCPT ); Wed, 1 Jun 2016 04:38:08 -0400 Received: from mail-pf0-f177.google.com ([209.85.192.177]:34017 "EHLO mail-pf0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757504AbcFAIiD (ORCPT ); Wed, 1 Jun 2016 04:38:03 -0400 Received: by mail-pf0-f177.google.com with SMTP id 62so11033173pfd.1 for ; Wed, 01 Jun 2016 01:38:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=buLFhhV+M+yNMxERnrUGZqCYPD03/bGdZeOY4OEH2uA=; b=krjJD+ZHI+xJ1vfgeG1Z4t4e7ze8aFuyuBLLlbbrF1MRyqhv0iM8UkDYQkIT6rOG8d jrSokz1rF9ylVHNaM12JMqXGq4Le2WGmgL7xUT8JcsftHkq/4HYvv+sy0zJEYwqKUONJ NPlvlnv9mHFT+oDQF5D6OSsl+2WuCLCCHOuI4= 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=buLFhhV+M+yNMxERnrUGZqCYPD03/bGdZeOY4OEH2uA=; b=ZNd7GWTML3Ol+N//jf0i1LFD/VZF+MEcT1XC+nS18cITODhIOzIYHyqpSGC20F6ypf JQ9n5gW4AyA/D5IplJJSL/IPnYliqqNruda5Qvm8JvV3BtYuaPwyYo/4sbluKdUkTrp4 2GvrXHT3nwYzyn/Absc4tVKNWAWBtBL7Gttaqzn1VM1X78R4iKp6wtogq0TF/Lgc8PyH WI10fshuT4bWlOzytURogsH/ZvYfPm1o+FShaCa4i7qZSTyAVTYuuTXYT0xUQegdadJ5 7+ZtTBijdwlWW5XvCD8B3r2OHErX4/gVmrug1mYRAG+QwSE2Mi8Fkh7TXc3S6eGG/YVU 4v0Q== X-Gm-Message-State: ALyK8tLamveJ7MviESBezm652b8YT+X6vRXfteqSBGNxQcnYhHalraLFa/GakRdMweSxdJYe X-Received: by 10.98.43.210 with SMTP id r201mr6228866pfr.9.1464770282455; Wed, 01 Jun 2016 01:38:02 -0700 (PDT) Received: from localhost ([122.167.174.248]) by smtp.gmail.com with ESMTPSA id m68sm1345795pfb.27.2016.06.01.01.38.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Jun 2016 01:38:01 -0700 (PDT) From: Viresh Kumar To: tomi.valkeinen@ti.com Cc: Viresh Kumar , linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] fbdev: pxafb: clampval() doesn't update the variable Date: Wed, 1 Jun 2016 14:07:50 +0530 Message-Id: X-Mailer: git-send-email 2.7.1.410.g6faf27b Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP clampval() returns the clamped value instead of updating the variable itself. And the driver is using it in a wrong way. Fix it. Signed-off-by: Viresh Kumar --- drivers/video/fbdev/pxafb.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/video/fbdev/pxafb.c b/drivers/video/fbdev/pxafb.c index 2c0487f4f805..b1197980b9b1 100644 --- a/drivers/video/fbdev/pxafb.c +++ b/drivers/video/fbdev/pxafb.c @@ -417,12 +417,12 @@ static int pxafb_adjust_timing(struct pxafb_info *fbi, var->yres = max_t(int, var->yres, MIN_YRES); if (!(fbi->lccr0 & LCCR0_LCDT)) { - clamp_val(var->hsync_len, 1, 64); - clamp_val(var->vsync_len, 1, 64); - clamp_val(var->left_margin, 1, 255); - clamp_val(var->right_margin, 1, 255); - clamp_val(var->upper_margin, 1, 255); - clamp_val(var->lower_margin, 1, 255); + var->hsync_len = clamp_val(var->hsync_len, 1, 64); + var->vsync_len = clamp_val(var->vsync_len, 1, 64); + var->left_margin = clamp_val(var->left_margin, 1, 255); + var->right_margin = clamp_val(var->right_margin, 1, 255); + var->upper_margin = clamp_val(var->upper_margin, 1, 255); + var->lower_margin = clamp_val(var->lower_margin, 1, 255); } /* make sure each line is aligned on word boundary */