From nobody Mon Apr 6 19:59:51 2026 Received: from mail-yx1-f54.google.com (mail-yx1-f54.google.com [74.125.224.54]) (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 750813DC4B5 for ; Wed, 18 Mar 2026 14:17:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.224.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773843428; cv=none; b=J7Wzu5aslsO3O0MDVoSRCPemsJzgkjbtbY4xICz+LlNt4qz2Y+cSEtYIzrkK+bbRSy0bGoseEG7h1Aumr8QSRmWr/LszxpzZb8myN9W+5TWl9pQe68H7nN6hWMoajFc95Ix6uXkG6keHqJ7bp1RnZxlieEL4ELuZGYpPxtcMRmU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773843428; c=relaxed/simple; bh=iQJqefJr/CoUSt54uwlSGDn/SfrrD/dJQLTwLis101Q=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GAQsLYe0Zmsgv99vlawQxR7CiSvbNMBcnETD4ZVMzP7h7aqMH0gyJdKFuCTlsD8kLfndG6O6izi430z7Z500vfLg7Nh4VUSiDICgUtmOWPB5a7wcpIDQslA/J/4RS6PQ/eP/8LmepQql5Rz9WmUEoNGkESY8Vk9j6A97zw63c1Q= 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=R2Puydnx; arc=none smtp.client-ip=74.125.224.54 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="R2Puydnx" Received: by mail-yx1-f54.google.com with SMTP id 956f58d0204a3-64e87a81639so2640835d50.0 for ; Wed, 18 Mar 2026 07:17:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; t=1773843425; x=1774448225; 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=zJIAgTqcwEqKxZF+DzcRiR6G39ka6soPVjhZwY8SjyM=; b=R2PuydnxEw1OVL5t3eHUFXZu0gsXQ/04IT8nLnpbP78crveRy5Wu3NyN+lDLgSBOrF H73RFPxzIY+OGIr5UWQRtFNBTROc6DdMaN5aMLK8OHOzJIUIdl1X3Qq99nx0KFBe3+J4 osAk1SBoxEfuqV0coQMG9Nk2JzyQk6KZNwzTLVOuXxF3oPm0gpQ+JT4WhXMCgLhzqF1a qggQcF4sfzr3YiQDOIzOJhB3z4Il6Jxl7095NnoZGVR/sdodAkKrfFZ3eqthKx/wJKdK pyTZpuGMPB7IrgcJ0YC0+PpaPXv9I6fIP4uhI+DYB/W/DwfkUHLmcMd4nivjy9Sx7Oyn L8hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773843425; x=1774448225; 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=zJIAgTqcwEqKxZF+DzcRiR6G39ka6soPVjhZwY8SjyM=; b=eaUMPSfGXszA2cri+3JbvEXg6sySD4FZHpmS0jsPBWosvYusXu1Au3bozDOAmlG8O7 BuapTYyQE+IWS4g6E7gUE8c7/JwUsDId1j6tSIbCT4gGYP2h9si3lvMQzH6QX6M5esgw htS2GaFGb0wHxomgaAq5xwmz0CnvD/KcbTHqmCiL+8D9nxI1W9dz+xhV0pVAlAeJO74u 0Lixvf4zUzDayHhwtcOiX0Jg7hcdySLuNn8Rs+HRtO3nejP5TSzR/5FkoHauXIbntECW n73psddqMc3gjC7/jtpLOAyLdX8PV14zx4DEEHAPRCduHMYhn5HiUODcsDoYSJNgv8EU T+/A== X-Forwarded-Encrypted: i=1; AJvYcCUEMEo5g4bUblH/kDWaftCHjeW2wm/19lonmqRcqhTNGsG0lLQiL0jvOTXvs6L8ImST2s5j1ZtKMujpOsE=@vger.kernel.org X-Gm-Message-State: AOJu0Yx0lQqlb6ZaNhrLoKEO23hbP0uCi0ds9dq/t4T8Q6gEAIngf8zg eUU9Vcj17RXRer0VAuDDOcUQZxoHdcdu9MxXrF5SlRfZImDQMmFG6YHvos2uABedZ9Y= X-Gm-Gg: ATEYQzxmgeiM5aPRKeOGNDtsMVkngtm7FR7BVzl/0sNJq0CctvYEuShmNUBC8IP8LJ4 vV0xZH+zbmoJ+/I7hBepvlcQAtUFMtvcurpwKvK9m2xE8mcb5ExcrsDlfpNph27DuGQJgWHz3Yc MZ7lxcH5PKJ6o0kkxOqeeMt65NDlQXfpDN8Qge3nB2aNyIFEtsFm9DT9fE2y4ZXIc3Yxh83FVrB /6xBDM109QE7zOyQnhlcs/EAvm49eKLTf3ht2O5LdnNf5u41lEY1+VMDRtQVptW35m9oJWyzuZI IuZjVkHgvA4AogjpeyQF7jzXtFz6zaBrhYJJ5veTPkfdbNO3x0b6on2DODnzG4irdZuC2wcovBQ /gg+ABclRtGFlO2H7Unk/QeN9Ta4KPqXHwxh8Gh37J1Y6UTfaU0AkTf4H09WXinB0H+0FNjiBhF QzQlsjF35DP4xqvbAKa56Ij1e5jNXGq4aBHScCXatlsbAd481pyTHwQkM3ZoAAbrE6dpznjgrBv Y1tVf2vzG7tvF3Fzbas1PRIaLkxjwv8HgOQx2FCenuW/EyWWQ== X-Received: by 2002:a53:b451:0:b0:64e:7d41:29a6 with SMTP id 956f58d0204a3-64e9172c834mr2927143d50.78.1773843425032; Wed, 18 Mar 2026 07:17:05 -0700 (PDT) Received: from soleen.c.googlers.com.com (57.233.150.34.bc.googleusercontent.com. [34.150.233.57]) by smtp.gmail.com with ESMTPSA id 956f58d0204a3-64e91be0e91sm1672028d50.15.2026.03.18.07.17.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Mar 2026 07:17:04 -0700 (PDT) From: Pasha Tatashin To: rppt@kernel.org, akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, pasha.tatashin@soleen.com, dmatlack@google.com, pratyush@kernel.org Subject: [PATCH v2 8/8] liveupdate: Make unregister functions return void Date: Wed, 18 Mar 2026 10:16:46 -0400 Message-ID: <20260318141637.1870220-18-pasha.tatashin@soleen.com> X-Mailer: git-send-email 2.53.0.851.ga537e3e6e9-goog In-Reply-To: <20260318141637.1870220-10-pasha.tatashin@soleen.com> References: <20260318141637.1870220-10-pasha.tatashin@soleen.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=4047; i=pasha.tatashin@soleen.com; h=from:subject; bh=iQJqefJr/CoUSt54uwlSGDn/SfrrD/dJQLTwLis101Q=; b=owEBbQKS/ZANAwAKAbt3KEzbc3reAcsmYgBpurPQ01nnBZVHBvgS5KZW9wUgfyP0EgxeiXQoQ Aio6skXjrSJAjMEAAEKAB0WIQRBMaqT7LRvGvB/NmK7dyhM23N63gUCabqz0AAKCRC7dyhM23N6 3qYdEADIX8djMB8QpL7SqEjHbjgNU4y6AHtYiJSRuvwaqKvRH9B/uTysQ9JuByNUn+QCH+u9yOI uAgpflNxMb3xxezKl/4CjMyqMwjxcIhdw3kAY4O5GoJsMHpCDtqVfHLPJ+CH31h1hH50Il0NKGV AcT3X53LUz0Zlv7nXC0/5pB+mkR0KSLbtrCLMs1NNl3RqJ43a+2jtRq2+uYnqakButu+3GcdBx7 MjogkEWuhtHzgYCI0sa8gq8AdUFMxf8Ng62w6E6DGlaSOm8h+V0xKlV9ZczAeQ3oK7eis2RdYuA Y/zb58JqMTHw7jILMxq8Q8kUiv/5AI3SS/jLuyE7eDwUz3s627zXDITXdBOkkW6QcyxFNlFMu56 jQVigdcJm/8S8w9d/3ghjQ8Jr7QuhlG3SptT8J9QG4Wld5Zi13Gcd1keHjw9Tp5QDzVk2yfHMOc a//f0+R9F4VJshhpzAlFiJzVpb7GE/gCxB37WyLq+/av7UqWlRICO4o9J9TTcUujty4N4LekaS9 VtluW/IkW4XIviSrynpY4KxRWo4kiBocTX+d+SlK/sj6nKUhG4KW7IrTg7V3uK9XO5x3lD4AR6Y EJfxB9ZuNiX7eruEQWckstsGNqwrh+d11lM+YPWBix0OTifxDCn3iO/m4PENWX3FBhfYWa+qOAy IrUAF+aiUQjauCQ== X-Developer-Key: i=pasha.tatashin@soleen.com; a=openpgp; fpr=CAAAB722DD22A081F0D49F35633A6A993D43B569 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Change liveupdate_unregister_file_handler and liveupdate_unregister_flb to return void instead of an error code. This follows the design principle that unregistration during module unload should not fail, as the unload cannot be stopped at that point. Signed-off-by: Pasha Tatashin --- include/linux/liveupdate.h | 14 ++++++-------- kernel/liveupdate/luo_file.c | 6 ++---- kernel/liveupdate/luo_flb.c | 8 +++----- 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/include/linux/liveupdate.h b/include/linux/liveupdate.h index 8394fb2d8774..636175432d62 100644 --- a/include/linux/liveupdate.h +++ b/include/linux/liveupdate.h @@ -231,12 +231,12 @@ bool liveupdate_enabled(void); int liveupdate_reboot(void); =20 int liveupdate_register_file_handler(struct liveupdate_file_handler *fh); -int liveupdate_unregister_file_handler(struct liveupdate_file_handler *fh); +void liveupdate_unregister_file_handler(struct liveupdate_file_handler *fh= ); =20 int liveupdate_register_flb(struct liveupdate_file_handler *fh, struct liveupdate_flb *flb); -int liveupdate_unregister_flb(struct liveupdate_file_handler *fh, - struct liveupdate_flb *flb); +void liveupdate_unregister_flb(struct liveupdate_file_handler *fh, + struct liveupdate_flb *flb); =20 int liveupdate_flb_get_incoming(struct liveupdate_flb *flb, void **objp); int liveupdate_flb_get_outgoing(struct liveupdate_flb *flb, void **objp); @@ -258,9 +258,8 @@ static inline int liveupdate_register_file_handler(stru= ct liveupdate_file_handle return -EOPNOTSUPP; } =20 -static inline int liveupdate_unregister_file_handler(struct liveupdate_fil= e_handler *fh) +static inline void liveupdate_unregister_file_handler(struct liveupdate_fi= le_handler *fh) { - return -EOPNOTSUPP; } =20 static inline int liveupdate_register_flb(struct liveupdate_file_handler *= fh, @@ -269,10 +268,9 @@ static inline int liveupdate_register_flb(struct liveu= pdate_file_handler *fh, return -EOPNOTSUPP; } =20 -static inline int liveupdate_unregister_flb(struct liveupdate_file_handler= *fh, - struct liveupdate_flb *flb) +static inline void liveupdate_unregister_flb(struct liveupdate_file_handle= r *fh, + struct liveupdate_flb *flb) { - return -EOPNOTSUPP; } =20 static inline int liveupdate_flb_get_incoming(struct liveupdate_flb *flb, diff --git a/kernel/liveupdate/luo_file.c b/kernel/liveupdate/luo_file.c index c9c26015020b..a38ea4975824 100644 --- a/kernel/liveupdate/luo_file.c +++ b/kernel/liveupdate/luo_file.c @@ -874,15 +874,13 @@ int liveupdate_register_file_handler(struct liveupdat= e_file_handler *fh) * Unregisters the file handler from the liveupdate core. This function * reverses the operations of liveupdate_register_file_handler(). */ -int liveupdate_unregister_file_handler(struct liveupdate_file_handler *fh) +void liveupdate_unregister_file_handler(struct liveupdate_file_handler *fh) { if (!liveupdate_enabled()) - return -EOPNOTSUPP; + return; =20 scoped_guard(rwsem_write, &luo_file_handler_lock) { luo_flb_unregister_all(fh); list_del(&ACCESS_PRIVATE(fh, list)); } - - return 0; } diff --git a/kernel/liveupdate/luo_flb.c b/kernel/liveupdate/luo_flb.c index 5b61c0844a49..874830f8e44d 100644 --- a/kernel/liveupdate/luo_flb.c +++ b/kernel/liveupdate/luo_flb.c @@ -476,18 +476,16 @@ int liveupdate_register_flb(struct liveupdate_file_ha= ndler *fh, * owner module (acquired during registration) is released. * */ -int liveupdate_unregister_flb(struct liveupdate_file_handler *fh, - struct liveupdate_flb *flb) +void liveupdate_unregister_flb(struct liveupdate_file_handler *fh, + struct liveupdate_flb *flb) { if (!liveupdate_enabled()) - return -EOPNOTSUPP; + return; =20 guard(rwsem_write)(&luo_flb_lock); guard(rwsem_write)(&ACCESS_PRIVATE(fh, flb_lock)); =20 luo_flb_unregister_one(fh, flb); - - return 0; } =20 /** --=20 2.53.0.851.ga537e3e6e9-goog