From mboxrd@z Thu Jan 1 00:00:00 1970 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 phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2E012C6FA82 for ; Sun, 25 Sep 2022 08:31:11 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9F6B684AD5; Sun, 25 Sep 2022 10:29:20 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.b="ymIWfIQa"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="+//zciUw"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3944C848C2; Sun, 25 Sep 2022 10:28:51 +0200 (CEST) Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id E0B93845C3 for ; Sun, 25 Sep 2022 10:28:36 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=msuchanek@suse.de Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id B401822001; Sun, 25 Sep 2022 08:28:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1664094516; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FyD9rZ4lgN1gHWQsBHXjOdjaCUdc0hM6qZw2z+xoFUE=; b=ymIWfIQaZarYVv9FtOv1yuTGIsH7LWWDPGMrMVYyo9nKRZ3yrH5nH7I/AOLI82WQk/zdx6 CU6GQKA9j4g5LeTNtSDCzLYrTmeB3awV5VRYggbWn6pAlGZ+QXgcUwy1TfuKxJicwknpr1 +w43q1QNHz41bCHK3hDyivlZI50r/nw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1664094516; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FyD9rZ4lgN1gHWQsBHXjOdjaCUdc0hM6qZw2z+xoFUE=; b=+//zciUwWgCt8awA12Yr6lyeD0W1SlR1vCtqs8VFmgc4rjfsig3L9GgzzLCEgZit/EElhH TVTIsqQCJmbIr/Cg== Received: from naga.suse.cz (unknown [10.100.224.114]) by relay2.suse.de (Postfix) with ESMTP id 885F42C18B; Sun, 25 Sep 2022 08:28:36 +0000 (UTC) From: Michal Suchanek To: u-boot@lists.denx.de Cc: Michal Suchanek , Simon Glass , Alexander Dahl , Sean Anderson Subject: [PATCH v4 14/21] dma: Eliminate unused variable in dma_get_cfg() Date: Sun, 25 Sep 2022 10:28:07 +0200 Message-Id: X-Mailer: git-send-email 2.37.3 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean The ret value is never used. It is only set when no device is returned, and that is handled before the value of ret would be used. Signed-off-by: Michal Suchanek --- drivers/dma/dma-uclass.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/dma/dma-uclass.c b/drivers/dma/dma-uclass.c index 012609bb53..952cbc2170 100644 --- a/drivers/dma/dma-uclass.c +++ b/drivers/dma/dma-uclass.c @@ -209,10 +209,9 @@ int dma_get_cfg(struct dma *dma, u32 cfg_id, void **cfg_data) int dma_get_device(u32 transfer_type, struct udevice **devp) { struct udevice *dev; - int ret; - for (ret = uclass_first_device(UCLASS_DMA, &dev); dev && !ret; - ret = uclass_next_device(&dev)) { + for (uclass_first_device(UCLASS_DMA, &dev); dev; + uclass_next_device(&dev)) { struct dma_dev_priv *uc_priv; uc_priv = dev_get_uclass_priv(dev); @@ -228,7 +227,7 @@ int dma_get_device(u32 transfer_type, struct udevice **devp) *devp = dev; - return ret; + return 0; } int dma_memcpy(void *dst, void *src, size_t len) -- 2.37.3