From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 DF51B3E172E for ; Fri, 12 Jun 2026 16:05:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781280331; cv=none; b=pG6Iv5LZzb2E03DsuiDurh4ww2KgIiaTlxLpfmMzoJvUiClthCXD8T3gR/9CIMibRect/y1gD5Z2LSC0/szeKz4FqjXzlr1eSWhR/VAsYnzUG35c0W5ogrhzq89LRZ51doun8tqV8ciAlLBGJCbRdRzZHTK0kQWPHlzKNyUIo4A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781280331; c=relaxed/simple; bh=SgkOby8iUoiUh+Qm1RDuPfHKCF/Z1/cog7WkpdcD4Bw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dMzEHRnNP8ZZqP1mc88Jtih3rMLVYw9N5GMJRSQhaQNW5X1mzluaQjG2SNX78M5i0xoFstHJDKVmSf3tmpyLRNSRnwBHuBjK1J1jUiIiySOSObXEvpDmEuHnT2Y7CWUCC5/IuFVYndO/8+dMLS7GShrTfTUCXTF7f1Nr+HHLbuk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=aNuQSghq; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="aNuQSghq" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4A4AF1F00A3A; Fri, 12 Jun 2026 16:05:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1781280330; bh=60IK6YWG+dRDFCv45v80sBI9qCNyBc+1E3j9SG0opzc=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=aNuQSghq9i4tuHySJTjA1uYoTkudWnrfw/8khOg7fxsQKltb6hnIaw8T4Tg0NToTE gHAMPRtN3Okeq+ClNzkAxDZzHCxQHotc1a/MOvsSM9ua6+kbJD7TyLPIYjOEQcT05N SmoXAu/stl3YVWPfHKeuBSx0Drql1I77rceyL6spV+I9Easc7Zz7jhjWjV8LdV7ZWr hejWb0psnNK+dNrKeIuJ7jJ+QNVWdHnRqNSyb4FKqSQcp7gJo1lv9cZ0etXPdsC8wu 0VtwRa5EGnRa1U1sl5T3roY6BznyMRNCkD2e4QUTzxFoBB297jWVHCGxhYTOINf/lm az9c8ax49l+0w== From: Claudiu Beznea To: wsa+renesas@sang-engineering.com, tommaso.merciai.xr@bp.renesas.com, alexandre.belloni@bootlin.com, Frank.Li@nxp.com, p.zabel@pengutronix.de Cc: claudiu.beznea@kernel.org, linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org, claudiu.beznea@tuxon.dev, Claudiu Beznea Subject: [PATCH v4 09/16] i3c: renesas: Return immediately if there is no transfer Date: Fri, 12 Jun 2026 19:04:51 +0300 Message-ID: <20260612160458.3102106-10-claudiu.beznea@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260612160458.3102106-1-claudiu.beznea@kernel.org> References: <20260612160458.3102106-1-claudiu.beznea@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Claudiu Beznea There is no need to allocate a transfer structure when i2c_nxfers is zero. Return immediately instead of unnecessarily allocating memory. Signed-off-by: Claudiu Beznea --- Changes in v4: - none Changes in v3: - none Changes in v2: - updated patch title drivers/i3c/master/renesas-i3c.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/i3c/master/renesas-i3c.c b/drivers/i3c/master/renesas-i3c.c index 9edd2dc96107..fa9c15381ed6 100644 --- a/drivers/i3c/master/renesas-i3c.c +++ b/drivers/i3c/master/renesas-i3c.c @@ -1061,13 +1061,13 @@ static int renesas_i3c_i2c_xfers(struct i2c_dev_desc *dev, u8 start_bit = CNDCTL_STCND; int i; + if (!i2c_nxfers) + return 0; + struct renesas_i3c_xfer *xfer __free(kfree) = renesas_i3c_alloc_xfer(i3c, 1); if (!xfer) return -ENOMEM; - if (!i2c_nxfers) - return 0; - renesas_i3c_bus_enable(m, false); init_completion(&xfer->comp); -- 2.43.0