From patchwork Wed Nov 6 14:21:30 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ricardo Ribalda Delgado X-Patchwork-Id: 3147711 Return-Path: X-Original-To: patchwork-linux-media@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 6FF2C9F432 for ; Wed, 6 Nov 2013 14:22:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 87347202DD for ; Wed, 6 Nov 2013 14:22:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 34D9220295 for ; Wed, 6 Nov 2013 14:22:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756569Ab3KFOVo (ORCPT ); Wed, 6 Nov 2013 09:21:44 -0500 Received: from mail-la0-f47.google.com ([209.85.215.47]:57229 "EHLO mail-la0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756403Ab3KFOVn (ORCPT ); Wed, 6 Nov 2013 09:21:43 -0500 Received: by mail-la0-f47.google.com with SMTP id er20so3331351lab.20 for ; Wed, 06 Nov 2013 06:21:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:mime-version:content-type :content-transfer-encoding; bh=95brrLa9aI3HFWzl00QzvfrXZnEpUdBOUbG/WfxnAIc=; b=cDc4WOFGUqWUiiA4cJcvvHyCOkUzWVH/CBw6g1LcieulCDH1za4D1zIrF1yFEXYyOh zzzxQLGJqBdbVS8pdIufJ+LY/tEOZlLdkGnAcOqHyCOngcLEIWEM9WFx0EIoaKYUDqMz GO1o+TbmrZEM4tyaN7QIQAlphjat7FJfuQ+sja1FBe24jN0acId9P7rIRy7xlbisQM7i qxu+9CAczvLSqvt84e+qhnioyUtEG8YVljAKHGKf1kKwzG918GNdyLQsnNYmsXlN8pR+ utHFxXGnB+5S4FKOVgMYBvBdY0PcmejKW062oTyuAtyBj8/YihApzEshRDucXh+QqXvC LK5Q== X-Received: by 10.112.132.70 with SMTP id os6mr2147471lbb.38.1383747702078; Wed, 06 Nov 2013 06:21:42 -0800 (PST) Received: from neopili.qtec.com (0x4dd4aed9.adsl.cybercity.dk. [77.212.174.217]) by mx.google.com with ESMTPSA id o1sm33346930lah.8.2013.11.06.06.21.40 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Nov 2013 06:21:41 -0800 (PST) From: Ricardo Ribalda Delgado To: Sakari Ailus , Mauro Carvalho Chehab , linux-media@vger.kernel.org (open list:SMIA AND SMIA++ I...), linux-kernel@vger.kernel.org (open list) Cc: Ricardo Ribalda Delgado Subject: [PATCH] smiapp: Fix BUG_ON() on an impossible condition Date: Wed, 6 Nov 2013 15:21:30 +0100 Message-Id: <1383747690-20003-1-git-send-email-ricardo.ribalda@gmail.com> X-Mailer: git-send-email 1.8.4.rc3 MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 internal_csi_format_idx and csi_format_idx are unsigned integers, therefore they can never be nevative. CC drivers/media/i2c/smiapp/smiapp-core.o In file included from include/linux/err.h:4:0, from include/linux/clk.h:15, from drivers/media/i2c/smiapp/smiapp-core.c:29: drivers/media/i2c/smiapp/smiapp-core.c: In function ‘smiapp_update_mbus_formats’: include/linux/kernel.h:669:20: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] #define min(x, y) ({ \ ^ include/linux/compiler.h:153:42: note: in definition of macro ‘unlikely’ # define unlikely(x) __builtin_expect(!!(x), 0) ^ drivers/media/i2c/smiapp/smiapp-core.c:402:2: note: in expansion of macro ‘BUG_ON’ BUG_ON(min(internal_csi_format_idx, csi_format_idx) < 0); ^ drivers/media/i2c/smiapp/smiapp-core.c:402:9: note: in expansion of macro ‘min’ BUG_ON(min(internal_csi_format_idx, csi_format_idx) < 0); ^ Signed-off-by: Ricardo Ribalda Delgado Acked-by: Sakari Ailus --- drivers/media/i2c/smiapp/smiapp-core.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/media/i2c/smiapp/smiapp-core.c b/drivers/media/i2c/smiapp/smiapp-core.c index ae66d91..fbd48f0 100644 --- a/drivers/media/i2c/smiapp/smiapp-core.c +++ b/drivers/media/i2c/smiapp/smiapp-core.c @@ -399,7 +399,6 @@ static void smiapp_update_mbus_formats(struct smiapp_sensor *sensor) BUG_ON(max(internal_csi_format_idx, csi_format_idx) + pixel_order >= ARRAY_SIZE(smiapp_csi_data_formats)); - BUG_ON(min(internal_csi_format_idx, csi_format_idx) < 0); dev_dbg(&client->dev, "new pixel order %s\n", pixel_order_str[pixel_order]);