Skip to contentSkip to conversation

drm/radeon: change function signature to pass full range

PATCH Applied Mathieu Malaterre 4 participants 4 messages Apr 12, 2018 – Sep 17, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/radeon: change function signature to pass full range

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) {
           ^
---
 drivers/gpu/drm/radeon/atombios_i2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/radeon/atombios_i2c.c +1 -1
index 4157780585a0..9022e9af11a0 100644
@@ -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;
Signature · 1 line
2.11.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Mathieu Malaterre

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:

Quoted 7 lines

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) {
           ^
Quoted 24 lines
---
 drivers/gpu/drm/radeon/atombios_i2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/radeon/atombios_i2c.c +1 -1
index 4157780585a0..9022e9af11a0 100644
@@ -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;
Signature · 6 lines
2.11.0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#2 lore raw
Quoted 11 lines · Huang Rui
Quoted 9 lines · Mathieu Malaterre

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’:

Quoted 10 lines
Quoted 1 line

drivers/gpu/drm/radeon/atombios_i2c.c:71:11: warning: comparison is

always false due to limited range of data type [-Wtype-limits]

Quoted 4 lines
   if (num > ATOM_MAX_HW_I2C_READ) {
           ^

Any chance to be included in the next pull request ? thanks

Quoted 21 lines

Review

Quoted 5 lines
---
 drivers/gpu/drm/radeon/atombios_i2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
(quoted diff) +0 -0

b/drivers/gpu/drm/radeon/atombios_i2c.c

Quoted 15 lines

index 4157780585a0..9022e9af11a0 100644

drivers/gpu/drm/radeon/atombios_i2c.c +1 -2
@@ -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

Quoted 5 lines
Quoted 4 lines

_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Applied
#3 lore raw
Quoted 19 lines · Mathieu Malaterre
Quoted 15 lines · Huang Rui
Quoted 13 lines · Mathieu Malaterre

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) {
           ^
Quoted 6 lines
Quoted 4 lines
Quoted 1 line

Any chance to be included in the next pull request ? thanks

Applied. thanks for the reminder.

Alex

Quoted 22 lines
Quoted 22 lines
Quoted 22 lines

---
 drivers/gpu/drm/radeon/atombios_i2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/radeon/atombios_i2c.c +1 -2
index 4157780585a0..9022e9af11a0 100644
@@ -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

Quoted 9 lines
Quoted 4 lines
Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx