From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Dave Jiang <dave.jiang@intel.com>
Cc: Yi Sun <yi.sun@intel.com>,
anil.s.keshavamurthy@intel.com, vkoul@kernel.org,
dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org,
gordon.jin@intel.com, yi.sun@linux.intel.com
Subject: Re: [PATCH] dma/idxd: Remove __packed from structures
Date: Thu, 20 Mar 2025 17:45:03 +0200 [thread overview]
Message-ID: <Z9w3_2NkSJCvV9-l@smile.fi.intel.com> (raw)
In-Reply-To: <1ca7b324-9de2-41b8-8c5a-a823c861c692@intel.com>
On Thu, Mar 20, 2025 at 08:22:39AM -0700, Dave Jiang wrote:
> On 3/20/25 1:18 AM, Yi Sun wrote:
> > The __packed attribute introduces potential unaligned memory accesses
> > and endianness portability issues. Instead of relying on compiler-specific
> > packing, it's much better to explicitly fill structure gaps using padding
> > fields, ensuring natural alignment.
> >
> > Since all previously __packed structures already enforce proper alignment
> > through manual padding, the __packed qualifiers are unnecessary and can be
> > safely removed.
>
> Although endian portability is probably not a concern given this driver is
> only for an Intel platform device.
The concern is that somebody, while writing a code for a non-Intel platform,
might take it as an example and do suboptimal or wrong things.
> Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Thanks!
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2025-03-20 15:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-20 8:18 [PATCH] dma/idxd: Remove __packed from structures Yi Sun
2025-03-20 10:51 ` Andy Shevchenko
2025-03-20 15:22 ` Dave Jiang
2025-03-20 15:45 ` Andy Shevchenko [this message]
2025-04-02 20:47 ` Fenghua Yu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Z9w3_2NkSJCvV9-l@smile.fi.intel.com \
--to=andriy.shevchenko@intel.com \
--cc=anil.s.keshavamurthy@intel.com \
--cc=dave.jiang@intel.com \
--cc=dmaengine@vger.kernel.org \
--cc=gordon.jin@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=vkoul@kernel.org \
--cc=yi.sun@intel.com \
--cc=yi.sun@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox