From patchwork Wed Jan 2 10:45:49 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 16060 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1TqLxJ-0007jN-2q; Wed, 02 Jan 2013 11:53:53 +0100 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.75/mailfrontend-2) with esmtp id 1TqLxI-0003p6-H1; Wed, 02 Jan 2013 11:53:52 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752638Ab3ABKxu (ORCPT + 1 other); Wed, 2 Jan 2013 05:53:50 -0500 Received: from mail-pb0-f46.google.com ([209.85.160.46]:49534 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752633Ab3ABKxs (ORCPT ); Wed, 2 Jan 2013 05:53:48 -0500 Received: by mail-pb0-f46.google.com with SMTP id wy7so7768565pbc.19 for ; Wed, 02 Jan 2013 02:53:48 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=S8I6rGGUrF5ix1zkBMIDOn3wjhotm2UFQx4qP2Vllt0=; b=GMh2+ZPCvwKJc8oW9OAXjTShhUNJp7kxvr2B8VhcakQsKAs3k8pKFpW1/FxNgXkvar FVATDUF5QWoY+hcYYrcGAL1HAGdZf/fDxFEjMdMxHPmWh3aTmvyuMTdDJ5gW43igq8sn 94LcUCFr1a8a0GhcCAJqqnRxj2z4ogw1Qs+3h1Kl+nIVS7+dCUYH0Tg9PkbJ7wFX63L9 vfwjaGYBZd0GAlvnkIhcuFlkAHB1e6zgusY1cmxXVzcejLXOB+sjadfG6rEXCCK4rle5 BGtyyBqnMu3NWjzON4x7uTO3BG9Hzd22xIff2TTAa7JwvVsvg2qkZiopDrn4Ry6VcBPC Iz2w== X-Received: by 10.68.241.232 with SMTP id wl8mr142012150pbc.144.1357124028316; Wed, 02 Jan 2013 02:53:48 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id oz9sm28247908pbb.68.2013.01.02.02.53.45 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 02 Jan 2013 02:53:47 -0800 (PST) From: Sachin Kamat To: linux-media@vger.kernel.org Cc: k.debski@samsung.com, s.nawrocki@samsung.com, sylvester.nawrocki@gmail.com, sachin.kamat@linaro.org, patches@linaro.org Subject: [PATCH Resend] [media] s5p-mfc: Fix an error check Date: Wed, 2 Jan 2013 16:15:49 +0530 Message-Id: <1357123549-14264-1-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 X-Gm-Message-State: ALoCoQl6c3LEzxwLfc8vNVcLabhHWbMwK6U1dwovAxVebP3JgDh3BE0rKAVtt8HBETMfwUiri/Oy Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2013.1.2.104230 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' MULTIPLE_RCPTS 0.1, HTML_00_01 0.05, HTML_00_10 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1300_1399 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, URI_ENDS_IN_HTML 0, __ANY_URI 0, __CP_URI_IN_BODY 0, __HAS_FROM 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __MIME_TEXT_ONLY 0, __MULTIPLE_RCPTS_CC_X2 0, __SANE_MSGID 0, __SUBJ_ALPHA_END 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_WWW 0, __URI_NS , __YOUTUBE_RCVD 0' Checking unsigned variable for negative value always returns false. Hence make this value signed as we expect it to be negative too. Fixes the following smatch warning: drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c:572 s5p_mfc_set_enc_ref_buffer_v6() warn: unsigned 'buf_size1' is never less than zero. Signed-off-by: Sachin Kamat --- Added additional description in commit message. Please ignore the previous patch. --- drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c b/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c index 5f9a5e0..91d5087 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c @@ -535,8 +535,8 @@ void s5p_mfc_get_enc_frame_buffer_v6(struct s5p_mfc_ctx *ctx, int s5p_mfc_set_enc_ref_buffer_v6(struct s5p_mfc_ctx *ctx) { struct s5p_mfc_dev *dev = ctx->dev; - size_t buf_addr1, buf_size1; - int i; + size_t buf_addr1; + int i, buf_size1; mfc_debug_enter();