From: Nathan Chancellor <natechancellor@gmail.com>
To: Nick Desaulniers <ndesaulniers@google.com>
Cc: prabhakar.csengg@gmail.com,
Mauro Carvalho Chehab <mchehab@kernel.org>,
linux-media@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] media: davinci: Fix implicit enum conversion warning
Date: Wed, 19 Sep 2018 12:03:45 -0700 [thread overview]
Message-ID: <20180919190345.GA31549@flashbox> (raw)
In-Reply-To: <CAKwvOd=FY9_F=yDOPaesM1VmYW0jTaAAYcMTmG6TFwa=ACu62w@mail.gmail.com>
On Mon, Sep 17, 2018 at 10:39:05AM -0700, Nick Desaulniers wrote:
> On Fri, Sep 14, 2018 at 11:16 PM Nathan Chancellor
> <natechancellor@gmail.com> wrote:
> >
> > Clang warns when one enumerated type is implicitly converted to another.
> >
> > drivers/media/platform/davinci/vpbe_display.c:524:24: warning: implicit
> > conversion from enumeration type 'enum osd_v_exp_ratio' to different
> > enumeration type 'enum osd_h_exp_ratio' [-Wenum-conversion]
> > layer_info->h_exp = V_EXP_6_OVER_5;
> > ~ ^~~~~~~~~~~~~~
> > 1 warning generated.
> >
> > This appears to be a copy and paste error judging from the couple of
> > lines directly above this statement and the way that height is handled
> > in the if block above this one.
>
>
> The above code for reference looks like:
> 492 if (h_exp)
> 493 layer_info->h_exp = H_EXP_9_OVER_8;
>
> so it makes sense to me that:
> if (h_exp) layer_info->h_exp = H_EXP_...;
> then
> if (v_exp) layer_info->v_exp = V_EXP_...;
>
> Thanks for this patch Nathan, looks like an actual bug has been fixed.
> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
>
> We should send this to stable if/when it lands. Maybe the maintainers
> could apply it with:
> Cc: stable@vger.kernel.org
>
Yes, I think this qualifies as stable material. Should I need to send a
v2, I will add it; otherwise, it can be added by the maintainers at
their discretion.
Thanks for the review!
Nathan
>
> >
> > Reported-by: Nick Desaulniers <ndesaulniers@google.com>
> > Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
> > ---
> > drivers/media/platform/davinci/vpbe_display.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/media/platform/davinci/vpbe_display.c b/drivers/media/platform/davinci/vpbe_display.c
> > index d6bf96ad474c..5c235898af7b 100644
> > --- a/drivers/media/platform/davinci/vpbe_display.c
> > +++ b/drivers/media/platform/davinci/vpbe_display.c
> > @@ -521,7 +521,7 @@ vpbe_disp_calculate_scale_factor(struct vpbe_display *disp_dev,
> > else if (v_scale == 4)
> > layer_info->v_zoom = ZOOM_X4;
> > if (v_exp)
> > - layer_info->h_exp = V_EXP_6_OVER_5;
> > + layer_info->v_exp = V_EXP_6_OVER_5;
> > } else {
> > /* no scaling, only cropping. Set display area to crop area */
> > cfg->ysize = expected_ysize;
> > --
> > 2.18.0
> >
>
>
> --
> Thanks,
> ~Nick Desaulniers
prev parent reply other threads:[~2018-09-19 19:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-15 6:16 [PATCH] media: davinci: Fix implicit enum conversion warning Nathan Chancellor
2018-09-17 17:39 ` Nick Desaulniers
2018-09-19 19:03 ` Nathan Chancellor [this message]
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=20180919190345.GA31549@flashbox \
--to=natechancellor@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=ndesaulniers@google.com \
--cc=prabhakar.csengg@gmail.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;
as well as URLs for NNTP newsgroup(s).