From patchwork Sat Sep 8 00:24:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeykumar Sankaran X-Patchwork-Id: 10592789 X-Patchwork-Delegate: agross@codeaurora.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CE31E920 for ; Sat, 8 Sep 2018 00:25:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B1BBF2B627 for ; Sat, 8 Sep 2018 00:25:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A638F2B646; Sat, 8 Sep 2018 00:25:34 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 46A682B627 for ; Sat, 8 Sep 2018 00:25:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726378AbeIHFJB (ORCPT ); Sat, 8 Sep 2018 01:09:01 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:41982 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726343AbeIHFJB (ORCPT ); Sat, 8 Sep 2018 01:09:01 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id EA4A8609C1; Sat, 8 Sep 2018 00:24:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1536366332; bh=mvONkL7Sb5iZelzTFeJOEAcD8qgl2iT8IAw8X65Ahuk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FpsTO+7JnxnzHDZXxkZ35EE+LhqhhkT8f2lowyTQBb629WUQlrq8ajXWlRkbUoHcZ S2cSx8mHRQuczoiW108ckD+oxxgwMxvx9Uh5JTqC1nS0M90dGZJZ86a8DPBUwXhrpl ARan0SfNCw7Irci/JzuSRb0k+X7rvtez369/yTHU= Received: from jeykumar-linux.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: jsanka@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 10BFF60C85; Sat, 8 Sep 2018 00:24:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1536366293; bh=mvONkL7Sb5iZelzTFeJOEAcD8qgl2iT8IAw8X65Ahuk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=i/jO+172LF4MTmxHk9/y6i0LtAxO4hEtvBi5DKQIzV8M5+Lw3pMqd5eNukvTfNTsF sN46Z5bdGBKI4HrwGNK9jeYj9D8inZxZoHqdJnsk6wYVdFLv7j5OXbOOhld/TwCL3M yww1SWIs41ME78e281KVwbph/9uUG6Dp5Roen6B8= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 10BFF60C85 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=jsanka@codeaurora.org From: Jeykumar Sankaran To: dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org Cc: Jeykumar Sankaran , seanpaul@chromium.org, robdclark@gmail.com, hoegsberg@google.com, jcrouse@codeaurora.org Subject: [PATCH v6 18/19] drm/msm/dpu: relax parameter validation in encoders Date: Fri, 7 Sep 2018 17:24:26 -0700 Message-Id: <1536366267-22336-19-git-send-email-jsanka@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1536366267-22336-1-git-send-email-jsanka@codeaurora.org> References: <1536366267-22336-1-git-send-email-jsanka@codeaurora.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP DPU, being over protective, validates every parameter of a module. This change traces the call stack for some of encoder functions affected by previous set of clean up patches and cleans up unwanted validations. changes in v5: - Introduced in the series changes in v6: - none Signed-off-by: Jeykumar Sankaran Reviewed-by: Sean Paul --- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 6 ------ drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c | 14 -------------- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c | 6 ------ 3 files changed, 26 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c index 18f5d1d..e15d09f 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c @@ -441,12 +441,6 @@ void dpu_encoder_get_hw_resources(struct drm_encoder *drm_enc, struct dpu_encoder_virt *dpu_enc = NULL; int i = 0; - if (!hw_res || !drm_enc) { - DPU_ERROR("invalid argument(s), drm_enc %d, res %d\n", - drm_enc != 0, hw_res != 0); - return; - } - dpu_enc = to_dpu_encoder_virt(drm_enc); DPU_DEBUG_ENC(dpu_enc, "\n"); diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c index f277a69..b2d7f0d 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c @@ -601,20 +601,6 @@ static void dpu_encoder_phys_cmd_get_hw_resources( struct dpu_encoder_phys *phys_enc, struct dpu_encoder_hw_resources *hw_res) { - struct dpu_encoder_phys_cmd *cmd_enc = - to_dpu_encoder_phys_cmd(phys_enc); - - if (!phys_enc) { - DPU_ERROR("invalid encoder\n"); - return; - } - - if ((phys_enc->intf_idx - INTF_0) >= INTF_MAX) { - DPU_ERROR("invalid intf idx:%d\n", phys_enc->intf_idx); - return; - } - - DPU_DEBUG_CMDENC(cmd_enc, "\n"); hw_res->intfs[phys_enc->intf_idx - INTF_0] = INTF_MODE_CMD; } diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c index fd51fe6..6fc7060 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c @@ -539,12 +539,6 @@ static void dpu_encoder_phys_vid_get_hw_resources( struct dpu_encoder_phys *phys_enc, struct dpu_encoder_hw_resources *hw_res) { - if (!phys_enc || !hw_res) { - DPU_ERROR("invalid arg(s), enc %d hw_res %d\n", - phys_enc != 0, hw_res != 0); - return; - } - hw_res->intfs[phys_enc->intf_idx - INTF_0] = INTF_MODE_VIDEO; }