From patchwork Thu Apr 12 15:24:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 10338839 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 22803602D8 for ; Thu, 12 Apr 2018 15:24:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 15AD927CEE for ; Thu, 12 Apr 2018 15:24:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0923627EE2; Thu, 12 Apr 2018 15:24:20 +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=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 78A2427CEE for ; Thu, 12 Apr 2018 15:24:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753464AbeDLPYR (ORCPT ); Thu, 12 Apr 2018 11:24:17 -0400 Received: from osg.samsung.com ([64.30.133.232]:36473 "EHLO osg.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753051AbeDLPYP (ORCPT ); Thu, 12 Apr 2018 11:24:15 -0400 Received: from localhost (localhost [127.0.0.1]) by osg.samsung.com (Postfix) with ESMTP id AB49B1CF5C; Thu, 12 Apr 2018 08:24:14 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at dev.s-opensource.com X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from osg.samsung.com ([127.0.0.1]) by localhost (localhost [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6_2MeEfJTh5u; Thu, 12 Apr 2018 08:24:13 -0700 (PDT) Received: from smtp.s-opensource.com (unknown [179.179.40.138]) by osg.samsung.com (Postfix) with ESMTPSA id 34B971CF3B; Thu, 12 Apr 2018 08:24:13 -0700 (PDT) Received: from mchehab by smtp.s-opensource.com with local (Exim 4.90_1) (envelope-from ) id 1f6e55-0005SK-5R; Thu, 12 Apr 2018 11:24:11 -0400 From: Mauro Carvalho Chehab Cc: Mauro Carvalho Chehab , Linux Media Mailing List , Mauro Carvalho Chehab , Alan Cox , Sakari Ailus , Greg Kroah-Hartman , Andy Shevchenko , Hans de Goede , Avraham Shukron , Aishwarya Pant , Pierre-Louis Bossart , devel@driverdev.osuosl.org Subject: [PATCH 08/17] atomisp: remove an impossible condition Date: Thu, 12 Apr 2018 11:24:00 -0400 Message-Id: X-Mailer: git-send-email 2.14.3 In-Reply-To: References: In-Reply-To: References: To: unlisted-recipients:; (no To-header on input) Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Changeset dc9f65cf9aea ("media: staging: atomisp: avoid a warning if 32 bits build") was meant to solve an impossible condition when building with 32 bits. It turns that this impossible condition also happens wit 64 bits: drivers/staging/media/atomisp/platform/intel-mid/atomisp_gmin_platform.c:698 gmin_get_config_var() warn: impossible condition '(*out_len > (~0)) => (0-u64max > u64max)' After a further analysis, this condition will always be false as, on all architectures, size_t doesn't have more bits than unsigned long. Also, the only two archs that really matter are x86 and x86_64, as this driver doesn't build on other archs (as it depends on X86-specific UEFI support). So, just drop the useless code. Fixes: dc9f65cf9aea ("media: staging: atomisp: avoid a warning if 32 bits build") Signed-off-by: Mauro Carvalho Chehab --- .../media/atomisp/platform/intel-mid/atomisp_gmin_platform.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/staging/media/atomisp/platform/intel-mid/atomisp_gmin_platform.c b/drivers/staging/media/atomisp/platform/intel-mid/atomisp_gmin_platform.c index 3283c1b05d6a..70c34de98707 100644 --- a/drivers/staging/media/atomisp/platform/intel-mid/atomisp_gmin_platform.c +++ b/drivers/staging/media/atomisp/platform/intel-mid/atomisp_gmin_platform.c @@ -693,12 +693,6 @@ static int gmin_get_config_var(struct device *dev, const char *var, for (i = 0; i < sizeof(var8) && var8[i]; i++) var16[i] = var8[i]; -#ifdef CONFIG_64BIT - /* To avoid owerflows when calling the efivar API */ - if (*out_len > ULONG_MAX) - return -EINVAL; -#endif - /* Not sure this API usage is kosher; efivar_entry_get()'s * implementation simply uses VariableName and VendorGuid from * the struct and ignores the rest, but it seems like there