[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YPF3m01nYlt3On7V@smile.fi.intel.com>
Date: Fri, 16 Jul 2021 15:12:11 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Sakari Ailus <sakari.ailus@...ux.intel.com>
Cc: kernel test robot <lkp@...el.com>,
Nick Desaulniers <nick.desaulniers@...il.com>,
clang-built-linux <clang-built-linux@...glegroups.com>,
kbuild-all@...ts.01.org,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Thomas Zimmermann <tzimmermann@...e.de>,
Petr Mladek <pmladek@...e.com>
Subject: Re: drivers/media/v4l2-core/v4l2-ioctl.c:303:28: warning: taking
address of packed member 'pixelformat' of class or structure
'v4l2_pix_format_mplane' may result in an unaligned pointer value
On Fri, Jul 16, 2021 at 02:41:05PM +0300, Sakari Ailus wrote:
> On Wed, Jul 14, 2021 at 10:45:26PM +0300, Andy Shevchenko wrote:
> > > >> drivers/media/v4l2-core/v4l2-ioctl.c:347:37: warning: taking address of packed member 'pixelformat' of class or structure 'v4l2_sdr_format' may result in an unaligned pointer value [-Waddress-of-packed-member]
> >
> > Why is it packed in the first place? Is it used on unaligned addresses
> > in other structures? But even so, why should it matter?
>
> It's packed since we wanted to avoid having holes in the structs. There are
> other ways to do that but it's ABI dependent and is prone to human errors,
> too.
What holes can you think about in the above mention structure?
In case if you are going to extend it you will need anyway changes somewhere
else as well.
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists