Message ID | 20180412193333.4951-1-malat@debian.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Thu, Apr 12, 2018 at 09:33:33PM +0200, Mathieu Malaterre wrote: > In function ‘radeon_process_i2c_ch’ a comparison of a u8 value against > 255 is done. Since it is always false, change the signature of this > function to use an `int` instead, which match the type used in caller: > `radeon_atom_hw_i2c_xfer`. > > Fix the following warning triggered with W=1: > > CC [M] drivers/gpu/drm/radeon/atombios_i2c.o > drivers/gpu/drm/radeon/atombios_i2c.c: In function ‘radeon_process_i2c_ch’: > drivers/gpu/drm/radeon/atombios_i2c.c:71:11: warning: comparison is always false due to limited range of data type [-Wtype-limits] > if (num > ATOM_MAX_HW_I2C_READ) { > ^ > > Signed-off-by: Mathieu Malaterre <malat@debian.org> Reviewed-by: Huang Rui <ray.huang@amd.com> > --- > drivers/gpu/drm/radeon/atombios_i2c.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/radeon/atombios_i2c.c b/drivers/gpu/drm/radeon/atombios_i2c.c > index 4157780585a0..9022e9af11a0 100644 > --- a/drivers/gpu/drm/radeon/atombios_i2c.c > +++ b/drivers/gpu/drm/radeon/atombios_i2c.c > @@ -35,7 +35,7 @@ > > static int radeon_process_i2c_ch(struct radeon_i2c_chan *chan, > u8 slave_addr, u8 flags, > - u8 *buf, u8 num) > + u8 *buf, int num) > { > struct drm_device *dev = chan->dev; > struct radeon_device *rdev = dev->dev_private; > -- > 2.11.0 > > _______________________________________________ > amd-gfx mailing list > amd-gfx@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/amd-gfx
On Fri, Apr 13, 2018 at 9:59 AM Huang Rui <ray.huang@amd.com> wrote: > On Thu, Apr 12, 2018 at 09:33:33PM +0200, Mathieu Malaterre wrote: > > In function ‘radeon_process_i2c_ch’ a comparison of a u8 value against > > 255 is done. Since it is always false, change the signature of this > > function to use an `int` instead, which match the type used in caller: > > `radeon_atom_hw_i2c_xfer`. > > > > Fix the following warning triggered with W=1: > > > > CC [M] drivers/gpu/drm/radeon/atombios_i2c.o > > drivers/gpu/drm/radeon/atombios_i2c.c: In function > ‘radeon_process_i2c_ch’: > > drivers/gpu/drm/radeon/atombios_i2c.c:71:11: warning: comparison is > always false due to limited range of data type [-Wtype-limits] > > if (num > ATOM_MAX_HW_I2C_READ) { > > ^ > > > > Signed-off-by: Mathieu Malaterre <malat@debian.org> > > Reviewed-by: Huang Rui <ray.huang@amd.com> > > Any chance to be included in the next pull request ? thanks > > --- > > drivers/gpu/drm/radeon/atombios_i2c.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/gpu/drm/radeon/atombios_i2c.c > b/drivers/gpu/drm/radeon/atombios_i2c.c > > index 4157780585a0..9022e9af11a0 100644 > > --- a/drivers/gpu/drm/radeon/atombios_i2c.c > > +++ b/drivers/gpu/drm/radeon/atombios_i2c.c > > @@ -35,7 +35,7 @@ > > > > static int radeon_process_i2c_ch(struct radeon_i2c_chan *chan, > > u8 slave_addr, u8 flags, > > - u8 *buf, u8 num) > > + u8 *buf, int num) > > { > > struct drm_device *dev = chan->dev; > > struct radeon_device *rdev = dev->dev_private; > > -- > > 2.11.0 > > > > _______________________________________________ > > amd-gfx mailing list > > amd-gfx@lists.freedesktop.org > > https://lists.freedesktop.org/mailman/listinfo/amd-gfx > <div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Fri, Apr 13, 2018 at 9:59 AM Huang Rui <<a href="mailto:ray.huang@amd.com">ray.huang@amd.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Thu, Apr 12, 2018 at 09:33:33PM +0200, Mathieu Malaterre wrote:<br> > In function ‘radeon_process_i2c_ch’ a comparison of a u8 value against<br> > 255 is done. Since it is always false, change the signature of this<br> > function to use an `int` instead, which match the type used in caller:<br> > `radeon_atom_hw_i2c_xfer`.<br> > <br> > Fix the following warning triggered with W=1:<br> > <br> > CC [M] drivers/gpu/drm/radeon/atombios_i2c.o<br> > drivers/gpu/drm/radeon/atombios_i2c.c: In function ‘radeon_process_i2c_ch’:<br> > drivers/gpu/drm/radeon/atombios_i2c.c:71:11: warning: comparison is always false due to limited range of data type [-Wtype-limits]<br> > if (num > ATOM_MAX_HW_I2C_READ) {<br> > ^<br> > <br> > Signed-off-by: Mathieu Malaterre <<a href="mailto:malat@debian.org" target="_blank">malat@debian.org</a>><br> <br> Reviewed-by: Huang Rui <<a href="mailto:ray.huang@amd.com" target="_blank">ray.huang@amd.com</a>><br> <br></blockquote><div><br></div><div>Any chance to be included in the next pull request ? thanks</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> > ---<br> > drivers/gpu/drm/radeon/atombios_i2c.c | 2 +-<br> > 1 file changed, 1 insertion(+), 1 deletion(-)<br> > <br> > diff --git a/drivers/gpu/drm/radeon/atombios_i2c.c b/drivers/gpu/drm/radeon/atombios_i2c.c<br> > index 4157780585a0..9022e9af11a0 100644<br> > --- a/drivers/gpu/drm/radeon/atombios_i2c.c<br> > +++ b/drivers/gpu/drm/radeon/atombios_i2c.c<br> > @@ -35,7 +35,7 @@<br> > <br> > static int radeon_process_i2c_ch(struct radeon_i2c_chan *chan,<br> > u8 slave_addr, u8 flags,<br> > - u8 *buf, u8 num)<br> > + u8 *buf, int num)<br> > {<br> > struct drm_device *dev = chan->dev;<br> > struct radeon_device *rdev = dev->dev_private;<br> > -- <br> > 2.11.0<br> > <br> > _______________________________________________<br> > amd-gfx mailing list<br> > <a href="mailto:amd-gfx@lists.freedesktop.org" target="_blank">amd-gfx@lists.freedesktop.org</a><br> > <a href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a><br> </blockquote></div></div>
On Mon, Sep 17, 2018 at 4:29 PM Mathieu Malaterre <malat@debian.org> wrote: > > > > On Fri, Apr 13, 2018 at 9:59 AM Huang Rui <ray.huang@amd.com> wrote: >> >> On Thu, Apr 12, 2018 at 09:33:33PM +0200, Mathieu Malaterre wrote: >> > In function ‘radeon_process_i2c_ch’ a comparison of a u8 value against >> > 255 is done. Since it is always false, change the signature of this >> > function to use an `int` instead, which match the type used in caller: >> > `radeon_atom_hw_i2c_xfer`. >> > >> > Fix the following warning triggered with W=1: >> > >> > CC [M] drivers/gpu/drm/radeon/atombios_i2c.o >> > drivers/gpu/drm/radeon/atombios_i2c.c: In function ‘radeon_process_i2c_ch’: >> > drivers/gpu/drm/radeon/atombios_i2c.c:71:11: warning: comparison is always false due to limited range of data type [-Wtype-limits] >> > if (num > ATOM_MAX_HW_I2C_READ) { >> > ^ >> > >> > Signed-off-by: Mathieu Malaterre <malat@debian.org> >> >> Reviewed-by: Huang Rui <ray.huang@amd.com> >> > > Any chance to be included in the next pull request ? thanks Applied. thanks for the reminder. Alex > >> >> > --- >> > drivers/gpu/drm/radeon/atombios_i2c.c | 2 +- >> > 1 file changed, 1 insertion(+), 1 deletion(-) >> > >> > diff --git a/drivers/gpu/drm/radeon/atombios_i2c.c b/drivers/gpu/drm/radeon/atombios_i2c.c >> > index 4157780585a0..9022e9af11a0 100644 >> > --- a/drivers/gpu/drm/radeon/atombios_i2c.c >> > +++ b/drivers/gpu/drm/radeon/atombios_i2c.c >> > @@ -35,7 +35,7 @@ >> > >> > static int radeon_process_i2c_ch(struct radeon_i2c_chan *chan, >> > u8 slave_addr, u8 flags, >> > - u8 *buf, u8 num) >> > + u8 *buf, int num) >> > { >> > struct drm_device *dev = chan->dev; >> > struct radeon_device *rdev = dev->dev_private; >> > -- >> > 2.11.0 >> > >> > _______________________________________________ >> > amd-gfx mailing list >> > amd-gfx@lists.freedesktop.org >> > https://lists.freedesktop.org/mailman/listinfo/amd-gfx > > _______________________________________________ > amd-gfx mailing list > amd-gfx@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/amd-gfx
diff --git a/drivers/gpu/drm/radeon/atombios_i2c.c b/drivers/gpu/drm/radeon/atombios_i2c.c index 4157780585a0..9022e9af11a0 100644 --- a/drivers/gpu/drm/radeon/atombios_i2c.c +++ b/drivers/gpu/drm/radeon/atombios_i2c.c @@ -35,7 +35,7 @@ static int radeon_process_i2c_ch(struct radeon_i2c_chan *chan, u8 slave_addr, u8 flags, - u8 *buf, u8 num) + u8 *buf, int num) { struct drm_device *dev = chan->dev; struct radeon_device *rdev = dev->dev_private;
In function ‘radeon_process_i2c_ch’ a comparison of a u8 value against 255 is done. Since it is always false, change the signature of this function to use an `int` instead, which match the type used in caller: `radeon_atom_hw_i2c_xfer`. Fix the following warning triggered with W=1: CC [M] drivers/gpu/drm/radeon/atombios_i2c.o drivers/gpu/drm/radeon/atombios_i2c.c: In function ‘radeon_process_i2c_ch’: drivers/gpu/drm/radeon/atombios_i2c.c:71:11: warning: comparison is always false due to limited range of data type [-Wtype-limits] if (num > ATOM_MAX_HW_I2C_READ) { ^ Signed-off-by: Mathieu Malaterre <malat@debian.org> --- drivers/gpu/drm/radeon/atombios_i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)