Linux Media Controller development
 help / color / mirror / Atom feed
From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Cc: linux-media@vger.kernel.org
Subject: Re: [PATCH 1/1] ov5648: Don't pack controls struct
Date: Tue, 11 Jan 2022 13:38:34 +0200	[thread overview]
Message-ID: <Yd1sOmFjJfsFHrT2@paasikivi.fi.intel.com> (raw)
In-Reply-To: <Yd0/nL7iQityle6P@aptenodytes>

Hi Paul,

On Tue, Jan 11, 2022 at 09:28:12AM +0100, Paul Kocialkowski wrote:
> Hi Sakari,
> 
> On Tue 11 Jan 22, 00:48, Sakari Ailus wrote:
> > Don't pack the driver specific struct containing control pointers. This
> > lead to potential alignment issues when working with the pointers.
> 
> Thanks for looking into the report and making this fix.
> 
> Honestly I was a bit puzzled because I explicitly added the __packed
> to avoid possible holes in the structures that could be problematic
> when using v4l2_ctrl_auto_cluster and I think the problem still stands.
> 
> I feel like solving both issues at once would require having the controls
> that belong in the same cluster declared as an array and not individual
> members of the struct.
> 
> What do you think?

No architecture used in Linux requires adding padding between two pointers
to my knowledge --- generally the alignment is at most the size of the
data: otherwise arrays would not work either. Therefore packing isn't
required.

-- 
Kind regards,

Sakari Ailus

  reply	other threads:[~2022-01-11 11:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-10 22:48 [PATCH 1/1] ov5648: Don't pack controls struct Sakari Ailus
2022-01-11  8:28 ` Paul Kocialkowski
2022-01-11 11:38   ` Sakari Ailus [this message]
2022-01-12 11:09     ` Paul Kocialkowski
2022-01-12 11:21       ` Sakari Ailus
2022-01-13 10:17         ` Paul Kocialkowski

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=Yd1sOmFjJfsFHrT2@paasikivi.fi.intel.com \
    --to=sakari.ailus@linux.intel.com \
    --cc=linux-media@vger.kernel.org \
    --cc=paul.kocialkowski@bootlin.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