From nobody Mon Dec 1 23:36:40 2025 Received: from mail-yx1-f41.google.com (mail-yx1-f41.google.com [74.125.224.41]) (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 41B8833F363 for ; Wed, 26 Nov 2025 18:57:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.224.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764183455; cv=none; b=jJOMW6YUX+3wESsy/nZsbaCdz9lBMZ5JkX6BeC42dT+k4i7n2XI9Radtjb3I1dgd/dNksnxOzdtZ15x3TMGcx7sNrmKyaXuKP23r4C4nGM5ygetBsGSpKwbWBEZ57Gtqe8rEL7l/QMFmB6DL3IW8raZduvNAyba4lrDp6vXR+Ac= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764183455; c=relaxed/simple; bh=fbBtS9Y1mVSWtFYG8bC2W6XeZU0LP5uWZoGlle1YCdE=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EjEBpoXvZN/junpkiJN8fMBZy898VqKiGlbbnzQ7wIzleDK1OO5tCgajxPbF7dMoX2tTQz+icJ5ogo8oAkdHSW91l7huiKoL3KtKS/cjlrDqzEXPIcS8RWL25AE3kjE7KNFEXVAMBf/P9haAAKaGCf+p6b3dNPIEmvJPvoFos6o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=soleen.com; spf=pass smtp.mailfrom=soleen.com; dkim=pass (2048-bit key) header.d=soleen.com header.i=@soleen.com header.b=JhlnHQOZ; arc=none smtp.client-ip=74.125.224.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=soleen.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=soleen.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=soleen.com header.i=@soleen.com header.b="JhlnHQOZ" Received: by mail-yx1-f41.google.com with SMTP id 956f58d0204a3-6432842cafdso88019d50.2 for ; Wed, 26 Nov 2025 10:57:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; t=1764183453; x=1764788253; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=1oylsZzHxgSZmbIVeALsxMTslnUgs+7hP6L3oGrSRE4=; b=JhlnHQOZturhy5G/GJ0fhe9qMittRwsPeWh6j5Q93uqDTmREGR+ypzagN2Q8/LKWXW hwcmDzL62lyAAfiYnfiQU5w2C/eEbfa8PQFzH9UquzQq2wXMBQDa2mGLA8f65NAkLjqv CYXclpApm/kAd45RqgoZVv+01mf2Wr/8jDhmbjW5isVqxjeJtFScTF6tDDrADrbtkSUz vpD5q/1CDhH6pi6u0mHVnSsLqPbDzXCzWFOSsoZWhSPdxLcbayIeNS9XXGD5vAczihiR gZuo/oF+4koYg1R7YRL/9gaGSz2qr80nk7h9HEylexqaNjNy3MfN0Q91jvUNrfd96sHN LG7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764183453; x=1764788253; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=1oylsZzHxgSZmbIVeALsxMTslnUgs+7hP6L3oGrSRE4=; b=oOeVYlmKpyFXTQkXDAofu4QWlGEzh0OwNaIu9SqomQhamjV5S+OUa1rROnD+p6GsMg 6AS6VWOy983jLAsD3rJQ6vBz73MogDi/YjwrzY5soC5IlqcWZV1xCFMGetYLpmXnJnvR 6E9KrxUR+MPWW/b0OphJHTJvY6y53daiXVNaJIn4bjQvAA0yN8gplmQY1wgj29QE2V2j JH7gnliKPAf1WZUSzXoufadRSZNn2lg2id8SSEMFhafJq7LEEkfFRX/9B/WUb3sR3146 LnIeJ3Td7rm8AruaJK3g2V3M0bRSgbYlAQ5CLgpzl6OdS9/YXHMNrH0eQ54qAM0I15O5 eYDQ== X-Forwarded-Encrypted: i=1; AJvYcCWgQOJj+l9qjAanIPIiMR5Ylp6HnsSG2mcFZuZcbAe/Xh99+JSx7MMJGLfmnuBVrumyR53N4VFbaNdN+PI=@vger.kernel.org X-Gm-Message-State: AOJu0YzlU8KDes5ydyk7LpwLYNmP3aRd5F7HVbh1C39olpGs4mtfaU+1 4Xk0AKKWwSggd9RJRtSYMvZEUE6DMexiV69muxyy+pgeUy+pfpBeGw2yBRixePgICdM= X-Gm-Gg: ASbGncvmoSiYTcsi2kIPQy6Njq6b3t+yGC6zPHmnfyXIBGIGwwxlUSqfDwOvRz9rZfc iClYtjtJtctkJ6xBs3CpnEo3J5ESTb1e79BEQfEbejZmn57sjWlNlTN4iOyiL4Ez1cJ2vU80+8d vRwNzBJqcMBXIpb0Uz8yKHRY+5UsBOjjJsoao9gAa9fQFDI0fJ84/+03vWyMTJE7L9FcouNDXpM tONmF8I/da/mkzuMEsM4Yjj6fKT1P/Dfjr55v0V/s3XuENdYIAiWqrphSNgwcrjA6r2M1JygR5P xfxWP4Kd4EB/sHsNPMjUd/OAeXya/l1ajkrfHlm/V0Edol4i8LWAGjCw4sr8zDhhMUWdjJXdqvP IBXDexNC/VwajEp4gsQMIxJEDgeKtVPBp4riyvHcL3Y0ff0bgycWug4AMPw40ilaNW1stvhJTty mr2iODMnE36pHn6s/qz65U4wOkkqGXGV4M4FRcjC6fXYmryDezG/7zHZIPkppkKt+cGkQMeLobm eLNWBU= X-Google-Smtp-Source: AGHT+IGh8g5413JLIZ5YQT+ZmThIIEoq9as1A69vg1Sj/F5GWrIm6uWyotiHcJrmkWo4Rj0KSPIvqA== X-Received: by 2002:a53:d84e:0:b0:640:db91:33d4 with SMTP id 956f58d0204a3-64302aafecfmr11761450d50.26.1764183453023; Wed, 26 Nov 2025 10:57:33 -0800 (PST) Received: from soleen.c.googlers.com.com (182.221.85.34.bc.googleusercontent.com. [34.85.221.182]) by smtp.gmail.com with ESMTPSA id 956f58d0204a3-643259fd696sm2960753d50.7.2025.11.26.10.57.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Nov 2025 10:57:32 -0800 (PST) From: Pasha Tatashin To: corbet@lwn.net, pasha.tatashin@soleen.com, nicolas.frattaroli@collabora.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, kees@kernel.org, davidgow@google.com, pmladek@suse.com, tamird@gmail.com, raemoar63@gmail.com, ebiggers@kernel.org, diego.daniel.professional@gmail.com, rppt@kernel.org, pratyush@kernel.org, jasonmiu@google.com, graf@amazon.com, dmatlack@google.com, rientjes@google.com Subject: [PATCH v1 3/3] liveupdate: luo_file: Use private list Date: Wed, 26 Nov 2025 13:57:25 -0500 Message-ID: <20251126185725.4164769-4-pasha.tatashin@soleen.com> X-Mailer: git-send-email 2.52.0.487.g5c8c507ade-goog In-Reply-To: <20251126185725.4164769-1-pasha.tatashin@soleen.com> References: <20251126185725.4164769-1-pasha.tatashin@soleen.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Switch LUO to use the private list iterators. Signed-off-by: Pasha Tatashin --- kernel/liveupdate/luo_file.c | 7 ++++--- kernel/liveupdate/luo_internal.h | 7 ------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/kernel/liveupdate/luo_file.c b/kernel/liveupdate/luo_file.c index ddff87917b21..c3af22fc2fd8 100644 --- a/kernel/liveupdate/luo_file.c +++ b/kernel/liveupdate/luo_file.c @@ -104,6 +104,7 @@ #include #include #include +#include #include #include #include @@ -273,7 +274,7 @@ int luo_preserve_file(struct luo_file_set *file_set, u6= 4 token, int fd) goto err_fput; =20 err =3D -ENOENT; - luo_list_for_each_private(fh, &luo_file_handler_list, list) { + list_private_for_each_entry(fh, &luo_file_handler_list, list) { if (fh->ops->can_preserve(fh, file)) { err =3D 0; break; @@ -757,7 +758,7 @@ int luo_file_deserialize(struct luo_file_set *file_set, bool handler_found =3D false; struct luo_file *luo_file; =20 - luo_list_for_each_private(fh, &luo_file_handler_list, list) { + list_private_for_each_entry(fh, &luo_file_handler_list, list) { if (!strcmp(fh->compatible, file_ser[i].compatible)) { handler_found =3D true; break; @@ -832,7 +833,7 @@ int liveupdate_register_file_handler(struct liveupdate_= file_handler *fh) return -EBUSY; =20 /* Check for duplicate compatible strings */ - luo_list_for_each_private(fh_iter, &luo_file_handler_list, list) { + list_private_for_each_entry(fh_iter, &luo_file_handler_list, list) { if (!strcmp(fh_iter->compatible, fh->compatible)) { pr_err("File handler registration failed: Compatible string '%s' alread= y registered.\n", fh->compatible); diff --git a/kernel/liveupdate/luo_internal.h b/kernel/liveupdate/luo_inter= nal.h index c8973b543d1d..3f1e0c94637e 100644 --- a/kernel/liveupdate/luo_internal.h +++ b/kernel/liveupdate/luo_internal.h @@ -40,13 +40,6 @@ static inline int luo_ucmd_respond(struct luo_ucmd *ucmd, */ #define luo_restore_fail(__fmt, ...) panic(__fmt, ##__VA_ARGS__) =20 -/* Mimics list_for_each_entry() but for private list head entries */ -#define luo_list_for_each_private(pos, head, member) \ - for (struct list_head *__iter =3D (head)->next; \ - __iter !=3D (head) && \ - ({ pos =3D container_of(__iter, typeof(*(pos)), member); 1; }); \ - __iter =3D __iter->next) - /** * struct luo_file_set - A set of files that belong to the same sessions. * @files_list: An ordered list of files associated with this session, it = is --=20 2.52.0.487.g5c8c507ade-goog