Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp3496054pxy; Mon, 26 Apr 2021 03:13:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzH2G4TFiB8d2HRcHNPBQjV1EMBU296D9erfpAL9tSX0xTU9iUCp/jVqUw1FwsGJ5XnBpt+ X-Received: by 2002:a17:906:9385:: with SMTP id l5mr17781541ejx.32.1619431995941; Mon, 26 Apr 2021 03:13:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619431995; cv=none; d=google.com; s=arc-20160816; b=UTzvYvm2PkfCVoD5PBUoTzGG2HnhV7QugzO+4xyOO/9UHkVhVw0g3AJwtTfYbVlCPK LCALnciK81CJ1OwzFP5g1Imw6dS8z1QKIZORgqYc01E0tYbEqHvFkJCjHn0B4tIuJhB5 fu72qqYM7lrchwVHZ8bMTKljCKReKnviWpNZQDSsNX6RLL9QgSxRqtqBVKOp6eORWwuT wIPZI4SLtTVz4LecyujqOoi5bL3ckeimRxkxXKuTQIoS9fwM47NV++iIa0YTmLyVwLsk A28881FwwQleMs8vaQ0ESnSTYDi9XTwwnltzWfd7tq0fAD56CfimL94DZqbJ6ib9Ls5f BmiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=0Yyic5TCwmThAqHm5s43eI6EE8ERYdk4+eB7ADZJSQU=; b=gMyqRko1GPblTK4Ete0gz3I7TZOFF8fpgRLjAbYBMgnjx4O3bEwtn4J20Gtuq12Pr+ kGKeEOnLQdqUI3lVzhg1RqWGU/IbrhAZjxNTkf3gCo0Cng7kpQYxhwHn+Qx14RTu46cc q+2dYgL7KoXwqONzCrgbT+EIcjSEsJTWymNTJVsb2ybEq/43fKlkBawEIMKYcjpfcHLR J354tTPVMrt/bgctjNroDqw6x3AKrxiicEI5vAQPZRr3/TN9vjzv1/0UYFaNieKqz3zn NheG2RbC04viNL1cce0sCRz53/KAp12xF10fq1wgeXja9d+7jMUJp3TaYtaGSRDLPj1r ymGw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n22si5698338edq.87.2021.04.26.03.12.52; Mon, 26 Apr 2021 03:13:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233059AbhDZKLz (ORCPT + 99 others); Mon, 26 Apr 2021 06:11:55 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:44777 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233072AbhDZKLv (ORCPT ); Mon, 26 Apr 2021 06:11:51 -0400 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1layCo-0003XV-9l; Mon, 26 Apr 2021 10:11:06 +0000 From: Colin King To: Greg Kroah-Hartman , Jiri Slaby , Kevin Hilman , Neil Armstrong , Jerome Brunet , Martin Blumenstingl , linux-serial@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] serial: meson: remove redundant initialization of variable id Date: Mon, 26 Apr 2021 11:11:06 +0100 Message-Id: <20210426101106.9122-1-colin.king@canonical.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Colin Ian King The variable id being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Since id is just being used in a for-loop inside a local scope, move the declaration of id to that scope. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King --- drivers/tty/serial/meson_uart.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/meson_uart.c b/drivers/tty/serial/meson_uart.c index 529cd0289056..d7f55031b2cf 100644 --- a/drivers/tty/serial/meson_uart.c +++ b/drivers/tty/serial/meson_uart.c @@ -716,12 +716,13 @@ static int meson_uart_probe(struct platform_device *pdev) struct resource *res_mem, *res_irq; struct uart_port *port; int ret = 0; - int id = -1; if (pdev->dev.of_node) pdev->id = of_alias_get_id(pdev->dev.of_node, "serial"); if (pdev->id < 0) { + int id; + for (id = AML_UART_PORT_OFFSET; id < AML_UART_PORT_NUM; id++) { if (!meson_ports[id]) { pdev->id = id; -- 2.30.2