Re: [PATCH v2] net: bluetooth: hci_sock: Use 'const void *' instead of 'void *' for 2nd parameter of hci_test_bit()

2015-02-05 Thread Chen Gang S
On 2/5/15 18:14, David Laight wrote: > From: Chen Gang S [mailto:gang.c...@sunrus.com.cn] >> On 2/5/15 05:09, Marcel Holtmann wrote: >>> Hi Sergei, >>> >> -static inline int hci_test_bit(int nr, void *addr) >> +static inline int hci_test_bit(int nr, const void *addr) >> { >>

RE: [PATCH v2] net: bluetooth: hci_sock: Use 'const void *' instead of 'void *' for 2nd parameter of hci_test_bit()

2015-02-05 Thread David Laight
From: Chen Gang S [mailto:gang.c...@sunrus.com.cn] > On 2/5/15 05:09, Marcel Holtmann wrote: > > Hi Sergei, > > > -static inline int hci_test_bit(int nr, void *addr) > +static inline int hci_test_bit(int nr, const void *addr) > { > return *((__u32 *) addr + (nr >> 5))

Re: [PATCH v2] net: bluetooth: hci_sock: Use 'const void *' instead of 'void *' for 2nd parameter of hci_test_bit()

2015-02-04 Thread Chen Gang S
On 2/5/15 05:09, Marcel Holtmann wrote: > Hi Sergei, > -static inline int hci_test_bit(int nr, void *addr) +static inline int hci_test_bit(int nr, const void *addr) { return *((__u32 *) addr + (nr >> 5)) & ((__u32) 1 << (nr & 31)); } >> >>> Is there a 'standard' funct

Re: [PATCH v2] net: bluetooth: hci_sock: Use 'const void *' instead of 'void *' for 2nd parameter of hci_test_bit()

2015-02-04 Thread Marcel Holtmann
Hi Sergei, >>> -static inline int hci_test_bit(int nr, void *addr) >>> +static inline int hci_test_bit(int nr, const void *addr) >>> { >>> return *((__u32 *) addr + (nr >> 5)) & ((__u32) 1 << (nr & 31)); >>> } > >> Is there a 'standard' function lurking that will do the above. >> On x86 the

Re: [PATCH v2] net: bluetooth: hci_sock: Use 'const void *' instead of 'void *' for 2nd parameter of hci_test_bit()

2015-02-04 Thread Sergei Shtylyov
Hello. On 02/04/2015 02:59 PM, David Laight wrote: -static inline int hci_test_bit(int nr, void *addr) +static inline int hci_test_bit(int nr, const void *addr) { return *((__u32 *) addr + (nr >> 5)) & ((__u32) 1 << (nr & 31)); } Is there a 'standard' function lurking that will d

RE: [PATCH v2] net: bluetooth: hci_sock: Use 'const void *' instead of 'void *' for 2nd parameter of hci_test_bit()

2015-02-04 Thread David Laight
From: Gang S > On 2/3/15 10:32, Chen Gang S wrote: > > On 2/3/15 05:20, Joe Perches wrote: > >> On Tue, 2015-02-03 at 05:14 +0800, Chen Gang S wrote: > >>> hci_test_bit() does not modify 2nd parameter, so it is better to let it > >>> be constant, or may cause build warning. The related warning (wit

RE: [PATCH v2] net: bluetooth: hci_sock: Use 'const void *' instead of 'void *' for 2nd parameter of hci_test_bit()

2015-02-04 Thread David Laight
From: Chen Gang S > -static inline int hci_test_bit(int nr, void *addr) > +static inline int hci_test_bit(int nr, const void *addr) > { > return *((__u32 *) addr + (nr >> 5)) & ((__u32) 1 << (nr & 31)); > } Is there a 'standard' function lurking that will do the above. On x86 the cpus 'bit

Re: [PATCH v2] net: bluetooth: hci_sock: Use 'const void *' instead of 'void *' for 2nd parameter of hci_test_bit()

2015-02-02 Thread Chen Gang S
On 2/3/15 10:32, Chen Gang S wrote: > On 2/3/15 05:20, Joe Perches wrote: >> On Tue, 2015-02-03 at 05:14 +0800, Chen Gang S wrote: >>> hci_test_bit() does not modify 2nd parameter, so it is better to let it >>> be constant, or may cause build warning. The related warning (with >>> allmodconfig und

Re: [PATCH v2] net: bluetooth: hci_sock: Use 'const void *' instead of 'void *' for 2nd parameter of hci_test_bit()

2015-02-02 Thread Chen Gang S
On 2/3/15 05:20, Joe Perches wrote: > On Tue, 2015-02-03 at 05:14 +0800, Chen Gang S wrote: >> hci_test_bit() does not modify 2nd parameter, so it is better to let it >> be constant, or may cause build warning. The related warning (with >> allmodconfig under xtensa): > [] >> diff --git a/net/blueto

Re: [PATCH v2] net: bluetooth: hci_sock: Use 'const void *' instead of 'void *' for 2nd parameter of hci_test_bit()

2015-02-02 Thread Joe Perches
On Tue, 2015-02-03 at 05:14 +0800, Chen Gang S wrote: > hci_test_bit() does not modify 2nd parameter, so it is better to let it > be constant, or may cause build warning. The related warning (with > allmodconfig under xtensa): [] > diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c []

[PATCH v2] net: bluetooth: hci_sock: Use 'const void *' instead of 'void *' for 2nd parameter of hci_test_bit()

2015-02-02 Thread Chen Gang S
hci_test_bit() does not modify 2nd parameter, so it is better to let it be constant, or may cause build warning. The related warning (with allmodconfig under xtensa): net/bluetooth/hci_sock.c: In function 'hci_sock_sendmsg': net/bluetooth/hci_sock.c:955:8: warning: passing argument 2 of 'hci_t