Received: by 2002:a89:288:0:b0:1f7:eeee:6653 with SMTP id j8csp439997lqh; Tue, 7 May 2024 04:07:27 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWAKA403DASM8wnSE5rvykyGKMqXw8wCBGcevVY7Ya9t07XZdFox56rhEWtHroedQP9IIBlRvLG6KJg7BZRkCMqD6nHeaEzqL3Q/+l3QQ== X-Google-Smtp-Source: AGHT+IFAi1XKnuvOv2iK8oIQfTIQ+qs1/SPpk69mfZ2w4H16pIznJVXZnJ++eMZVdsfFv+AnEZho X-Received: by 2002:a17:902:d510:b0:1eb:76ac:b4e5 with SMTP id b16-20020a170902d51000b001eb76acb4e5mr15438767plg.49.1715080046800; Tue, 07 May 2024 04:07:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715080046; cv=pass; d=google.com; s=arc-20160816; b=ANAxpVPOoqLKKuFwLjRX3ADCcG4Q0tByuGvp0G/EaCmBUe7oGYhsXtJLAgRO75gH0O cRySbahC0eWBwUQGOvlYdZnM37qbI3H+IzPh0zS6p+VjACkRK7uBQ/e6bv1aYxWmL/6z YRJemG3gNKPBeOCnihv2s39R2Sw4QtkQH9EPuyVEoiyjsWGl2/HI0d0JzIR1Oau9WJOx 3FfhtKqQnIPzLi91ynuEyqfM5GuBekEl9177DYPLKy+mV4VxYHXB4rVJPJhSqmgH8cL+ X08ldAWFn/vzxt+6CfvlXEAcz704dCYLYFscMtc6upzDPbtQ1/ocHczH5E/2zd0tL6cI GJUw== ARC-Message-Signature: i=2; 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=RVraaqpU90T9jNynBtCQENH1uJ2RcPjIHtQUyCKdwiE=; fh=PB7e6Xzixo90J/VxRx+GSJ5E3ex918qJnZeNlkFVzYE=; b=QDf8Ym9ccxNkKcpqzSdIM0Nm/4Gl4OwqawApNxODugJv0zQBLmcpggakjitUyIGfna P3MCOlOPKUVfydmMX2JYd1Q7Aogh+mUfHgCdrxcyh0SFnXCClq/sSf3PxFpF2d/peWJO c09W5nY+yd/l2JWiIyE0JqOls+SYjEv4X1w0XukpQ9UTez7esVR5vCfG4ATvYIYZq/VQ gPNgwJ3nl8pdlsPCmAaydNqgxQOpJNLLuZsbg0N0vTAsHAc7z4MJSTxw3XNMIpTWObJR rfMbf7LYDlFBtqvIt7VIYE2lRmxmPZcHkFSlZigMPEcez7IZ6JftGpxbMAzaK1XaecU6 Ak9Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=fCgx7jU1; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-171115-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-171115-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id x11-20020a170902ea8b00b001eb1ce906b5si7493342plb.291.2024.05.07.04.07.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 04:07:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-171115-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=fCgx7jU1; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-171115-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-171115-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id F0283B26FA7 for ; Tue, 7 May 2024 10:40:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2952D14F13A; Tue, 7 May 2024 10:40:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="fCgx7jU1" Received: from mail-ed1-f50.google.com (mail-ed1-f50.google.com [209.85.208.50]) (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 D27B414EC4A for ; Tue, 7 May 2024 10:40:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715078409; cv=none; b=BuDIXmSB1qAQFnP1dyvQA4f5ZOvVBUAHx3xVCtcNkBTjEdHsXM1yqRPMN/3Fdzwvxzh0BjqC19KmuLu+GKHw9Mkp0D3knZQGhPm1J/8EcK5v1cLnLlGXmfrdB2U163s8XOE0PDR7+WyNg9jdoUU8QSyMEJiP9jJdgo1iTtTzhpw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715078409; c=relaxed/simple; bh=RVraaqpU90T9jNynBtCQENH1uJ2RcPjIHtQUyCKdwiE=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=cVtwFUPYHbkxv1st4LUV/+eHYvnPZbEP3Pddw69v9jPTgjLKNxGqQsmFsJHHg11+e54x77H10UixsGBtV7WuAWfqQZoP7A1m5pnGEDhArFpRreRiuC8//p+WMVAD29BVMdYlTbrmHWoJqHU5tc/fx8UGy2Nj/Ol0dbSSfZsA1vA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=fCgx7jU1; arc=none smtp.client-ip=209.85.208.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-ed1-f50.google.com with SMTP id 4fb4d7f45d1cf-572aad902baso13640a12.0 for ; Tue, 07 May 2024 03:40:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1715078406; x=1715683206; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=RVraaqpU90T9jNynBtCQENH1uJ2RcPjIHtQUyCKdwiE=; b=fCgx7jU1Vi89ZQGCFu2/QnRfHtiWPfbRHcU+kdtVk9XO6SV4Red2KNBljrXdtwhgKh qpQ/MRspQYGbeJ8Q5Ih1xuDE4zLG6JmQ3bxyZ4c6TWVVbkcYXIPLG8ICPTlt64SA1E4S JpEpvjDRhQUJcSTo95i+Zz8azUjPJaslE+3+JJ7Svfeu3BTOw0Ntx1//FxLtcaoCW+t2 9x2qfAwDp15Vbf/V/UEeiC3rzVEc6zFavWSJOCwRMq6IuEBWkKITZO96EyTKpF6QY+Di So82IvE7sWU5tZHahsmJKd0lQZinXSihE3HDAktbIRM18CXVPpgsVXTk8R+Ez5Row8s/ BUlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715078406; x=1715683206; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RVraaqpU90T9jNynBtCQENH1uJ2RcPjIHtQUyCKdwiE=; b=Wd7TQiZNLNgMzkYNXQZPAnaHFpudVo+SlPnLp0GCUyiWjqFMQWXzswwYxt4uy0Ti7A k8lyVZ9w91tjop6UzvoMP034/mseF34vgxq6Rxw1jwRWs2YjNCwE6f4lFp9ZbwDUBsdu 1paq3Pg19YJgrPsMgTbj4sha06F/PnL3U7c0cJZNci483xEL4weShOB6INTDkiYGTeHZ a+vOV7dxuL2qovyQOebO+yP4usmx7h0ZFscMhkTB61QEIvPtjia6dTmU9aR8QeQbhLnr 6wUJ+oXKfpmZA3k2yp8pZtbPB90wlXKi4Jf+2SA1hf08s6qnh7YfaKcQFC+7wPMHlsbe NVEA== X-Forwarded-Encrypted: i=1; AJvYcCWsxVAtKFsFVEn6muIFhea9yKtwe9yK4WGVwOW9aIj2XIXewzc+obFvWWIj85DGzPheniGcdf2eqgyCUe0CsmUZkMyT0TuzVMC2u26H X-Gm-Message-State: AOJu0Yz7jcj8s07FzZ0PBr4f85LzBoLVSUQk9mDj9elBwFActsGI39rU RHqm+Ppcpy1u3YDIzVHkdfk2d05+xRWCakxLqZbRAMD5200RbRlnyo1ZjZpe0kEJ0z7NyCvE3/B wGH51tbkH7h2QZBo9jpPxPdmFKrPOHL3vyw+o X-Received: by 2002:a05:6402:35d1:b0:572:554b:ec66 with SMTP id 4fb4d7f45d1cf-5731310fe6fmr162918a12.3.1715078405878; Tue, 07 May 2024 03:40:05 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240507090520.284821-1-wei.fang@nxp.com> In-Reply-To: <20240507090520.284821-1-wei.fang@nxp.com> From: Eric Dumazet Date: Tue, 7 May 2024 12:39:54 +0200 Message-ID: Subject: Re: [PATCH net-next] net: fec: Convert fec driver to use lock guards To: Wei Fang Cc: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, shenwei.wang@nxp.com, xiaoning.wang@nxp.com, richardcochran@gmail.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, May 7, 2024 at 11:16=E2=80=AFAM Wei Fang wrote: > > Use guard() and scoped_guard() defined in linux/cleanup.h to automate > lock lifetime control in fec driver. > > Signed-off-by: Wei Fang > To me, this looks like a nice recipe for future disasters when doing backpo= rts, because I am pretty sure the "goto ..." that assumes the lock is magically released will fail horribly. I would use scoped_guard() only for new code.