Received: by 2002:a05:7412:8598:b0:f9:33c2:5753 with SMTP id n24csp542749rdh; Tue, 19 Dec 2023 06:40:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IGqZTGduRtJZuNpVK6zIYPwJ4lCWhgi6b0FYZT5vbp1QQ487CkUDiUzx46JWFoFoTk9Upbn X-Received: by 2002:a17:902:c950:b0:1d0:6ffd:ae0c with SMTP id i16-20020a170902c95000b001d06ffdae0cmr11062249pla.115.1702996814183; Tue, 19 Dec 2023 06:40:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702996814; cv=none; d=google.com; s=arc-20160816; b=xzeKNw/IXaBegZYe3Nahq0xJ/xLkn1y9BSxkVsAJw1Bnj4+cEPb81qzuSXPLIlwpx6 ntbNzxehY3XBhQcKiFKDT3d49ZNrfuikOPfHC4Y18/HLVke0sJOtrqiAgLAXO4uhraMm WRsUN9sU3HFpDoGl5PPu1cjzbPwrcKSRQrAQRZ+1Fmy0KdeExQD6UnPFCQfV0oHR2epH lJLE1S+WimUg4zwjBYl+SXce0GfZ/StRsLuLpvCp6M2DzEzHVTT9MhSsh30aNS1MYGWI NyxyDIESsg2MEL4i5fdhGp8Wf4x4oQpqAVrtDor6JAXJMEyhcLcmBfx5SDMb5FkIk2ie TZOw== 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-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5397-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id v1-20020a1709028d8100b001d3c3965decsi2819432plo.424.2023.12.19.06.40.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 06:40:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5397-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; 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-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5397-linux.lists.archive=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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 46B0928CD71 for ; Tue, 19 Dec 2023 14:40:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B05CA1C294; Tue, 19 Dec 2023 14:39:35 +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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit 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; -- 2.39.2