Re: [RESEND PATCH v4 1/2] dt-bindings: at24: Add address-width property
On Tue, Jul 17, 2018 at 10:01:17AM +0200, Bartosz Golaszewski wrote: > I will soon be sending my pull request to Wolfram, so if you still > want that applied for 4.19 - please resend with the commit message > fixed. Alan? Not sure whether it's too late for 4.19 now though. -- Sakari Ailus [email protected]
Re: drivers/staging/media/ipu3/ipu3-css.c:1831: bad compare ?
Hi David,
On Mon, Jan 07, 2019 at 10:30:55PM +, David Binderman wrote:
> Hello there,
>
> drivers/staging/media/ipu3/ipu3-css.c:1831:30: warning: comparison of
> unsigned expression < 0 is always false [-Wtype-limits]
>
> Source code is
> css->pipes[pipe].bindex =
> ipu3_css_find_binary(css, pipe, q, r);
> if (css->pipes[pipe].bindex < 0) {
> dev_err(css->dev, "failed to find suitable binary\n");
> return -EINVAL;
> }
>
> Suggest sanity check return value from function first, then if it is ok,
> assign it to an unsigned variable.
Thanks for reporting this. There have been a few patches to address it so
far, the one going in is here:
https://patchwork.linuxtv.org/patch/53633/>
--
Sakari Ailus
[email protected]
Re: [PATCH 2/6] staging: media: intel-ipu3: preferred __aligned(size) over __attribute__aligned(size)
Hi David,
On Tue, Apr 13, 2021 at 07:40:12AM +, David Laight wrote:
> From: Mitali Borkar
> > Sent: 12 April 2021 00:09
> >
> > This patch fixes the warning identified by checkpatch.pl by replacing
> > __attribute__aligned(size) with __aligned(size)
> >
> > Signed-off-by: Mitali Borkar
> > ---
> > .../staging/media/ipu3/include/intel-ipu3.h | 74 +--
> > 1 file changed, 37 insertions(+), 37 deletions(-)
> >
> > diff --git a/drivers/staging/media/ipu3/include/intel-ipu3.h
> > b/drivers/staging/media/ipu3/include/intel-ipu3.h
> > index 589d5ccee3a7..d95ca9ebfafb 100644
> > --- a/drivers/staging/media/ipu3/include/intel-ipu3.h
> > +++ b/drivers/staging/media/ipu3/include/intel-ipu3.h
> > @@ -84,7 +84,7 @@ struct ipu3_uapi_grid_config {
> > */
> > struct ipu3_uapi_awb_raw_buffer {
> > __u8 meta_data[IPU3_UAPI_AWB_MAX_BUFFER_SIZE]
> > - __attribute__((aligned(32)));
> > + __aligned(32);
> > } __packed;
>
> WTF?
>
> It either has 1-byte alignment because it is just __u8,
> 32-byte because of the aligned(32),
> or 1 byte because of the outer packed.
>
> What alignment does this (and all the other) structures
> actually need?
32 as noted above. Here packed makes no difference though.
Some of these structs are used embedded in other structs or alone. I
haven't checked this one.
It's also possible to have __packed and __aligned() conflict (in which case
a decent compiler would give you a warning) --- which does not happen
currently AFAIK.
>
> Specifying 'packed' isn't free.
It may be free if the packed alignment of the fields corresponds to
architecture's packing. Here __aligned() is used to satisfy
hardware alignment requirements and __packed is used to ensure the same
memory layout independently of ABI rules.
--
Regards,
Sakari Ailus

