Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp7115782rdb; Wed, 3 Jan 2024 05:19:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IHc2KJnGK+xkcjXfo2MggaqSllU9PWYUngcF+aBD10h9NthBFFSTcN51X4i1gnibc+NM6jc X-Received: by 2002:a50:a414:0:b0:54c:4837:8b6e with SMTP id u20-20020a50a414000000b0054c48378b6emr11031529edb.60.1704287951029; Wed, 03 Jan 2024 05:19:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704287951; cv=none; d=google.com; s=arc-20160816; b=Uke0YE5LVh4RA8KZZynUvqE+W+g2F5s9q3T9LT7HPXBfwlSMx61PpPz+AUbvkFUohw EQ48N+WPVnwRd0ps9PZ7p8bw8ISeiZZeGsR8zRaxVpFtcvN4gX2Im/LipniVRoy15/Nt SK8uxEw4FkpnI98fAs/J7oWx8qShyNMP9lZENyvWjbuRUIeg8edjSQQmFGouJ1MLDx2t Y6Og9u2QYyNhQ5ph3ymc44Gp0e5F0aNS1QX2r/HhmSjatO1eA8SSIMwMWg36mettsrId +5zwrWTRPARDWt3AFk9LZJC9/xlwgcjI2X11gvN4WYC5jUzV4WHlV/cdb01CcZDzbQnU lLHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=Sr2fmxBzulqmqs2dOBQX+8TsXyEHTyzPy33iNci36RA=; fh=vWV2VTN3iG5VbnQnbmqagSIgABrCfnma69daZTYZsHM=; b=a+gf3Lqe7iTiVHyDxo2CQ9zRzOI0tuByLkNBilLUE29CVhoRCOCccgqjbgy8W3WD2O j8t3uXn5V56cvCYiWonhqdXaYAAnJVjBOd3aj9Prk+meQXt1nupV34fdT3APcKL+wBTa Ugs07ZvgatbftzuzMqvjgaA5FPK85ktGfsOmUw9QTxVGOy11SdCxpPZ05zSAxdIUSX4w EkwPivlumSeEKwJEpmblqnmTVGlJ1C2s/fLWyrebSoNHmZu8s/jAUbvEu1vK1m/Fa1Nw kHNmC8K7e5gstMZZnTCP4wVgkjXBX0HZnb+CUPj6FhIqD1UR31iUE1iVCO4CuxOXwPGp 6pBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FIXl2bRm; spf=pass (google.com: domain of linux-kernel+bounces-15558-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15558-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id w18-20020a056402269200b00554c01b458esi9224644edd.645.2024.01.03.05.19.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 05:19:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-15558-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FIXl2bRm; spf=pass (google.com: domain of linux-kernel+bounces-15558-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15558-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id B8CC81F21C77 for ; Wed, 3 Jan 2024 13:19:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C6E511947E; Wed, 3 Jan 2024 13:19:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="FIXl2bRm" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0690A19461 for ; Wed, 3 Jan 2024 13:19:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CA211C433CC for ; Wed, 3 Jan 2024 13:19:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704287941; bh=xrx8tAG25cH7qJUEOXQQhYiGgCOyf/FU0c4VMO580+8=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=FIXl2bRmU40SM+N0uVNqENqGSEmxA/xdX6ld5jxaPqdwLMG3ewGgkhCI7K3Kz12si JDHeCzmvWKwoTjhe4qqD50ml52Ii/8rxWi5AWebrKmKV8A+4bUbBDhSHimmhp9f6mw uFw3qbRvwu+MsbdfP58+U5064T2UtvRx3NKvT7sr7m93ZO44sLHwYmRjHqzjJnbNrw 8dhG7aOT39MTLqwMyj74XKJUMuuXOjspLIuDFLcj/gts23o9SjD3NK5fpkN87qOo/e conxzgrsI+dLhyvV1x7vHGkCHAiOxWZ71bwYM2FTXy2W+Au68NwwYdAXCYY0qIbic/ E5hBRQK0i+dbQ== Received: by mail-lf1-f45.google.com with SMTP id 2adb3069b0e04-50e7d6565b5so7513471e87.0 for ; Wed, 03 Jan 2024 05:19:01 -0800 (PST) X-Gm-Message-State: AOJu0YxZF+Mv6u3bw7y435Z98PICKH6c0fs49o1z+oOfGd7uqynEo2sz ixpJO+4TWWjWUX2xnp/Mt8cjYFVRqDc6dii4Wfo= X-Received: by 2002:a05:6512:1308:b0:50e:84b1:c14 with SMTP id x8-20020a056512130800b0050e84b10c14mr6420923lfu.26.1704287939999; Wed, 03 Jan 2024 05:18:59 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <4a97c8e6996c9c95244715310b57ce5af6ccb1ad.1703596577.git.u.kleine-koenig@pengutronix.de> In-Reply-To: <4a97c8e6996c9c95244715310b57ce5af6ccb1ad.1703596577.git.u.kleine-koenig@pengutronix.de> From: Ard Biesheuvel Date: Wed, 3 Jan 2024 14:18:49 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/2] virt: efi_secret: Convert to platform remove callback returning void To: =?UTF-8?Q?Uwe_Kleine=2DK=C3=B6nig?= Cc: Dov Murik , Dan Williams , kernel@pengutronix.de, Gerd Hoffmann , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, 26 Dec 2023 at 14:28, Uwe Kleine-K=C3=B6nig wrote: > > The .remove() callback for a platform driver returns an int which makes > many driver authors wrongly assume it's possible to do error handling by > returning an error code. However the value returned is ignored (apart > from emitting a warning) and this typically results in resource leaks. > > To improve here there is a quest to make the remove callback return > void. In the first step of this quest all drivers are converted to > .remove_new(), which already returns void. Eventually after all drivers > are converted, .remove_new() will be renamed to .remove(). > > Trivially convert this driver from always returning zero in the remove > callback to the void returning variant. > > Signed-off-by: Uwe Kleine-K=C3=B6nig Acked-by: Ard Biesheuvel > --- > drivers/virt/coco/efi_secret/efi_secret.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/drivers/virt/coco/efi_secret/efi_secret.c b/drivers/virt/coc= o/efi_secret/efi_secret.c > index e700a5ef7043..cd29e66b1543 100644 > --- a/drivers/virt/coco/efi_secret/efi_secret.c > +++ b/drivers/virt/coco/efi_secret/efi_secret.c > @@ -326,16 +326,15 @@ static int efi_secret_probe(struct platform_device = *dev) > return ret; > } > > -static int efi_secret_remove(struct platform_device *dev) > +static void efi_secret_remove(struct platform_device *dev) > { > efi_secret_securityfs_teardown(dev); > efi_secret_unmap_area(); > - return 0; > } > > static struct platform_driver efi_secret_driver =3D { > .probe =3D efi_secret_probe, > - .remove =3D efi_secret_remove, > + .remove_new =3D efi_secret_remove, > .driver =3D { > .name =3D "efi_secret", > }, > -- > 2.43.0 >