Re: [Fwd: [PATCH] [TIPC]: Enhancements to msg_set_bits() routine]

2007-04-27 Thread Ingo Oeser
Hi Jon,

Jon Paul Maloy schrieb:
 Ingo Oeser wrote:
  static inlinevoid msg_set_bits(struct tipc_msg *m, u32 w,
  u32 pos, __be32 mask, __be32 val)
 
 
  Care to resubmit?

 I don't mind at all, but I would first like to understand better
 what this means. 
 If I understand it correctly __be32 literally means big-endian
 32-bit integer, but the way it is used doesn't seem to imply this,
 since both input and output to htonl() often is of that type.

Yes, you are right! I mixed up htonl and ntohl :-)
Sorry for the confusion!

Best Regards

Ingo Oeser
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [Fwd: [PATCH] [TIPC]: Enhancements to msg_set_bits() routine]

2007-04-25 Thread Ingo Oeser
Hi Jon,

Jon Paul Maloy schrieb:
 2) The code has been optimized to minimize the number of run-time
endianness conversion operations by leveraging the fact that the
mask (and, in some cases, the value as well) is constant and the
necessary conversion can be performed by the compiler.

3) It can be checked by sparse, if you use proper types.
 
 diff --git a/net/tipc/msg.h b/net/tipc/msg.h
 index 62d5490..5c64e55 100644
 --- a/net/tipc/msg.h
 +++ b/net/tipc/msg.h
 @@ -71,8 +71,11 @@ static inline void msg_set_word(struct tipc_msg *m, u32
 w, u32 val) static inline void msg_set_bits(struct tipc_msg *m, u32 w,
   u32 pos, u32 mask, u32 val)

static inlinevoid msg_set_bits(struct tipc_msg *m, u32 w,
u32 pos, __be32 mask, __be32 val)


Care to resubmit?


Best Regards

Ingo Oeser
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html