1. 19 Jun, 2005 2 commits
    • Jesper Juhl's avatar
      [IPV4]: [3/4] signed vs unsigned cleanup in net/ipv4/raw.c · 93765d8a
      Jesper Juhl authored
      
      
      This patch changes the type of the local variable 'i' in 
      raw_probe_proto_opt() from 'int' to 'unsigned int'. The only use of 'i' in 
      this function is as a counter in a for() loop and subsequent index into 
      the msg->msg_iov[] array.
      Since 'i' is compared in a loop to the unsigned variable msg->msg_iovlen 
      gcc -W generates this warning : 
      
      net/ipv4/raw.c:340: warning: comparison between signed and unsigned
      
      Changing 'i' to unsigned silences this warning and is safe since the array 
      index can never be negative anyway, so unsigned int is the logical type to 
      use for 'i' and also enables a larger msg_iov[] array (but I don't know if 
      that will ever matter).
      
      Signed-off-by: default avatarJesper Juhl <juhl-lkml@dif.dk>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      93765d8a
    • Jesper Juhl's avatar
      [IPV4]: [2/4] signed vs unsigned cleanup in net/ipv4/raw.c · 926d4b81
      Jesper Juhl authored
      
      
      This patch gets rid of the following gcc -W warning in net/ipv4/raw.c :
      
      net/ipv4/raw.c:387: warning: comparison of unsigned expression < 0 is always false
      
      Since 'len' is of type size_t it is unsigned and can thus never be <0, and 
      since this is obvious from the function declaration just a few lines above 
      I think it's ok to remove the pointless check for len<0.
      
      
      Signed-off-by: default avatarJesper Juhl <juhl-lkml@dif.dk>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      926d4b81
  2. 18 Jun, 2005 38 commits