From patchwork Tue Dec 19 14:39:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Ian King X-Patchwork-Id: 181026 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp1985449dyi; Tue, 19 Dec 2023 06:43:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IETkSmqglY7KAE6mLyyiNp9Gs8o7jvkJ1HYlIYX58fUEqQCVHK+N5GmWcW7RoRC8QxeqZzK X-Received: by 2002:a17:90a:4311:b0:286:997b:d6b5 with SMTP id q17-20020a17090a431100b00286997bd6b5mr8155969pjg.74.1702997025027; Tue, 19 Dec 2023 06:43:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702997025; cv=none; d=google.com; s=arc-20160816; b=Nww3tXFMbdfV6PT7Ia/U8DiqRm/TT301vV3PPe/nybs3JBvUhTh2wkz5Zq8hzhw8MP FiDWRLX6Lbn+6txgIuGsTUHEwbOpUWvpIvBi/aYCYYrGzZ/RX07kA2jUFExY1kO4vul6 UGQArNFiKRdGky5Jy9mcAz3EQJ26gqF96gHVuIcPlnunf4vjTzMKztnhDq0k7GNj6fiF auT7vFBcHgIv7Gn/7BwIM0ROOS9FPXSCHqSVZ5jVz4bXoatdq2bkC3ngbYMruKHi+BEg r6imaOO8ZxuMh0EazMzEQyu3rHRx1sJ743H8B7JcOG5FosoEO0HYS8rqPM79PBv3WI8P AtkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=nx2SKSg4StH2xypt44SaUQkkd1sbC97S0Nlq+vY2bSY=; fh=0LvJn010kILuSS3VOCL41unpDteXztWiNIO+9+1ObJE=; b=dPPdVO2j1jmFC9QeozVUPSzlUOCzLDlpXcOn7KQBWF9SPBsIl8/4i8TfxFKc5Rrwa2 qnbNCSsFCygov9wmqzOm3gSm3tzIzhm9MGoK3omVd2YAu9/dQDA0NZ6hpP2URlR7P/mP 9TLcejg9242XKnSXyfmd1Co/leIk8ygm9yKO2MDbYs4EUaGR7948woior0vjtBdSXS8S ktUCbUIy7v8Tbrl2o107FdeiNY4k3DtmZlmIov0r+2dEvr491moYerumW6n1ICA0U4A4 FPsPc2Y35PGL5mWJWYWw38LqV+RSvgwpQpyCpbMAkYmzU2kwMCe6oQsg72EEar3sMCjh 1PMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ePdiI+G7; spf=pass (google.com: domain of linux-kernel+bounces-5397-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5397-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id m7-20020a17090a3f8700b0028b90509253si1263295pjc.126.2023.12.19.06.43.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 06:43:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5397-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ePdiI+G7; spf=pass (google.com: domain of linux-kernel+bounces-5397-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5397-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 0D038B22B6D for ; Tue, 19 Dec 2023 14:40:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A19F41B29A; Tue, 19 Dec 2023 14:39:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ePdiI+G7" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BF32B1B288; Tue, 19 Dec 2023 14:39:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-40d05ebe642so16194875e9.0; Tue, 19 Dec 2023 06:39:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702996771; x=1703601571; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=nx2SKSg4StH2xypt44SaUQkkd1sbC97S0Nlq+vY2bSY=; b=ePdiI+G7wzNB+cZgmOPfu5SBCYZxJP5ymr/H6Ewcpb84D/VT9wHQ2O2kRdetbaZ+M8 xKq2CjZbz7FK+2hEI1yxSmG2dNvU4hWxcpQEJ42Ke9SE1Yye93wZU3UdvA6ccwVFcNL8 56qQ/UHfGs6w8d6TMdrkWtXmvphfnKgz++Xv7HNW/kEePSt8js6RTxy51gP0+ZOdIegw lRf/Ps4FIKxSwV0sQ7HabTNXJsVzPlUhZUoOZBDZfvfJnZ4mE5pq2pGheqpJuM/Tb4yL l0sSjasDcAifeQRDHEYbLKPNGYHmXrRuAM+clMSXLD5hWgpSTsLg7c4BWSMjIGMmCd10 SWbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702996771; x=1703601571; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=nx2SKSg4StH2xypt44SaUQkkd1sbC97S0Nlq+vY2bSY=; b=bzts9Hijyq1dbORZ3IWEoxu/eNSLTT4yiZxOkDXqaE1fHs0beh6w9+TuCL/CwLf/f8 RvoDYKoTyOZtH62pRVzivPrjiwFTMBbKNfyq3p1P8yHkbmKL/qLb57ONEpovYx5R8RHn 4bSpPM3k/Chc8ruc+Pj/k2G4ZIOOIrewOtET6dZrXmqBNYCz2T9VV0FSg5p57RvY98DX Iut0PGe1eETXT/5IUKLgx5CfGgVG+40omY5o1BptPbmMKVl2KCEgoDJlF53JIJETXey8 PIO6hORd40m1qOtOxTnBBwTxcmIajPHdLsPE29yuIg5AIyw11LGtriE9d2ptuPEuoaPo 5IVQ== X-Gm-Message-State: AOJu0YyhnjUj9tnWFW8WWWcBiAWo1lYZQ4UgkkyTKRHnTcnKVw1FSABi meAFPNZv5VgCRlS4WSgd8D1pqHpt4mX3jA== X-Received: by 2002:a05:600c:6a81:b0:40c:6d5f:7b89 with SMTP id jl1-20020a05600c6a8100b0040c6d5f7b89mr468847wmb.73.1702996770850; Tue, 19 Dec 2023 06:39:30 -0800 (PST) Received: from localhost (cpc154979-craw9-2-0-cust193.16-3.cable.virginm.net. [80.193.200.194]) by smtp.gmail.com with ESMTPSA id n4-20020a5d6b84000000b003365e9fea3esm9354226wrx.31.2023.12.19.06.39.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 06:39:30 -0800 (PST) From: Colin Ian King To: Hans de Goede , Mauro Carvalho Chehab , Sakari Ailus , Greg Kroah-Hartman , linux-media@vger.kernel.org, linux-staging@lists.linux.dev Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH][next] media: atomisp: remove redundant assignments to variables Date: Tue, 19 Dec 2023 14:39:29 +0000 Message-Id: <20231219143929.367929-1-colin.i.king@gmail.com> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785721808380579238 X-GMAIL-MSGID: 1785721808380579238 There are several variables that are being initialized with values that are never read, the assignment are redundant and can be removed. Cleans up cppcheck unreadVariable warnings. Signed-off-by: Colin Ian King --- .../atomisp/pci/base/circbuf/src/circbuf.c | 2 +- .../pci/runtime/pipeline/src/pipeline.c | 4 +--- .../atomisp/pci/runtime/queue/src/queue.c | 18 +++++++++--------- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/drivers/staging/media/atomisp/pci/base/circbuf/src/circbuf.c b/drivers/staging/media/atomisp/pci/base/circbuf/src/circbuf.c index d9f7c143794d..06f039236abc 100644 --- a/drivers/staging/media/atomisp/pci/base/circbuf/src/circbuf.c +++ b/drivers/staging/media/atomisp/pci/base/circbuf/src/circbuf.c @@ -207,7 +207,7 @@ bool ia_css_circbuf_increase_size( { u8 curr_size; u8 curr_end; - unsigned int i = 0; + unsigned int i; if (!cb || sz_delta == 0) return false; diff --git a/drivers/staging/media/atomisp/pci/runtime/pipeline/src/pipeline.c b/drivers/staging/media/atomisp/pci/runtime/pipeline/src/pipeline.c index 3d8741e7d5ca..966cb47b95d9 100644 --- a/drivers/staging/media/atomisp/pci/runtime/pipeline/src/pipeline.c +++ b/drivers/staging/media/atomisp/pci/runtime/pipeline/src/pipeline.c @@ -693,7 +691,7 @@ static void pipeline_init_defaults( static void ia_css_pipeline_set_zoom_stage(struct ia_css_pipeline *pipeline) { struct ia_css_pipeline_stage *stage = NULL; - int err = 0; + int err; assert(pipeline); if (pipeline->pipe_id == IA_CSS_PIPE_ID_PREVIEW) { diff --git a/drivers/staging/media/atomisp/pci/runtime/queue/src/queue.c b/drivers/staging/media/atomisp/pci/runtime/queue/src/queue.c index 2f1c2df59f71..c4d4062206a2 100644 --- a/drivers/staging/media/atomisp/pci/runtime/queue/src/queue.c +++ b/drivers/staging/media/atomisp/pci/runtime/queue/src/queue.c @@ -81,7 +81,7 @@ int ia_css_queue_uninit(ia_css_queue_t *qhandle) int ia_css_queue_enqueue(ia_css_queue_t *qhandle, uint32_t item) { - int error = 0; + int error; if (!qhandle) return -EINVAL; @@ -138,7 +138,7 @@ int ia_css_queue_enqueue(ia_css_queue_t *qhandle, uint32_t item) int ia_css_queue_dequeue(ia_css_queue_t *qhandle, uint32_t *item) { - int error = 0; + int error; if (!qhandle || NULL == item) return -EINVAL; @@ -193,7 +193,7 @@ int ia_css_queue_dequeue(ia_css_queue_t *qhandle, uint32_t *item) int ia_css_queue_is_full(ia_css_queue_t *qhandle, bool *is_full) { - int error = 0; + int error; if ((!qhandle) || (!is_full)) return -EINVAL; @@ -225,7 +225,7 @@ int ia_css_queue_is_full(ia_css_queue_t *qhandle, bool *is_full) int ia_css_queue_get_free_space(ia_css_queue_t *qhandle, uint32_t *size) { - int error = 0; + int error; if ((!qhandle) || (!size)) return -EINVAL; @@ -257,7 +257,7 @@ int ia_css_queue_get_free_space(ia_css_queue_t *qhandle, uint32_t *size) int ia_css_queue_get_used_space(ia_css_queue_t *qhandle, uint32_t *size) { - int error = 0; + int error; if ((!qhandle) || (!size)) return -EINVAL; @@ -289,8 +289,8 @@ int ia_css_queue_get_used_space(ia_css_queue_t *qhandle, uint32_t *size) int ia_css_queue_peek(ia_css_queue_t *qhandle, u32 offset, uint32_t *element) { - u32 num_elems = 0; - int error = 0; + u32 num_elems; + int error; if ((!qhandle) || (!element)) return -EINVAL; @@ -338,7 +338,7 @@ int ia_css_queue_peek(ia_css_queue_t *qhandle, u32 offset, uint32_t *element) int ia_css_queue_is_empty(ia_css_queue_t *qhandle, bool *is_empty) { - int error = 0; + int error; if ((!qhandle) || (!is_empty)) return -EINVAL; @@ -370,7 +370,7 @@ int ia_css_queue_is_empty(ia_css_queue_t *qhandle, bool *is_empty) int ia_css_queue_get_size(ia_css_queue_t *qhandle, uint32_t *size) { - int error = 0; + int error; if ((!qhandle) || (!size)) return -EINVAL;