From nobody Tue Feb 10 07:21:23 2026 Received: from mail-4316.protonmail.ch (mail-4316.protonmail.ch [185.70.43.16]) (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 6B0D735B150 for ; Tue, 13 Jan 2026 19:09:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.70.43.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768331379; cv=none; b=s0ecVJUD8TkqR4Rt+oQxfl9HDTnJO4brcksX2iffuyER4W8ZB4WgGY2paQjtCwxrxHkJDgAkCNisqjjRPbyWq8TrGaXPxPEPTZ5EMoWnVnYyFkX3I3k4WPwnZBrfYeYra1oOiIWiK8LgC/Hk1UP7QB2ceoRd904GHxTfw0qtknA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768331379; c=relaxed/simple; bh=VVo1cPa8Qq8enlwClLOWNbEaZZM5rW/QX1GFz0NpdXs=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=WjSrLI1Qsbv9nWmCZw2aa4ElZHBlC17bnYNav4rpNwAX0TewCcg9N1mH8a1cFFycYGQZYFPEjAUxdwOWd8Abfu4LDgZcRxweXxPaOuHqcMT8F3e1C23PAzXy4iW+0UcJgSJNpWws25dQX9FLFNWy1v1zcz6Ot6G6HyDYu6Z+6AE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=protonmail.com; spf=pass smtp.mailfrom=protonmail.com; dkim=pass (2048-bit key) header.d=protonmail.com header.i=@protonmail.com header.b=Ayjc1M7w; arc=none smtp.client-ip=185.70.43.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=protonmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=protonmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=protonmail.com header.i=@protonmail.com header.b="Ayjc1M7w" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1768331365; x=1768590565; bh=VVo1cPa8Qq8enlwClLOWNbEaZZM5rW/QX1GFz0NpdXs=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=Ayjc1M7wOdPvuIyuBT+g1nvd3PggtY9vTESk4Ox3mYTOUHH+ce6O00nDWYEbV0WwO box9aH5BZBplCTypezjkSx6cfc+Hv9sdr9K19ULErS87L4c6qfeEuJayobSxuGxuVi X6R1o5ZQehp/fH+PU5EKVB0CdcYtBcxXIk3No9OGiWPWZ9gPnNUfOuknlEXWxK/h7Y PIWWEvk8EaAFj1OnsFSw+rmRaumFtEmj6jSLt+O258ww3T0HFwQ51c99zrm3SIFf02 iKkE0SKhEsUDWWFUpubd3r8kdoWOjiRrQoMYf/AoVwxCxDNUO7JSoMMPn6QTYh3UNg 1JRWVKGYkm2eA== Date: Tue, 13 Jan 2026 19:09:19 +0000 To: Dave Penkler , Greg Kroah-Hartman , Michael Rubin , Dan Carpenter From: =?utf-8?Q?Dominik_Karol_Pi=C4=85tkowski?= Cc: linux-kernel@vger.kernel.org, =?utf-8?Q?Dominik_Karol_Pi=C4=85tkowski?= Subject: [PATCH 7/9] gpib: ines: Unify *allocate_private Message-ID: <20260113190759.54355-8-dominik.karol.piatkowski@protonmail.com> In-Reply-To: <20260113190759.54355-1-dominik.karol.piatkowski@protonmail.com> References: <20260113190759.54355-1-dominik.karol.piatkowski@protonmail.com> Feedback-ID: 117888567:user:proton X-Pm-Message-ID: d5bc5a4c84828e448c914f94a72fb8fbce094adb 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" Return values for *allocate_private functions as well as calling code in gpib driver are all over the place. Unify them by returning -errno if something fails, zero otherwise. Use the returned value as early return value in case of error. Signed-off-by: Dominik Karol Pi=C4=85tkowski --- drivers/gpib/ines/ines_gpib.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/gpib/ines/ines_gpib.c b/drivers/gpib/ines/ines_gpib.c index a3cf846fd0f9..98f311f64d40 100644 --- a/drivers/gpib/ines/ines_gpib.c +++ b/drivers/gpib/ines/ines_gpib.c @@ -659,7 +659,7 @@ static int ines_allocate_private(struct gpib_board *boa= rd) =20 board->private_data =3D kmalloc(sizeof(struct ines_priv), GFP_KERNEL); if (!board->private_data) - return -1; + return -ENOMEM; priv =3D board->private_data; memset(priv, 0, sizeof(struct ines_priv)); init_nec7210_private(&priv->nec7210_priv); @@ -676,11 +676,13 @@ static int ines_generic_attach(struct gpib_board *boa= rd) { struct ines_priv *ines_priv; struct nec7210_priv *nec_priv; + int retval; =20 board->status =3D 0; =20 - if (ines_allocate_private(board)) - return -ENOMEM; + retval =3D ines_allocate_private(board); + if (retval < 0) + return retval; ines_priv =3D board->private_data; nec_priv =3D &ines_priv->nec7210_priv; nec_priv->read_byte =3D nec7210_ioport_read_byte; --=20 2.43.0