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 122DBC433FE for ; Wed, 12 Oct 2022 20:00:55 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2853684F24; Wed, 12 Oct 2022 21:59: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="ytV8yQid"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="lgNZbQkg"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C919E84E95; Wed, 12 Oct 2022 21:58:53 +0200 (CEST) Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) (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 1389584F1C for ; Wed, 12 Oct 2022 21:58:31 +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 D43C9223EB; Wed, 12 Oct 2022 19:58:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1665604710; 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=mgyJqLS24Uz9XdBMm/LE1cEQBL4bPzHTXA4BThSoXaw=; b=ytV8yQid91Dsc7QRPfgUHiXqxj0CkXIJ+W5JNIxc5fuKEfxISw1Slpr89bnzQ75r/jF7Ib uA5IAptAsAsXkZ8u+os6/IvIkA1wStFzL4Zfk3xfxngnk41H8OWiGudiCzxIQkyZ5Syz9Y L6r4T+o55ZlowxWtiQMsT2iP5WdBvH4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1665604710; 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=mgyJqLS24Uz9XdBMm/LE1cEQBL4bPzHTXA4BThSoXaw=; b=lgNZbQkgQa6J5ZoaK4TshtWcXkw7COAdI5c+2CNEu70brcbVqu1Ei2JjfHtV8vA0tvoirr u2aRlZ3Hm3PNX5Bw== Received: from naga.suse.cz (unknown [10.100.224.114]) by relay2.suse.de (Postfix) with ESMTP id B02872C15B; Wed, 12 Oct 2022 19:58:30 +0000 (UTC) From: Michal Suchanek To: u-boot@lists.denx.de Cc: Michal Suchanek , Simon Glass , Heinrich Schuchardt , AKASHI Takahiro Subject: [PATCH v6 12/20] dm: blk: Do not use uclass_next_device_err Date: Wed, 12 Oct 2022 21:58:01 +0200 Message-Id: <003231fc79241ed075dfefe8a4eedebd23374294.1665604425.git.msuchanek@suse.de> 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 blk_first_device_err/blk_next_device_err uses uclass_first_device_err/uclass_next_device_err for device iteration. Although the function names superficially match the return value from uclass_first_device_err/uclass_next_device_err is never used meaningfully, and uclass_first_device/uclass_next_device works equally well for this purpose. In the following patch the semantic of uclass_first_device_err/uclass_next_device_err will be changed to be based on uclass_first_device_check/uclass_next_device_check breaking this sole user that uses uclass_next_device_err for iteration. Signed-off-by: Michal Suchanek Reviewed-by: Simon Glass --- drivers/block/blk-uclass.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/drivers/block/blk-uclass.c b/drivers/block/blk-uclass.c index 7d12d5413f..bcc14a684b 100644 --- a/drivers/block/blk-uclass.c +++ b/drivers/block/blk-uclass.c @@ -593,11 +593,9 @@ int blk_find_next(enum blk_flag_t flags, struct udevice **devp) int blk_first_device_err(enum blk_flag_t flags, struct udevice **devp) { - int ret; - - for (ret = uclass_first_device_err(UCLASS_BLK, devp); - !ret; - ret = uclass_next_device_err(devp)) { + for (uclass_first_device(UCLASS_BLK, devp); + *devp; + uclass_next_device(devp)) { if (!blk_flags_check(*devp, flags)) return 0; } @@ -607,11 +605,9 @@ int blk_first_device_err(enum blk_flag_t flags, struct udevice **devp) int blk_next_device_err(enum blk_flag_t flags, struct udevice **devp) { - int ret; - - for (ret = uclass_next_device_err(devp); - !ret; - ret = uclass_next_device_err(devp)) { + for (uclass_next_device(devp); + *devp; + uclass_next_device(devp)) { if (!blk_flags_check(*devp, flags)) return 0; } -- 2.37.3