From nobody Tue Feb 10 01:31:23 2026 Received: from mail-4322.protonmail.ch (mail-4322.protonmail.ch [185.70.43.22]) (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 8045E35A94E for ; Tue, 13 Jan 2026 19:09:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.70.43.22 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768331380; cv=none; b=UT1NkkcfDqKs+/NuaDfE2bKSqriajKOUjskuNOcX07Ngm8tjZpTiJGLOGCG9YoAzy/dbRvGifhHRsYJeSsBf6Fj/fas8hIXLBHSGbGtj+sFYo5mtCclAgC66FkDykPR2lmebzcCsnfUr02cGF5jK8Bb2rA7nOSia0hrjS8hdh3k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768331380; c=relaxed/simple; bh=apGXgeWCBfuKeC6/ZUN5vENW8OXUmKiTv5g2GeKwJVs=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=qHfPiAaQ6Upp0axkpGZZ635W0RqYC5Qfk4vS7sPrSYGTYT8DulcwQXM2lWozBlqqeOWYOSbbDdlRm0TcUdU1w5E+SqK28qHY+PHJUlqDTJFj17n1IT8ZZ1fQjs4i0XVm7CVToxYegDLZJSR69MBc+9slolXpmfy2gJ74DRrlFgY= 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=jc36tney; arc=none smtp.client-ip=185.70.43.22 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="jc36tney" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1768331370; x=1768590570; bh=apGXgeWCBfuKeC6/ZUN5vENW8OXUmKiTv5g2GeKwJVs=; 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=jc36tneyKUlMYhwPCgt5vfBoNiNKwiZNSS9aSZcm4FDUItncXwcPAWoxZ/xGibHJR un+2nYacJMGGrfIZlsa1jlWavJj0bdgKfS83eb/G50oizvK2r+ovhGrsAEYZt75Rz2 CZZ2siOtLd8lLSBtmK9qWWUk+WdhXI+lQoPWLndnQ8m6MOo4Nlxba+hju12RpcRQ56 /qkZEUqQepFF8qRmTz2I1QC0vTaSUL2ImCju+L+8uk1KonMqxacF8KVNFIQhRIFJdN CZHifsdvPW0RdJ4YzvSofxvNp8kPDVvZkm7VKQREMZWD0ti4mLUwoloizGdYgDlrLd bPJn+u5LAdVww== Date: Tue, 13 Jan 2026 19:09:29 +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 9/9] gpib: tnt4882: Unify *allocate_private Message-ID: <20260113190759.54355-10-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: 11f4bb1f2692da06d7ed79564928d363f427e2fb 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/tnt4882/tnt4882_gpib.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/drivers/gpib/tnt4882/tnt4882_gpib.c b/drivers/gpib/tnt4882/tnt= 4882_gpib.c index c03a976b7380..e12002c0e982 100644 --- a/drivers/gpib/tnt4882/tnt4882_gpib.c +++ b/drivers/gpib/tnt4882/tnt4882_gpib.c @@ -845,7 +845,7 @@ static int tnt4882_allocate_private(struct gpib_board *= board) =20 board->private_data =3D kmalloc(sizeof(struct tnt4882_priv), GFP_KERNEL); if (!board->private_data) - return -1; + return -ENOMEM; tnt_priv =3D board->private_data; memset(tnt_priv, 0, sizeof(struct tnt4882_priv)); init_nec7210_private(&tnt_priv->nec7210_priv); @@ -916,8 +916,9 @@ static int ni_pci_attach(struct gpib_board *board, cons= t struct gpib_board_confi =20 board->status =3D 0; =20 - if (tnt4882_allocate_private(board)) - return -ENOMEM; + retval =3D tnt4882_allocate_private(board); + if (retval < 0) + return retval; tnt_priv =3D board->private_data; nec_priv =3D &tnt_priv->nec7210_priv; nec_priv->type =3D TNT4882; @@ -1039,8 +1040,9 @@ static int ni_isa_attach_common(struct gpib_board *bo= ard, const struct gpib_boar =20 board->status =3D 0; =20 - if (tnt4882_allocate_private(board)) - return -ENOMEM; + retval =3D tnt4882_allocate_private(board); + if (retval < 0) + return retval; tnt_priv =3D board->private_data; nec_priv =3D &tnt_priv->nec7210_priv; nec_priv->type =3D chipset; @@ -1725,8 +1727,9 @@ static int ni_pcmcia_attach(struct gpib_board *board,= const struct gpib_board_co =20 board->status =3D 0; =20 - if (tnt4882_allocate_private(board)) - return -ENOMEM; + retval =3D tnt4882_allocate_private(board); + if (retval < 0) + return retval; =20 tnt_priv =3D board->private_data; nec_priv =3D &tnt_priv->nec7210_priv; --=20 2.43.0