From patchwork Tue Jul 12 07:56:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 590662 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 39BCECCA47C for ; Tue, 12 Jul 2022 07:56:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232444AbiGLH44 (ORCPT ); Tue, 12 Jul 2022 03:56:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232469AbiGLH4y (ORCPT ); Tue, 12 Jul 2022 03:56:54 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E0E39D536 for ; Tue, 12 Jul 2022 00:56:50 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 08FEB6151F for ; Tue, 12 Jul 2022 07:56:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 06BA5C341CA; Tue, 12 Jul 2022 07:56:48 +0000 (UTC) Message-ID: <44d3b224-5ea4-3d18-4aff-0e938fd8503c@xs4all.nl> Date: Tue, 12 Jul 2022 09:56:47 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Content-Language: en-US To: "linux-media@vger.kernel.org" Cc: Stanimir Varbanov From: Hans Verkuil Subject: [PATCH] media: venus: venus_helper_get_bufreq(): req is never NULL Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Fix a smatch error: drivers/media/platform/qcom/venus/helpers.c: drivers/media/platform/qcom/venus/helpers.c:678 venus_helper_get_bufreq() error: we previously assumed 'req' could be null (see line 674) After checking how venus_helper_get_bufreq() is called it is clear that req is never NULL, so just drop the check. Signed-off-by: Hans Verkuil diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c index 5c1104379c49..ad8aaebf86be 100644 --- a/drivers/media/platform/qcom/venus/helpers.c +++ b/drivers/media/platform/qcom/venus/helpers.c @@ -671,8 +671,7 @@ int venus_helper_get_bufreq(struct venus_inst *inst, u32 type, unsigned int i; int ret; - if (req) - memset(req, 0, sizeof(*req)); + memset(req, 0, sizeof(*req)); if (type == HFI_BUFFER_OUTPUT || type == HFI_BUFFER_OUTPUT2) req->count_min = inst->fw_min_cnt;