From patchwork Fri Apr 28 13:51:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 9704755 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 1AB7160225 for ; Fri, 28 Apr 2017 13:51:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0C7B02811E for ; Fri, 28 Apr 2017 13:51:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F380C2862A; Fri, 28 Apr 2017 13:51:39 +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.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY 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 980232811E for ; Fri, 28 Apr 2017 13:51:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1165541AbdD1Nvi (ORCPT ); Fri, 28 Apr 2017 09:51:38 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:17858 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1164414AbdD1Nvg (ORCPT ); Fri, 28 Apr 2017 09:51:36 -0400 Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v3SDpOEr027404 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 28 Apr 2017 13:51:25 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id v3SDpO4x030923 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 28 Apr 2017 13:51:24 GMT Received: from abhmp0012.oracle.com (abhmp0012.oracle.com [141.146.116.18]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id v3SDpNWY007788; Fri, 28 Apr 2017 13:51:23 GMT Received: from mwanda (/197.254.35.146) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 28 Apr 2017 06:51:22 -0700 Date: Fri, 28 Apr 2017 16:51:14 +0300 From: Dan Carpenter To: Mauro Carvalho Chehab , Alan Cox Cc: Greg Kroah-Hartman , Paul Gortmaker , =?iso-8859-1?B?Suly6W15?= Lefaure , kbuild test robot , linux-media@vger.kernel.org, devel@driverdev.osuosl.org, kernel-janitors@vger.kernel.org Subject: [PATCH] staging/atomisp: fix && vs || typos Message-ID: <20170428135114.w33djgm6tt7rvioi@mwanda> MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding User-Agent: NeoMutt/20170113 (1.7.2) X-Source-IP: userv0021.oracle.com [156.151.31.71] 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 These sanity checks don't work because they use && instead of ||. It's impossible to be both negative and greater than 5. Fixes: a49d25364dfb ("staging/atomisp: Add support for the Intel IPU v2") Signed-off-by: Dan Carpenter diff --git a/drivers/staging/media/atomisp/platform/clock/vlv2_plat_clock.c b/drivers/staging/media/atomisp/platform/clock/vlv2_plat_clock.c index a322539d2621..4b1fa9c7bb81 100644 --- a/drivers/staging/media/atomisp/platform/clock/vlv2_plat_clock.c +++ b/drivers/staging/media/atomisp/platform/clock/vlv2_plat_clock.c @@ -67,7 +67,7 @@ int vlv2_plat_set_clock_freq(int clk_num, int freq_type) { void __iomem *addr; - if (clk_num < 0 && clk_num > MAX_CLK_COUNT) { + if (clk_num < 0 || clk_num > MAX_CLK_COUNT) { pr_err("Clock number out of range (%d)\n", clk_num); return -EINVAL; } @@ -103,7 +103,7 @@ int vlv2_plat_get_clock_freq(int clk_num) { u32 ret; - if (clk_num < 0 && clk_num > MAX_CLK_COUNT) { + if (clk_num < 0 || clk_num > MAX_CLK_COUNT) { pr_err("Clock number out of range (%d)\n", clk_num); return -EINVAL; } @@ -133,7 +133,7 @@ int vlv2_plat_configure_clock(int clk_num, u32 conf) { void __iomem *addr; - if (clk_num < 0 && clk_num > MAX_CLK_COUNT) { + if (clk_num < 0 || clk_num > MAX_CLK_COUNT) { pr_err("Clock number out of range (%d)\n", clk_num); return -EINVAL; } @@ -169,7 +169,7 @@ int vlv2_plat_get_clock_status(int clk_num) { int ret; - if (clk_num < 0 && clk_num > MAX_CLK_COUNT) { + if (clk_num < 0 || clk_num > MAX_CLK_COUNT) { pr_err("Clock number out of range (%d)\n", clk_num); return -EINVAL; }