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 2CFC31F3D56 for ; Fri, 14 Aug 2026 04:17:02 +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=1786681024; cv=none; b=BqW6ajC3xHySU4QaJigX4NO6lZOF3a30dhpKuFUYpFJkbwHzClb9ysv1tH7fSW3n/uaPE07mT4PhfEMBjwkeMZbJAS2tSE9omxid1XIgYC7FjiMQDgbL4Q/WgKOlSyrLfoLDkSjfWotaOV1r4NF6cDT9wsocZ4322jJVQy/7/Sc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786681024; c=relaxed/simple; bh=ZwZ3tDN8AsuylW7cS13FaTD1E6dNHMs8RAP+/RxebE4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ccTeyNRYJlnYLSpdr458pX0zae0vRfcy7j4FTRCWsqNzqqeN4B/6L/nRTMhUePfb+/XPmxW1Fu1DCK8FusM8Va+9F5L37oqW8hxjsD8CmI+tMV9s0SWsApyydiwnNaR1teuwMRo+DepLv6Xz/DDiHyBSdpmZ7xdv2O6b3IASUtc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=an/o12Sf; 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="an/o12Sf" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7EB5E1F000E9; Fri, 14 Aug 2026 04:17:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1786681022; bh=eMPNbZ2+sfD8wiOkvzFUaemfh6XAPCq/65D4BdyAuuo=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=an/o12SfKRAainHgonXGDpwMhxrdvbkrMt9LxnVMEwehwZ5E4mbyuWU33ZjIG+cOU s4AOjRu3q8suOvWsRxZR0dQfKykUDm7FyrvCHZ2Pvy5ZBYvybGoPXacuz5KvrI4I/U 0lNEq0x0PJRjyy3cRrwW+xgSp1Mh0W1GuyniYdT6w1xX7Co6Xw4AzV3CLH6qC+i+MP eSdTA9icR8IAbowodAJ/+6FEaDZ+rKgb/qD0qinByPBPg7IcbhQLt1s95gv7sjpb5G 8MSK2TXfpgzPpRUdudiM3kmT3PbVhujqPzwdmih4YQ3Xrd9JN2IZcNwzFPN/mkhkOi oGuNeMhRGcqzw== Date: Fri, 14 Aug 2026 11:57:24 +0800 From: Jisheng Zhang To: Frank Li Cc: Alexandre Belloni , Frank Li , linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] i3c: dw: make struct dw_i3c_cmd smaller Message-ID: References: <20260813044603.22425-1-jszhang@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: On Thu, Aug 13, 2026 at 04:38:32PM -0400, Frank Li wrote: > On Thu, Aug 13, 2026 at 12:46:03PM +0800, Jisheng Zhang wrote: > > The dw_i3c_cmd is dynamically allocated, make it smaller. For example > > on 64bit platforms, we reduce the size from 48 bytes to 32 bytes. > > > > Signed-off-by: Jisheng Zhang > > --- > > drivers/i3c/master/dw-i3c-master.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/i3c/master/dw-i3c-master.c b/drivers/i3c/master/dw-i3c-master.c > > index 6ba84a97765f..d6f84f0f4c2d 100644 > > --- a/drivers/i3c/master/dw-i3c-master.c > > +++ b/drivers/i3c/master/dw-i3c-master.c > > @@ -247,10 +247,10 @@ struct dw_i3c_cmd { > > u32 cmd_lo; > > u32 cmd_hi; > > u16 tx_len; > > - const void *tx_buf; > > u16 rx_len; > > only switch rx_len and tx_buf should be enough. otherwise there are data > pad after u8 error. If we keep the error at the end of the struct, there's still padding after the u8 error. There's no big difference between current sol and only switch rx_len and tx_buf on 32bit platforms. But on 64bit platforms, the current version makes use of the pad to store the error, thus saves 8 byte more. Thanks > > Frank > > > - void *rx_buf; > > u8 error; > > + const void *tx_buf; > > + void *rx_buf; > > }; > > > > struct dw_i3c_xfer { > > -- > > 2.51.0 > >