From patchwork Wed May 27 07:11:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 11572099 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AEC6F90 for ; Wed, 27 May 2020 07:12:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 969F220B80 for ; Wed, 27 May 2020 07:12:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="tqxJOttP" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729052AbgE0HMM (ORCPT ); Wed, 27 May 2020 03:12:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728303AbgE0HML (ORCPT ); Wed, 27 May 2020 03:12:11 -0400 Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 751FBC061A0F; Wed, 27 May 2020 00:12:11 -0700 (PDT) Received: by mail-pg1-x543.google.com with SMTP id d10so11370032pgn.4; Wed, 27 May 2020 00:12:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=lhqAHEvRLnCQw7o+jUfsPtsKFyOebABISvsPaRwN9pA=; b=tqxJOttPm9K91CJ00mLJnUiAm1t1uMYT9X8Uz2q1H8u9cWNxW1ufnkn62fGcdyZewN 2+9ifHAzzHrwSgF7fZcih1x3rXo5v9q6lIJRcqUw3kMRr29v7wuE1aATEWiY0a1OsTx4 HafOHxpmDKCCFWMX70fPy0aPqsABeWUCUuERe5uOwWo1cxhFPfYjFVW+aqSaGBcF11oN UT+X71CayWscpuzgUOtuN2809KmW3/BQjrcbddJGInKHdb4bsnaSKRUQj44HEvaIfOYo kDvygzPkh025tfoujSQyefU39dt/TUqTWQvz1LgeRmjYVAN1vJ9pYe/Qel+Aj6OPCyIm RjVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=lhqAHEvRLnCQw7o+jUfsPtsKFyOebABISvsPaRwN9pA=; b=nPUzTcIWzqEab2T0nfQVgEY7AwxMSVpiooylGmFEYCCSkV5zAYIucXffVdp5w+U1Bv W+bQ1bVHWDqrjcUqy0b9/GPEv18jQ7E4NlSxhT5O4wx0yJ4nnQs8RThkEjlIr6Mbwlpf DbB/Zh5IRe5mYL/ILlpVpBrcab7ENutHKITmMOtLSawrpWFoiTsyWXuiUp052dCvKdqA NtgVT86LQfuDSmP1XzP/W/4ypsdH4muu9dXECEZz1IpELLzkkKlLFlf5qb2oyUD9nPlc VR5/erTJSoFD5Lt6NgRSxB7FLx1/UYWO457Cl9+NnckkPJQNo9QNh24VrwI/zfI9dRNo i/tQ== X-Gm-Message-State: AOAM530h81LNyq8jRmFAikLDc0/1RZP/rOYxdUvfvJgRsXnRB6blKeJQ Sk6l8SpOhIyCROmKRY8SNKk= X-Google-Smtp-Source: ABdhPJxJ26ZoY/VgMQTRMEVnpnq9cud32xiSg/d3bcZs3eFcYav/pHsIvDXVtq4L/0Mqm9sua55Yiw== X-Received: by 2002:a62:7c02:: with SMTP id x2mr2597592pfc.70.1590563530733; Wed, 27 May 2020 00:12:10 -0700 (PDT) Received: from localhost.localdomain ([2604:1380:4111:8b00::1]) by smtp.gmail.com with ESMTPSA id 10sm1306431pfx.138.2020.05.27.00.12.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 May 2020 00:12:10 -0700 (PDT) From: Nathan Chancellor To: Mauro Carvalho Chehab Cc: Sakari Ailus , linux-media@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, Nathan Chancellor , kbuild test robot Subject: [PATCH 1/7] media: atomisp: Clean up if block in sh_css_sp_init_stage Date: Wed, 27 May 2020 00:11:44 -0700 Message-Id: <20200527071150.3381228-2-natechancellor@gmail.com> X-Mailer: git-send-email 2.27.0.rc0 In-Reply-To: <20200527071150.3381228-1-natechancellor@gmail.com> References: <20200527071150.3381228-1-natechancellor@gmail.com> MIME-Version: 1.0 X-Patchwork-Bot: notify Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Clang warns: ../drivers/staging/media/atomisp/pci/sh_css_sp.c:1039:23: warning: address of 'binary->in_frame_info' will always evaluate to 'true' [-Wpointer-bool-conversion] } else if (&binary->in_frame_info) { ~~ ~~~~~~~~^~~~~~~~~~~~~ in_frame_info is not a pointer so if binary is not NULL, in_frame_info's address cannot be NULL. Change this to an else since it will always be evaluated as one. While we are here, clean up this if block. The contents of both if blocks are the same but a check against "stage == 0" is added when ISP2401 is defined. USE_INPUT_SYSTEM_VERSION_2401 is only defined when isp2401_system_global.h is included, which only happens when ISP2401. In other words, USE_INPUT_SYSTEM_VERSION_2401 always requires ISP2401 to be defined so the '#ifndef ISP2401' makes no sense. Remove that part of the block to simplify everything. Link: https://github.com/ClangBuiltLinux/linux/issues/1036 Reported-by: kbuild test robot Signed-off-by: Nathan Chancellor --- drivers/staging/media/atomisp/pci/sh_css_sp.c | 27 +++---------------- 1 file changed, 4 insertions(+), 23 deletions(-) base-commit: 938b29db3aa9c293c7c1366b16e55e308f1a1ddd diff --git a/drivers/staging/media/atomisp/pci/sh_css_sp.c b/drivers/staging/media/atomisp/pci/sh_css_sp.c index e574396ad0f4..e242a539d3d8 100644 --- a/drivers/staging/media/atomisp/pci/sh_css_sp.c +++ b/drivers/staging/media/atomisp/pci/sh_css_sp.c @@ -1015,34 +1015,15 @@ sh_css_sp_init_stage(struct ia_css_binary *binary, return err; #ifdef USE_INPUT_SYSTEM_VERSION_2401 -#ifndef ISP2401 - if (args->in_frame) - { - pipe = find_pipe_by_num(sh_css_sp_group.pipe[thread_id].pipe_num); - if (!pipe) - return IA_CSS_ERR_INTERNAL_ERROR; - ia_css_get_crop_offsets(pipe, &args->in_frame->info); - } else if (&binary->in_frame_info) - { + if (stage == 0) { pipe = find_pipe_by_num(sh_css_sp_group.pipe[thread_id].pipe_num); if (!pipe) return IA_CSS_ERR_INTERNAL_ERROR; - ia_css_get_crop_offsets(pipe, &binary->in_frame_info); -#else - if (stage == 0) - { - if (args->in_frame) { - pipe = find_pipe_by_num(sh_css_sp_group.pipe[thread_id].pipe_num); - if (!pipe) - return IA_CSS_ERR_INTERNAL_ERROR; + + if (args->in_frame) ia_css_get_crop_offsets(pipe, &args->in_frame->info); - } else if (&binary->in_frame_info) { - pipe = find_pipe_by_num(sh_css_sp_group.pipe[thread_id].pipe_num); - if (!pipe) - return IA_CSS_ERR_INTERNAL_ERROR; + else ia_css_get_crop_offsets(pipe, &binary->in_frame_info); - } -#endif } #else (void)pipe; /*avoid build warning*/ From patchwork Wed May 27 07:11:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 11572109 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C598D1392 for ; Wed, 27 May 2020 07:12:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id ADA5B20E65 for ; Wed, 27 May 2020 07:12:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="rAvssvWz" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729120AbgE0HMR (ORCPT ); Wed, 27 May 2020 03:12:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33028 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728303AbgE0HMO (ORCPT ); Wed, 27 May 2020 03:12:14 -0400 Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 549F3C061A0F; Wed, 27 May 2020 00:12:13 -0700 (PDT) Received: by mail-pg1-x543.google.com with SMTP id u5so11377230pgn.5; Wed, 27 May 2020 00:12:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Qw/QOLBu9d2B+96STuqYNI0AftO5l6SG5yefrjTDHdQ=; b=rAvssvWz49+fXzXPapINBcDmFBTZ01RO2hMId+vgCJN3AG63BmjX55x7SQCy71kRyl Aq0VWotduyCwmPny7lrc0pWTiCgpE0weYmufy41TJVpo1hIV/C2GkMOzqcQzhjRhKz1+ r/3q1R8nKhc3wAdHpKSCi/CO48ZFFlGTCM2OUa+PNJbGUpzypAhFiqxYq7rnduqbTk4j PJz2M1SmoOlh5WLkVTvtL/NyMWz2pHepmil5fNaJhItpgj4fT/Zb4biKCGcYNTRp32lA tR+jWjuGDJ+jG9ggkd6y1wPjtHhMpR0j8LjE7SWvY/P4Xf3NvfZ4WG+bPRHcSt04qoZr 86SA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Qw/QOLBu9d2B+96STuqYNI0AftO5l6SG5yefrjTDHdQ=; b=GpQTR7+78/WT7niShc+vwd1HlMZ3SxvS9J04OwuMvVEYdaEhyTHtSDCEMJj8K5Enzt yostugGE+dsoh48LbGTqcjAXgtgNJov1+hcOslifkT75/fsA1jp0ufek2H6/z9HzcjpX tX4oDmsE3yEpvN/ghPIU6Y1noi/+V6DPXLyFXivxPRck1urkaOgcuQ0xD4zswC53xND4 1TpUBelTCx7mMe+fEUV9ER/ptTEbAo/xge6ETZVBte3AVPO7JaYPFooXPPfkIPPMQ7NO dgCS4yWtvc2bysQOmG1c6RV46egt18itV3qZ3Ix4OffhE62Eocsw6d3CIbv5Alour/RV bA0Q== X-Gm-Message-State: AOAM533tKtVMXTfHc4Hl6CENW2k95o2sIoo6IIJiWYf7UD6P11Da7rAv cEbRiHvq/aAtdEqBK6q5EFA= X-Google-Smtp-Source: ABdhPJwiMdlTneuDy4qlJ6WknGzBgbOnwG5sxxkqaefuDqkk6jhGJu9u7DEVNg4VjcPowgRDxL0hMg== X-Received: by 2002:a63:3c0a:: with SMTP id j10mr2734873pga.35.1590563532903; Wed, 27 May 2020 00:12:12 -0700 (PDT) Received: from localhost.localdomain ([2604:1380:4111:8b00::1]) by smtp.gmail.com with ESMTPSA id 10sm1306431pfx.138.2020.05.27.00.12.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 May 2020 00:12:12 -0700 (PDT) From: Nathan Chancellor To: Mauro Carvalho Chehab Cc: Sakari Ailus , linux-media@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, Nathan Chancellor , kbuild test robot Subject: [PATCH 2/7] media: atomisp: Remove second increment of count in atomisp_subdev_probe Date: Wed, 27 May 2020 00:11:45 -0700 Message-Id: <20200527071150.3381228-3-natechancellor@gmail.com> X-Mailer: git-send-email 2.27.0.rc0 In-Reply-To: <20200527071150.3381228-1-natechancellor@gmail.com> References: <20200527071150.3381228-1-natechancellor@gmail.com> MIME-Version: 1.0 X-Patchwork-Bot: notify Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Clang warns: ../drivers/staging/media/atomisp/pci/atomisp_v4l2.c:1097:3: warning: variable 'count' is incremented both in the loop header and in the loop body [-Wfor-loop-analysis] count++; ^ This was probably unintentional, remove it. Link: https://github.com/ClangBuiltLinux/linux/issues/1036 Reported-by: kbuild test robot Signed-off-by: Nathan Chancellor --- drivers/staging/media/atomisp/pci/atomisp_v4l2.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/media/atomisp/pci/atomisp_v4l2.c b/drivers/staging/media/atomisp/pci/atomisp_v4l2.c index 694268d133c0..c42999a55303 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_v4l2.c +++ b/drivers/staging/media/atomisp/pci/atomisp_v4l2.c @@ -1094,7 +1094,6 @@ static int atomisp_subdev_probe(struct atomisp_device *isp) if (camera_count) break; msleep(SUBDEV_WAIT_TIMEOUT); - count++; } /* Wait more time to give more time for subdev init code to finish */ msleep(5 * SUBDEV_WAIT_TIMEOUT); From patchwork Wed May 27 07:11:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 11572111 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D1B961392 for ; Wed, 27 May 2020 07:12:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B4DF8208FE for ; Wed, 27 May 2020 07:12:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="TF+ZnVGl" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729102AbgE0HMR (ORCPT ); Wed, 27 May 2020 03:12:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729098AbgE0HMQ (ORCPT ); Wed, 27 May 2020 03:12:16 -0400 Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1450BC03E97A; Wed, 27 May 2020 00:12:15 -0700 (PDT) Received: by mail-pf1-x441.google.com with SMTP id q8so11447902pfu.5; Wed, 27 May 2020 00:12:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=TS7T0GnvahIo34Ueh1mEB91ydpyvQ6Kv78CuMyjghNI=; b=TF+ZnVGlHYlycvaTVaXADyYL0RJeFIrCgBOXxgVjtkEbW1aFo47roQVqe4rimM5XaO 0jyPywtYKRd5OylJ6q2ztpi5amDIDSk4F/HP1rcZS61pV+2bP3Et1MOVRJECN4eq3V8K FhE0s9dL0s1W8dAdY7kR8nRl9Cae8qgIRE7TTpJvULSdbuSW46zLeHNOj6acvZ2i0BfU pyr8DtUCyPOWPD0v9PLq5XCcVmfBlD0cEbSbuEt9ikkbHzhXwLtO6p2lZgfzYwu/t6dL vDoVwfTgGtDeyjnENBL9+L74uybPBlYZvUrtsfs5J6Wrz90fcfapibK46F9n+2Hs1C3F Tw6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=TS7T0GnvahIo34Ueh1mEB91ydpyvQ6Kv78CuMyjghNI=; b=rxFiqbjxXCVynAGPeCGXwlgT0Wr9dRpJkbxGmHBsn1hpBJip75sFjp9fPmAzce8eEu n6EzjVsQy5ts4Wv5Om45lnuzt1INXhsOJVq9BRE8E4QbwvknGXyS26U8eRu7F4t3QSHZ 5GJiQs+kLHONbRmdnolUN2uFbzFoUVErAR3NHQ0Ehg+g5HbSQSOoWQqOXbdfBDJoExMl DLG9pMbrUmk1R4qYT7ITcJK7yy4PEf9BezyGISiFAnHA7Y12qvabQyh6YKEJTvfjnZF0 IAXqhKCuTuLNg7/fIRdeQALUEbycfsxGEKu3G8oTe72IOZOIAvT6azPN06jyib9cIw/q Yoeg== X-Gm-Message-State: AOAM531ZC9ijKxYdQDEWrHIvob9MEKZQ4Wc+0E35RjXhQ4Vdx+qmgCnB uZwj6cYtiVtO8c0Mrd5FVPQ= X-Google-Smtp-Source: ABdhPJwQC4jQeNUEVSfWcbDH8TBVkeO48J33ab8uL53x2ElsZaurgFDeuYMlkbqz8HFBeHrwQ0mRWQ== X-Received: by 2002:a62:a50a:: with SMTP id v10mr2720546pfm.134.1590563535044; Wed, 27 May 2020 00:12:15 -0700 (PDT) Received: from localhost.localdomain ([2604:1380:4111:8b00::1]) by smtp.gmail.com with ESMTPSA id 10sm1306431pfx.138.2020.05.27.00.12.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 May 2020 00:12:14 -0700 (PDT) From: Nathan Chancellor To: Mauro Carvalho Chehab Cc: Sakari Ailus , linux-media@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, Nathan Chancellor Subject: [PATCH 3/7] media: atomisp: Add stub for atomisp_mrfld_power Date: Wed, 27 May 2020 00:11:46 -0700 Message-Id: <20200527071150.3381228-4-natechancellor@gmail.com> X-Mailer: git-send-email 2.27.0.rc0 In-Reply-To: <20200527071150.3381228-1-natechancellor@gmail.com> References: <20200527071150.3381228-1-natechancellor@gmail.com> MIME-Version: 1.0 X-Patchwork-Bot: notify Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Clang warns: ../drivers/staging/media/atomisp/pci/atomisp_v4l2.c:764:12: warning: unused function 'atomisp_mrfld_power' [-Wunused-function] static int atomisp_mrfld_power(struct atomisp_device *isp, bool enable) ^ Use an '#if 0' preprocessor define to hide the broken code, leaving the FIXME comment intact, and creating an atomisp_mrfld_power stub function that just returns 0. Fixes: 95d1f398c4dc ("media: atomisp: keep the ISP powered on when setting it") Link: https://github.com/ClangBuiltLinux/linux/issues/1036 Signed-off-by: Nathan Chancellor --- drivers/staging/media/atomisp/pci/atomisp_v4l2.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/staging/media/atomisp/pci/atomisp_v4l2.c b/drivers/staging/media/atomisp/pci/atomisp_v4l2.c index c42999a55303..41aa6018d254 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_v4l2.c +++ b/drivers/staging/media/atomisp/pci/atomisp_v4l2.c @@ -736,6 +736,8 @@ static int atomisp_mrfld_pre_power_down(struct atomisp_device *isp) * WA for DDR DVFS enable/disable * By default, ISP will force DDR DVFS 1600MHz before disable DVFS */ +/* FIXME: at least with ISP2401, the code below causes the driver to break */ +#if 0 static void punit_ddr_dvfs_enable(bool enable) { int door_bell = 1 << 8; @@ -820,20 +822,23 @@ static int atomisp_mrfld_power(struct atomisp_device *isp, bool enable) dev_err(isp->dev, "IUNIT power-%s timeout.\n", enable ? "on" : "off"); return -EBUSY; } +#else +static int atomisp_mrfld_power(struct atomisp_device *isp, bool enable) +{ + return 0; +} +#endif /* Workaround for pmu_nc_set_power_state not ready in MRFLD */ int atomisp_mrfld_power_down(struct atomisp_device *isp) { - return 0; -// FIXME: at least with ISP2401, the code below causes the driver to break -// return atomisp_mrfld_power(isp, false); + return atomisp_mrfld_power(isp, false); } /* Workaround for pmu_nc_set_power_state not ready in MRFLD */ int atomisp_mrfld_power_up(struct atomisp_device *isp) { return 0; -// FIXME: at least with ISP2401, the code below causes the driver to break // return atomisp_mrfld_power(isp, true); } From patchwork Wed May 27 07:11:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 11572107 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 13DCF90 for ; Wed, 27 May 2020 07:12:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EA35A20C56 for ; Wed, 27 May 2020 07:12:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="cJB55FZz" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729235AbgE0HMf (ORCPT ); Wed, 27 May 2020 03:12:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729126AbgE0HMS (ORCPT ); Wed, 27 May 2020 03:12:18 -0400 Received: from mail-pl1-x642.google.com (mail-pl1-x642.google.com [IPv6:2607:f8b0:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12F8FC03E979; Wed, 27 May 2020 00:12:18 -0700 (PDT) Received: by mail-pl1-x642.google.com with SMTP id k22so9806036pls.10; Wed, 27 May 2020 00:12:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=o9MqodWCLjikP8AmTG/rqhpi4jiJNC1PbUROm6v1d2Y=; b=cJB55FZzIe+wbZbOjO4+gkJQe15YMlmFQTxt+DZL0GpogJ10Wqsx3OHLygNdzhlD5t qE7H8Jj4R+LviV2dMs8V7qO5bBlsYuG68ANB7g0XTKFzNNeT0SXRE6zDFXFCxmznfA0v mN5KMi5gIwI48uC8b0Kcgk4k/59LITp4LV3NEwAqBrNzC7VqiBGxnIumjWCigThafMq3 B6nQmRcMCtEBFe8j8GqQkP9nw6oMqmMpWAHy/oAYFQnqJTvKLst21e2EXIA7wlvDmudE U2eAYVMwlIYwiraTrd8FmigcrRtv/pRy5jFwCFoJ5eV++L8RCEmfTVmIq6A1BuASY/d+ 6ORA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=o9MqodWCLjikP8AmTG/rqhpi4jiJNC1PbUROm6v1d2Y=; b=htm1jZ9zFvSDzi85pUCoUDZB5aIAhaVh2/VJNwZ3N93vig+xomt0HOFk0uWiEn/DVR HqiYiFZsdCAqK3YTDKvljqx53eEaC3w+REM7/SZeL2jXUccnIh9KGy6PK7z+e8m9Ql/f HW3SxwLHdumgEbDV6udnciXYGMZ4m48VL3KZO9yzbKbmfXGEcmeGYzKxCPEvcil7Xd+b c3zM9driQzbpLJhANsXzBiFW6mbIWxxO/A1m+4ZRolsUO4utH4bVT++rTTk43BcWG1K/ 64I2kCAUz+fVWCBUzr9pM9rAcIlCcpFa7hSC1/0wud9VTHYDXB8EfyNrjdwmDFKSJbc3 ayIQ== X-Gm-Message-State: AOAM531XSKKDxShFU/IicWFxEzFoiptf4Ds1qysqESomZU2upjLgh6Mp Zsy+tu3JcH63VxBpKCfxcYF4zcpnniY= X-Google-Smtp-Source: ABdhPJxoHRdGCzwo58GDaHJ6G/BJrSAN4ab49i2zjyZzqDrlxy7DIG+b4ZCydP80auPUjGxfCvGnNg== X-Received: by 2002:a17:902:8d8d:: with SMTP id v13mr4730527plo.67.1590563537552; Wed, 27 May 2020 00:12:17 -0700 (PDT) Received: from localhost.localdomain ([2604:1380:4111:8b00::1]) by smtp.gmail.com with ESMTPSA id 10sm1306431pfx.138.2020.05.27.00.12.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 May 2020 00:12:16 -0700 (PDT) From: Nathan Chancellor To: Mauro Carvalho Chehab Cc: Sakari Ailus , linux-media@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, Nathan Chancellor Subject: [PATCH 4/7] media: atomisp: Remove unnecessary NULL checks in ia_css_pipe_load_extension Date: Wed, 27 May 2020 00:11:47 -0700 Message-Id: <20200527071150.3381228-5-natechancellor@gmail.com> X-Mailer: git-send-email 2.27.0.rc0 In-Reply-To: <20200527071150.3381228-1-natechancellor@gmail.com> References: <20200527071150.3381228-1-natechancellor@gmail.com> MIME-Version: 1.0 X-Patchwork-Bot: notify Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Clang warns: ../drivers/staging/media/atomisp/pci/sh_css.c:8537:14: warning: address of 'pipe->output_stage' will always evaluate to 'true' [-Wpointer-bool-conversion] if (&pipe->output_stage) ~~ ~~~~~~^~~~~~~~~~~~ ../drivers/staging/media/atomisp/pci/sh_css.c:8545:14: warning: address of 'pipe->vf_stage' will always evaluate to 'true' [-Wpointer-bool-conversion] if (&pipe->vf_stage) ~~ ~~~~~~^~~~~~~~ output_stage and vf_stage are pointers in the middle of a struct, their addresses cannot be NULL if pipe is not NULL and pipe is already checked for NULL in this function. Simplify this if block. Link: https://github.com/ClangBuiltLinux/linux/issues/1036 Signed-off-by: Nathan Chancellor --- drivers/staging/media/atomisp/pci/sh_css.c | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/drivers/staging/media/atomisp/pci/sh_css.c b/drivers/staging/media/atomisp/pci/sh_css.c index d77432254a2c..b8626cdb2436 100644 --- a/drivers/staging/media/atomisp/pci/sh_css.c +++ b/drivers/staging/media/atomisp/pci/sh_css.c @@ -8533,22 +8533,9 @@ ia_css_pipe_load_extension(struct ia_css_pipe *pipe, } if (firmware->info.isp.type == IA_CSS_ACC_OUTPUT) - { - if (&pipe->output_stage) - append_firmware(&pipe->output_stage, firmware); - else { - IA_CSS_LEAVE_ERR_PRIVATE(IA_CSS_ERR_INTERNAL_ERROR); - return IA_CSS_ERR_INTERNAL_ERROR; - } - } else if (firmware->info.isp.type == IA_CSS_ACC_VIEWFINDER) - { - if (&pipe->vf_stage) - append_firmware(&pipe->vf_stage, firmware); - else { - IA_CSS_LEAVE_ERR_PRIVATE(IA_CSS_ERR_INTERNAL_ERROR); - return IA_CSS_ERR_INTERNAL_ERROR; - } - } + append_firmware(&pipe->output_stage, firmware); + else if (firmware->info.isp.type == IA_CSS_ACC_VIEWFINDER) + append_firmware(&pipe->vf_stage, firmware); err = acc_load_extension(firmware); IA_CSS_LEAVE_ERR_PRIVATE(err); From patchwork Wed May 27 07:11:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 11572101 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 278851392 for ; Wed, 27 May 2020 07:12:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0F6022100A for ; Wed, 27 May 2020 07:12:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="DM3vqxu8" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729149AbgE0HMV (ORCPT ); Wed, 27 May 2020 03:12:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33050 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729144AbgE0HMU (ORCPT ); Wed, 27 May 2020 03:12:20 -0400 Received: from mail-pj1-x1043.google.com (mail-pj1-x1043.google.com [IPv6:2607:f8b0:4864:20::1043]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA3BBC061A0F; Wed, 27 May 2020 00:12:19 -0700 (PDT) Received: by mail-pj1-x1043.google.com with SMTP id ci23so1115115pjb.5; Wed, 27 May 2020 00:12:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=YnWT8s8ink/KeJFRPdHxxy0KnE9QXS2EIJkcc7O9gtk=; b=DM3vqxu8dRtwoGww+IORQKfTTdW1nnuAvY8aRKzh62Cx8kqBbcP5lV1qm8URdE5NwI c2s+2BV+jhzfiL+hWF6uvl3M3rc4SZRksRliKnmNBhwzO3LalGMUVe/pJ2seJegirKxY 3aOolQxZqc5UnpX0y292F3vEt7C88vjlI+mWd1ad8e7/AVNK0GAZHXd/EGkAQqw/UBTH 4FdXsSMJJ6gziYNmWfGWpUTvBl7utKor+c7qe3gR/aiDXEO/tQmdBPMArs0FI5akiEKH M//WCYPyz0r/qDeJbXVWbWEsEqaiuJB+R7TwqXi3Sib+9NJec9jV4Mz0yT4Sowh2E8du Rn4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=YnWT8s8ink/KeJFRPdHxxy0KnE9QXS2EIJkcc7O9gtk=; b=nxRNR9vv8F9+dHzen2skCCMM9jktoOhr+OCtbxX8mdtEzAEDXNxUMziKuz2JESqRSa YnDWMOT5qrK6lwL6RNgy8pRYul+CB/TKrXa163p0XLFE6/BswNG09JtyZTMgBLF+CFLB nrFJ4IUoemtVnK0d3NoIiu/bcRa/ptJqyTHeXPNv3DyvMB8pZjw1lfuGRcViDQ+vgbha Xarzfc3fNr6gg9oIT1S9H+5Ss0Kx9bUSlCdHFPAbrzuuQafArNrXFaWSugLaP++HyCiU OaG6w3LqgUNJuaogL8TFVepJ4DaOMRGjRSpwoyptRlab5HhLfiE3XH1HGkaTLJENnHW/ HGoQ== X-Gm-Message-State: AOAM532YUOiFuaDl/fPqd2PK5S98ORGh8B+toxQ8sKzuw09AlYhGtJ2U 1qe6fpTwpFEVcUsGmf5Gh73FpRQ+ywE= X-Google-Smtp-Source: ABdhPJyFCpOYMkAVV78W52jBC29vXxFB27ZW9sqjVDAn5HIxYxToCi4u+31xoW8h3BEW8uRCIWxYTw== X-Received: by 2002:a17:902:fe81:: with SMTP id x1mr4672432plm.239.1590563539414; Wed, 27 May 2020 00:12:19 -0700 (PDT) Received: from localhost.localdomain ([2604:1380:4111:8b00::1]) by smtp.gmail.com with ESMTPSA id 10sm1306431pfx.138.2020.05.27.00.12.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 May 2020 00:12:18 -0700 (PDT) From: Nathan Chancellor To: Mauro Carvalho Chehab Cc: Sakari Ailus , linux-media@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, Nathan Chancellor Subject: [PATCH 5/7] media: atomisp: Remove unnecessary NULL check in atomisp_param Date: Wed, 27 May 2020 00:11:48 -0700 Message-Id: <20200527071150.3381228-6-natechancellor@gmail.com> X-Mailer: git-send-email 2.27.0.rc0 In-Reply-To: <20200527071150.3381228-1-natechancellor@gmail.com> References: <20200527071150.3381228-1-natechancellor@gmail.com> MIME-Version: 1.0 X-Patchwork-Bot: notify Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Clang warns: drivers/staging/media/atomisp/pci/atomisp_cmd.c:4278:17: warning: address of 'config->info' will always evaluate to 'true' [-Wpointer-bool-conversion] if (!&config->info) { ~ ~~~~~~~~^~~~ config cannot be NULL because it comes from an ioctl, which ensures that the user is not giving us an invalid pointer through copy_from_user. If config is not NULL, info cannot be NULL. Remove this check. Link: https://github.com/ClangBuiltLinux/linux/issues/1036 Signed-off-by: Nathan Chancellor --- drivers/staging/media/atomisp/pci/atomisp_cmd.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/staging/media/atomisp/pci/atomisp_cmd.c b/drivers/staging/media/atomisp/pci/atomisp_cmd.c index 5be690f876c1..105c5aeb83ac 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_cmd.c +++ b/drivers/staging/media/atomisp/pci/atomisp_cmd.c @@ -4264,7 +4264,6 @@ int atomisp_set_parameters(struct video_device *vdev, int atomisp_param(struct atomisp_sub_device *asd, int flag, struct atomisp_parm *config) { - struct atomisp_device *isp = asd->isp; struct ia_css_pipe_config *vp_cfg = &asd->stream_env[ATOMISP_INPUT_STREAM_GENERAL]. pipe_configs[IA_CSS_PIPE_ID_VIDEO]; @@ -4275,10 +4274,6 @@ int atomisp_param(struct atomisp_sub_device *asd, int flag, atomisp_css_get_dvs_grid_info( &asd->params.curr_grid_info); - if (!&config->info) { - dev_err(isp->dev, "ERROR: NULL pointer in grid_info\n"); - return -EINVAL; - } atomisp_curr_user_grid_info(asd, &config->info); /* We always return the resolution and stride even if there is From patchwork Wed May 27 07:11:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 11572103 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DDBEB90 for ; Wed, 27 May 2020 07:12:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C515D212CC for ; Wed, 27 May 2020 07:12:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="k1qgL0z6" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729183AbgE0HMZ (ORCPT ); Wed, 27 May 2020 03:12:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729151AbgE0HMW (ORCPT ); Wed, 27 May 2020 03:12:22 -0400 Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 23F10C061A0F; Wed, 27 May 2020 00:12:22 -0700 (PDT) Received: by mail-pg1-x544.google.com with SMTP id d10so11370231pgn.4; Wed, 27 May 2020 00:12:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Tbgdqd+TXdAk8QNQkvpAeStL9yrt3nZfFNT/1PFaGls=; b=k1qgL0z6SiL5RJ1jy1ddTv2tly55L3zXvSGIJ+d1Q8l14IIWnU8jdo/ew4J/MGZ1a1 ghhp01Z2ro6ZZW20+RGtLXPi4dzOcPrC5WNO8MTcS3Bgp+gvUyu/hj2LrSIZjOZ0Trc3 IqDmuUKZZtuZ6g73xrRk3FBEWp6nqRS7HyxoMZFLM5w+X/RQoi6fPntepT9EBWnM6Jig doZXNjAdevq31/+HN5f/EnFXd/8pj6dfnCNgGsSmeuBxuiopt7x2NIrxPpGnLz+2CtiS j810vjU2dvanzhLIukM3tlZDPZSv+/KOeBVqFZTQtzfYghYrcWM1AseG/12XCcrjs2Yn i87Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Tbgdqd+TXdAk8QNQkvpAeStL9yrt3nZfFNT/1PFaGls=; b=pH1wonvy7KciVwNuT1GW2BzOxNlBmV/FAct2avVovkWyAgLgohtQ23ID+5aYV9SCnE uH9bqlFPxFGYjqMufPVbKTf6Edi9JbHzcqXwkcwJvGQ4J6BSsrvWTmQBKTMsJtY2mkQQ D9HV12HC01sSGSvpHxhi5tsQgCuVq+1se+Mj6QPgfnthqkULLbMCgq2g7U0EwWjeFM4v p1Ew+t9Ln+Zs+wfrfP7KXFvYT4n2N6VOEafsCj21nRF6LP0jmMLIQExkWArKyIMRQpQs mZuEXYIWs+hhb3fhuGSkLuBMlq6rAkLukngidBSz4YSPhqv+KZP99cunYjwwlkW5zziG SHQg== X-Gm-Message-State: AOAM531OfpjLsi0DYmxd9YxidZy5uLMzFAk55562q/Pbbbne1JeIOuEY 3VTAzQK20ymRPIGMK3E/y1w= X-Google-Smtp-Source: ABdhPJw6D1VZU/JVVsKGh8KLCigxn0+ldfpgARKsTpPYazxQ5VDfKfusD5Y37w56dI+8FS7LCXPvtw== X-Received: by 2002:a63:78b:: with SMTP id 133mr2796179pgh.161.1590563541617; Wed, 27 May 2020 00:12:21 -0700 (PDT) Received: from localhost.localdomain ([2604:1380:4111:8b00::1]) by smtp.gmail.com with ESMTPSA id 10sm1306431pfx.138.2020.05.27.00.12.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 May 2020 00:12:21 -0700 (PDT) From: Nathan Chancellor To: Mauro Carvalho Chehab Cc: Sakari Ailus , linux-media@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, Nathan Chancellor Subject: [PATCH 6/7] media: atomisp: Avoid overflow in compute_blending Date: Wed, 27 May 2020 00:11:49 -0700 Message-Id: <20200527071150.3381228-7-natechancellor@gmail.com> X-Mailer: git-send-email 2.27.0.rc0 In-Reply-To: <20200527071150.3381228-1-natechancellor@gmail.com> References: <20200527071150.3381228-1-natechancellor@gmail.com> MIME-Version: 1.0 X-Patchwork-Bot: notify Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Clang warns: drivers/staging/media/atomisp/pci/isp/kernels/xnr/xnr_3.0/ia_css_xnr3.host.c:129:35: warning: implicit conversion from 'unsigned long' to 'int32_t' (aka 'int') changes value from 18446744073709543424 to -8192 [-Wconstant-conversion] return MAX(MIN(isp_strength, 0), -XNR_BLENDING_SCALE_FACTOR); ~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~ XNR_BLENDING_SCALE_FACTOR is BIT(13), or 8192, which will easily fit into a signed 32-bit integer. However, it is an unsigned long, which means that negating it is the same as subtracting that value from ULONG_MAX + 1, which causes it to be larger than a signed 32-bit integer so it gets implicitly converted. We can avoid this by using the variable isp_scale, which holds the value of XNR_BLENDING_SCALE_FACTOR already, where the implicit conversion from unsigned long to s32 already happened. If that were to ever overflow, clang would warn: https://godbolt.org/z/EeSxLG Link: https://github.com/ClangBuiltLinux/linux/issues/1036 Signed-off-by: Nathan Chancellor --- .../atomisp/pci/isp/kernels/xnr/xnr_3.0/ia_css_xnr3.host.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/media/atomisp/pci/isp/kernels/xnr/xnr_3.0/ia_css_xnr3.host.c b/drivers/staging/media/atomisp/pci/isp/kernels/xnr/xnr_3.0/ia_css_xnr3.host.c index a9db6366d20b..629f07faf20a 100644 --- a/drivers/staging/media/atomisp/pci/isp/kernels/xnr/xnr_3.0/ia_css_xnr3.host.c +++ b/drivers/staging/media/atomisp/pci/isp/kernels/xnr/xnr_3.0/ia_css_xnr3.host.c @@ -126,7 +126,7 @@ compute_blending(int strength) * exactly as s0.11 fixed point, but -1.0 can. */ isp_strength = -(((strength * isp_scale) + offset) / host_scale); - return MAX(MIN(isp_strength, 0), -XNR_BLENDING_SCALE_FACTOR); + return MAX(MIN(isp_strength, 0), -isp_scale); } void From patchwork Wed May 27 07:11:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 11572105 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6481C90 for ; Wed, 27 May 2020 07:12:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4AD4C21501 for ; Wed, 27 May 2020 07:12:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="QpCpctZf" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729204AbgE0HM3 (ORCPT ); Wed, 27 May 2020 03:12:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729144AbgE0HMY (ORCPT ); Wed, 27 May 2020 03:12:24 -0400 Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8DD6FC061A0F; Wed, 27 May 2020 00:12:24 -0700 (PDT) Received: by mail-pg1-x543.google.com with SMTP id p30so11348056pgl.11; Wed, 27 May 2020 00:12:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=BtFr88iS5dYVk9M5situj/cALZfUmfJBkWJmVOPGwiA=; b=QpCpctZfSnLodygNVJlSPBKkfII/mNnwqTkUPiqiLyWUfdkWaLBSnzHx/wkWxck/sr Ea4ImcUsTN9O73vlU31Py0Lno77YlTqpgiQUGnGQoypdkLvlLAEAazyPBrVhqz1zK0YS a/GdQnliziiDEZ23uu0dvDu2R8CwnWG91rb0ADbH83+3FeAFOYzRU7t46KYUswvh3g1V bsqbHBrOJ/mb9LRdgiYOHrVETupl8qryK3Ayvh8rNES9NZooxr/ysSji89BodjEzPU5J bNzyPtN36GPUjguXy8xoGGru+rhEGfIryQPVI2bHohuYltYUmSsDIyeB8pKud8TlKGxI vgnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=BtFr88iS5dYVk9M5situj/cALZfUmfJBkWJmVOPGwiA=; b=gKW2SfVVPWqNbHNnCdYVrsBSTwvylBZncnoITXGzR0/6IOJ5/BfmM8WSUv7LmFQ0tQ LTBd1pRBdmLPXoN8DDwep2s5o1DK1xQvCuGP4HYV3RnhrzUA5MqqGhXTBhiFAD6GDjFt fIud1EofTQZuff6IctCqGnGkPs2IMCFKbAmH7zhG7QnTumSlmi9DWcE1qHfmey4BSBk4 JG4OQchfIGhsuA8s7wPUQjZ5bJSAyKNYCg5E4W+7wAkwe6LpUln+1cfuBpvmk2hRMy1Q WNnLtPI3xXJzWQTFd2g2Ik1qkOvpAoKTdOiN2rdYKosOfI6AQO6nsJHy/tgJZ0hsdufD Crbg== X-Gm-Message-State: AOAM531E0dX3NlXvYnNf9SlSECIozAQxt35GJDlR6t63ZPNOWtxg2EzF KDcC/T8updYiQeNhqWwUL5A= X-Google-Smtp-Source: ABdhPJwrauMbNSEdWNH+N5a3rZnBfOIKgD1AmNbuhOdA/dbXFJh9XOpUE81ASBgklIFa4/rbx/Uoxg== X-Received: by 2002:a63:ad0b:: with SMTP id g11mr2665934pgf.275.1590563544076; Wed, 27 May 2020 00:12:24 -0700 (PDT) Received: from localhost.localdomain ([2604:1380:4111:8b00::1]) by smtp.gmail.com with ESMTPSA id 10sm1306431pfx.138.2020.05.27.00.12.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 May 2020 00:12:23 -0700 (PDT) From: Nathan Chancellor To: Mauro Carvalho Chehab Cc: Sakari Ailus , linux-media@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, Nathan Chancellor Subject: [PATCH 7/7] media: atomisp: Remove binary_supports_input_format Date: Wed, 27 May 2020 00:11:50 -0700 Message-Id: <20200527071150.3381228-8-natechancellor@gmail.com> X-Mailer: git-send-email 2.27.0.rc0 In-Reply-To: <20200527071150.3381228-1-natechancellor@gmail.com> References: <20200527071150.3381228-1-natechancellor@gmail.com> MIME-Version: 1.0 X-Patchwork-Bot: notify Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Clang warns: drivers/staging/media/atomisp/pci/runtime/binary/src/binary.c:1707:64: warning: implicit conversion from enumeration type 'const enum ia_css_frame_format' to different enumeration type 'enum atomisp_input_format' [-Wenum-conversion] binary_supports_input_format(xcandidate, req_in_info->format)); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~^~~~~~ As it turns out, binary_supports_input_format only asserts that xcandidate is not NULL and just returns true so this call is never actually made. There are other functions that are called that assert info is not NULL so this function actually serves no purpose. Remove it. It can be brought back if needed later. Link: https://github.com/ClangBuiltLinux/linux/issues/1036 Signed-off-by: Nathan Chancellor --- .../atomisp/pci/runtime/binary/src/binary.c | 21 ------------------- 1 file changed, 21 deletions(-) diff --git a/drivers/staging/media/atomisp/pci/runtime/binary/src/binary.c b/drivers/staging/media/atomisp/pci/runtime/binary/src/binary.c index 2a23b7c6aeeb..0be2331c66cd 100644 --- a/drivers/staging/media/atomisp/pci/runtime/binary/src/binary.c +++ b/drivers/staging/media/atomisp/pci/runtime/binary/src/binary.c @@ -857,18 +857,6 @@ binary_supports_output_format(const struct ia_css_binary_xinfo *info, return false; } -#ifdef ISP2401 -static bool -binary_supports_input_format(const struct ia_css_binary_xinfo *info, - enum atomisp_input_format format) -{ - assert(info); - (void)format; - - return true; -} -#endif - static bool binary_supports_vf_format(const struct ia_css_binary_xinfo *info, enum ia_css_frame_format format) @@ -1699,15 +1687,6 @@ ia_css_binary_find(struct ia_css_binary_descr *descr, binary_supports_output_format(xcandidate, req_bin_out_info->format)); continue; } -#ifdef ISP2401 - if (!binary_supports_input_format(xcandidate, descr->stream_format)) { - ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE, - "ia_css_binary_find() [%d] continue: !%d\n", - __LINE__, - binary_supports_input_format(xcandidate, req_in_info->format)); - continue; - } -#endif if (xcandidate->num_output_pins > 1 && /* in case we have a second output pin, */ req_vf_info && /* and we need vf output. */