Skip to contentSkip to conversation

Clean up of i2c-elektor.c build for 2.6.11

DISCUSSION Applied Frank Beesley 3 participants 6 messages May 19, 2005

lore
Share & tools
lore
#0 lore raw

Greg,

I am trying to fix some problems I am having with my 2.6.9 and trying some stuff with 2.6.11. I see a lot of differences with the I2C and almost everything I have tested works. (applause). One of the messages I noticed during the kernel module build of 2.6.11 was i2c-elektor.c complaining:

drivers/i2c/busses/i2c-elektor.c:120: warning: comparison of distinct pointer types lacks a cast drivers/i2c/busses/i2c-elektor.c:127: warning: comparison of distinct pointer types lacks a cast drivers/i2c/busses/i2c-elektor.c:131: warning: comparison of distinct pointer types lacks a cast

I traced it down to the flags type on line 115. Now it builds cleanly. I have tested this and it appears to have no impact on my stuff. This should a low priority patch item but makes it easier to spot real bugs when the build occurs without these messages.

Thanks
Frank

--- diff ---
i2c-elektor.c
115c115
< long flags;
---

Quoted 1 line
      unsigned long flags;
#1 lore raw
Quoted 35 lines · Jean Delvare

Hi Frank,

Quoted 7 lines

drivers/i2c/busses/i2c-elektor.c:120: warning: comparison of distinct pointer types lacks a cast drivers/i2c/busses/i2c-elektor.c:127: warning: comparison of distinct pointer types lacks a cast drivers/i2c/busses/i2c-elektor.c:131: warning: comparison of distinct pointer types lacks a cast

Quoted 12 lines

I traced it down to the flags type on line 115.
(...)
--- diff ---
i2c-elektor.c
115c115
< long flags;
---

Quoted 3 lines
     unsigned long flags;

Hey, that's great. I have been wanting to get rid of these warnings for quite some time, and even took a look at some point, but couldn't figure out what was wrong. Turns out to be very simple to fix, so I'm kind of ashamed that I didn't find the reason and fix back then ;)

When submitting patches, please make them "unified" (diff -u). Also, please include complete paths so that patches can be applied with patch -p1. The command would be something like:

 diff -u linux-2.6.11/drivers/i2c/busses/i2c-elektor.c.orig \
         linux-2.6.11/drivers/i2c/busses/i2c-elektor.c > ~/some-file.diff
Quoted 10 lines

Please post the patch again in this format, with a short description of what the patch does and the standard "Signed-Off-By" line, so that Greg can accept it in its bk-i2c tree.

Thanks,
--
Jean Delvare

Greg,

Please find attached the diff for i2c-elektor.c discussed above.

Thanks
Frank

This patch changes the flags variable type from long to unsigned long in one function. This removes a couple of warnings from the compile messages for elektor i2c bus driver.

Signed-Off-By Frank Beesley

-------------- next part --------------
A non-text attachment was scrubbed...
Name: elek.diff
Type: text/x-patch
Size: 493 bytes
Desc: not available
Url : http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20050310/9c37f3d0/elek.bin

#2 lore raw
In reply to Frank Beesley

Hi Frank,

Quoted 7 lines

drivers/i2c/busses/i2c-elektor.c:120: warning: comparison of distinct pointer types lacks a cast drivers/i2c/busses/i2c-elektor.c:127: warning: comparison of distinct pointer types lacks a cast drivers/i2c/busses/i2c-elektor.c:131: warning: comparison of distinct pointer types lacks a cast

Quoted 8 lines

I traced it down to the flags type on line 115.
(...)
--- diff ---
i2c-elektor.c
115c115
< long flags;
---

Quoted 1 line
      unsigned long flags;

Hey, that's great. I have been wanting to get rid of these warnings for quite some time, and even took a look at some point, but couldn't figure out what was wrong. Turns out to be very simple to fix, so I'm kind of ashamed that I didn't find the reason and fix back then ;)

When submitting patches, please make them "unified" (diff -u). Also, please include complete paths so that patches can be applied with patch -p1. The command would be something like:

  diff -u linux-2.6.11/drivers/i2c/busses/i2c-elektor.c.orig \
          linux-2.6.11/drivers/i2c/busses/i2c-elektor.c > ~/some-file.diff

Please post the patch again in this format, with a short description of what the patch does and the standard "Signed-Off-By" line, so that Greg can accept it in its bk-i2c tree.

Thanks,
--
Jean Delvare

#3 lore raw
In reply to Frank Beesley

Hi Frank,

Quoted 5 lines

This patch changes the flags variable type from long to unsigned long in one function. This removes a couple of warnings from the compile messages for elektor i2c bus driver.

Signed-Off-By Frank Beesley

Should be "Signed-off-by: Frank Beesley <some email address>".

Also, care to resend your patch *without* embedded ANSI colorization? I wonder how you did that. It's nice and all, but such a patch cannot be applied by "patch" so it's not exactly useful to us.

Thanks,

Signature · 1 line
Jean Delvare
Applied
#4 lore raw
In reply to Frank Beesley
Quoted 9 lines · Frank Beesley

I will try this again. I did a "diff -v" and see that our workstations have colordiff 1.0.4 on top of diff (GNU diffutils) 2.8.7. This would explain the wonderful colors. I went back to our target machines that have just he diffutils, not colordiff.

This patch changes the flags variable type from long to unsigned long in one function. This removes a couple of warnings from the compile messages for elektor i2c bus driver.

Applied, thanks.

greg k-h

#5 lore raw
In reply to Frank Beesley

I will try this again. I did a "diff -v" and see that our workstations have colordiff 1.0.4 on top of diff (GNU diffutils) 2.8.7. This would explain the wonderful colors. I went back to our target machines that have just he diffutils, not colordiff.

This patch changes the flags variable type from long to unsigned long in one function. This removes a couple of warnings from the compile messages for elektor i2c bus driver.

Signed-Off-By Frank Beesley <[email protected]>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: elektor.diff
Type: text/x-patch
Size: 350 bytes
Desc: not available
Url : http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20050311/5bc2daf4/elektor.bin