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: 68989 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp2403143qge; Wed, 1 Jun 2016 01:38:18 -0700 (PDT) X-Received: by 10.98.79.73 with SMTP id d70mr6287176pfb.120.1464770298284; Wed, 01 Jun 2016 01:38:18 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s15si49741246pfj.65.2016.06.01.01.38.18; Wed, 01 Jun 2016 01:38:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758171AbcFAIiJ (ORCPT + 30 others); Wed, 1 Jun 2016 04:38:09 -0400 Received: from mail-pf0-f179.google.com ([209.85.192.179]:35241 "EHLO mail-pf0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757554AbcFAIiE (ORCPT ); Wed, 1 Jun 2016 04:38:04 -0400 Received: by mail-pf0-f179.google.com with SMTP id g64so11029301pfb.2 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=dIZDjMgfEinQU/8xrCLRcMPOZtNny1TBiMf7D8x1UAEaE7pjNxRzKe5HvDnXxsneSy OUc0D4GZRKkzL/JzvjTGPwTidmz8VY7/2H69Fe7wXA8OnnQFZ0IxZdHKZjSGmqcqsEZg aU7Yfs+rwIy44PxUTG4mZi6ypYQMH4PUFy3DAN3g1AZCpT8n0sj4kCttyNGyYsf/FZNh ZSAHQWnSnJ93P0Z8bFQn8mObZo1hiWvTqB+iQHUjPGtXQ0surzv2Ll96rUMhAGJTHA74 3Q6KY2R2jfP5mZOl9xSy+zJ/hfzlaY8p5bmsoP0CrLfD/QH2d/nIinmHmApgNP0jkRp4 PIdQ== X-Gm-Message-State: ALyK8tK1Zmd35nGhCNb9KHgI99Oc739dZsI8QIWeXK/51gJ8jxINcyA+2X0YZ+Pgu8HQeo5y 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 2.7.1.410.g6faf27b 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 */