* Re: [PATCH] batman-adv: remove unnecessary type castings
[not found] <20220421154829.9775-1-yuzhe@nfschina.com>
@ 2022-04-22 2:20 ` kernel test robot
2022-04-22 2:41 ` kernel test robot
` (4 subsequent siblings)
5 siblings, 0 replies; 10+ messages in thread
From: kernel test robot @ 2022-04-22 2:20 UTC (permalink / raw)
To: Yu Zhe, mareklindner, sw, a, sven, davem, kuba, pabeni
Cc: kbuild-all, b.a.t.m.a.n, netdev, linux-kernel, liqiong,
kernel-janitors, Yu Zhe
Hi Yu,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on linus/master]
[also build test WARNING on v5.18-rc3 next-20220421]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/intel-lab-lkp/linux/commits/Yu-Zhe/batman-adv-remove-unnecessary-type-castings/20220421-235254
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git b253435746d9a4a701b5f09211b9c14d3370d0da
config: m68k-defconfig (https://download.01.org/0day-ci/archive/20220422/202204221027.ETcMYyKP-lkp@intel.com/config)
compiler: m68k-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/intel-lab-lkp/linux/commit/2474b41c585e849d3546e0aba8f3c862735a04ff
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Yu-Zhe/batman-adv-remove-unnecessary-type-castings/20220421-235254
git checkout 2474b41c585e849d3546e0aba8f3c862735a04ff
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross W=1 O=build_dir ARCH=m68k SHELL=/bin/bash net/batman-adv/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
net/batman-adv/bridge_loop_avoidance.c: In function 'batadv_choose_claim':
>> net/batman-adv/bridge_loop_avoidance.c:68:42: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
68 | struct batadv_bla_claim *claim = data;
| ^~~~
vim +/const +68 net/batman-adv/bridge_loop_avoidance.c
53
54 static void batadv_bla_periodic_work(struct work_struct *work);
55 static void
56 batadv_bla_send_announce(struct batadv_priv *bat_priv,
57 struct batadv_bla_backbone_gw *backbone_gw);
58
59 /**
60 * batadv_choose_claim() - choose the right bucket for a claim.
61 * @data: data to hash
62 * @size: size of the hash table
63 *
64 * Return: the hash index of the claim
65 */
66 static inline u32 batadv_choose_claim(const void *data, u32 size)
67 {
> 68 struct batadv_bla_claim *claim = data;
69 u32 hash = 0;
70
71 hash = jhash(&claim->addr, sizeof(claim->addr), hash);
72 hash = jhash(&claim->vid, sizeof(claim->vid), hash);
73
74 return hash % size;
75 }
76
--
0-DAY CI Kernel Test Service
https://01.org/lkp
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] batman-adv: remove unnecessary type castings
[not found] <20220421154829.9775-1-yuzhe@nfschina.com>
2022-04-22 2:20 ` [PATCH] batman-adv: remove unnecessary type castings kernel test robot
@ 2022-04-22 2:41 ` kernel test robot
2022-04-22 2:51 ` kernel test robot
` (3 subsequent siblings)
5 siblings, 0 replies; 10+ messages in thread
From: kernel test robot @ 2022-04-22 2:41 UTC (permalink / raw)
To: Yu Zhe, mareklindner, sw, a, sven, davem, kuba, pabeni
Cc: kbuild-all, b.a.t.m.a.n, netdev, linux-kernel, liqiong,
kernel-janitors, Yu Zhe
Hi Yu,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on linus/master]
[also build test WARNING on v5.18-rc3 next-20220421]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/intel-lab-lkp/linux/commits/Yu-Zhe/batman-adv-remove-unnecessary-type-castings/20220421-235254
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git b253435746d9a4a701b5f09211b9c14d3370d0da
config: x86_64-randconfig-a013 (https://download.01.org/0day-ci/archive/20220422/202204221051.PRtLc0f7-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.2.0-20) 11.2.0
reproduce (this is a W=1 build):
# https://github.com/intel-lab-lkp/linux/commit/2474b41c585e849d3546e0aba8f3c862735a04ff
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Yu-Zhe/batman-adv-remove-unnecessary-type-castings/20220421-235254
git checkout 2474b41c585e849d3546e0aba8f3c862735a04ff
# save the config file
mkdir build_dir && cp config build_dir/.config
make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash net/batman-adv/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
net/batman-adv/bridge_loop_avoidance.c: In function 'batadv_choose_claim':
>> net/batman-adv/bridge_loop_avoidance.c:68:42: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
68 | struct batadv_bla_claim *claim = data;
| ^~~~
--
net/batman-adv/translation-table.c: In function 'batadv_choose_tt':
>> net/batman-adv/translation-table.c:109:12: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
109 | tt = data;
| ^
vim +/const +68 net/batman-adv/bridge_loop_avoidance.c
53
54 static void batadv_bla_periodic_work(struct work_struct *work);
55 static void
56 batadv_bla_send_announce(struct batadv_priv *bat_priv,
57 struct batadv_bla_backbone_gw *backbone_gw);
58
59 /**
60 * batadv_choose_claim() - choose the right bucket for a claim.
61 * @data: data to hash
62 * @size: size of the hash table
63 *
64 * Return: the hash index of the claim
65 */
66 static inline u32 batadv_choose_claim(const void *data, u32 size)
67 {
> 68 struct batadv_bla_claim *claim = data;
69 u32 hash = 0;
70
71 hash = jhash(&claim->addr, sizeof(claim->addr), hash);
72 hash = jhash(&claim->vid, sizeof(claim->vid), hash);
73
74 return hash % size;
75 }
76
--
0-DAY CI Kernel Test Service
https://01.org/lkp
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] batman-adv: remove unnecessary type castings
[not found] <20220421154829.9775-1-yuzhe@nfschina.com>
2022-04-22 2:20 ` [PATCH] batman-adv: remove unnecessary type castings kernel test robot
2022-04-22 2:41 ` kernel test robot
@ 2022-04-22 2:51 ` kernel test robot
2022-04-22 5:07 ` kernel test robot
` (2 subsequent siblings)
5 siblings, 0 replies; 10+ messages in thread
From: kernel test robot @ 2022-04-22 2:51 UTC (permalink / raw)
To: Yu Zhe, mareklindner, sw, a, sven, davem, kuba, pabeni
Cc: llvm, kbuild-all, b.a.t.m.a.n, netdev, linux-kernel, liqiong,
kernel-janitors, Yu Zhe
Hi Yu,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on linus/master]
[also build test ERROR on v5.18-rc3 next-20220421]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/intel-lab-lkp/linux/commits/Yu-Zhe/batman-adv-remove-unnecessary-type-castings/20220421-235254
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git b253435746d9a4a701b5f09211b9c14d3370d0da
config: i386-randconfig-a013 (https://download.01.org/0day-ci/archive/20220422/202204221034.hfPA4RPW-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 5bd87350a5ae429baf8f373cb226a57b62f87280)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/intel-lab-lkp/linux/commit/2474b41c585e849d3546e0aba8f3c862735a04ff
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Yu-Zhe/batman-adv-remove-unnecessary-type-castings/20220421-235254
git checkout 2474b41c585e849d3546e0aba8f3c862735a04ff
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash net/batman-adv/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
>> net/batman-adv/bridge_loop_avoidance.c:68:27: error: initializing 'struct batadv_bla_claim *' with an expression of type 'const void *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
struct batadv_bla_claim *claim = data;
^ ~~~~
1 error generated.
--
>> net/batman-adv/translation-table.c:109:5: error: assigning to 'struct batadv_tt_common_entry *' from 'const void *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
tt = data;
^ ~~~~
1 error generated.
vim +68 net/batman-adv/bridge_loop_avoidance.c
53
54 static void batadv_bla_periodic_work(struct work_struct *work);
55 static void
56 batadv_bla_send_announce(struct batadv_priv *bat_priv,
57 struct batadv_bla_backbone_gw *backbone_gw);
58
59 /**
60 * batadv_choose_claim() - choose the right bucket for a claim.
61 * @data: data to hash
62 * @size: size of the hash table
63 *
64 * Return: the hash index of the claim
65 */
66 static inline u32 batadv_choose_claim(const void *data, u32 size)
67 {
> 68 struct batadv_bla_claim *claim = data;
69 u32 hash = 0;
70
71 hash = jhash(&claim->addr, sizeof(claim->addr), hash);
72 hash = jhash(&claim->vid, sizeof(claim->vid), hash);
73
74 return hash % size;
75 }
76
--
0-DAY CI Kernel Test Service
https://01.org/lkp
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] batman-adv: remove unnecessary type castings
[not found] <20220421154829.9775-1-yuzhe@nfschina.com>
` (2 preceding siblings ...)
2022-04-22 2:51 ` kernel test robot
@ 2022-04-22 5:07 ` kernel test robot
2022-04-22 7:55 ` Sven Eckelmann
2022-04-25 11:36 ` Yu Zhe
5 siblings, 0 replies; 10+ messages in thread
From: kernel test robot @ 2022-04-22 5:07 UTC (permalink / raw)
To: Yu Zhe, mareklindner, sw, a, sven, davem, kuba, pabeni
Cc: kbuild-all, b.a.t.m.a.n, netdev, linux-kernel, liqiong,
kernel-janitors, Yu Zhe
Hi Yu,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on linus/master]
[also build test WARNING on v5.18-rc3 next-20220421]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/intel-lab-lkp/linux/commits/Yu-Zhe/batman-adv-remove-unnecessary-type-castings/20220421-235254
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git b253435746d9a4a701b5f09211b9c14d3370d0da
config: parisc-randconfig-s031-20220421 (https://download.01.org/0day-ci/archive/20220422/202204221227.5z0xsJa9-lkp@intel.com/config)
compiler: hppa-linux-gcc (GCC) 11.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.4-dirty
# https://github.com/intel-lab-lkp/linux/commit/2474b41c585e849d3546e0aba8f3c862735a04ff
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Yu-Zhe/batman-adv-remove-unnecessary-type-castings/20220421-235254
git checkout 2474b41c585e849d3546e0aba8f3c862735a04ff
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=parisc SHELL=/bin/bash net/batman-adv/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
sparse warnings: (new ones prefixed by >>)
>> net/batman-adv/bridge_loop_avoidance.c:68:42: sparse: sparse: incorrect type in initializer (different modifiers) @@ expected struct batadv_bla_claim *claim @@ got void const *data @@
net/batman-adv/bridge_loop_avoidance.c:68:42: sparse: expected struct batadv_bla_claim *claim
net/batman-adv/bridge_loop_avoidance.c:68:42: sparse: got void const *data
>> net/batman-adv/bridge_loop_avoidance.c:68:42: sparse: sparse: incorrect type in initializer (different modifiers) @@ expected struct batadv_bla_claim *claim @@ got void const *data @@
net/batman-adv/bridge_loop_avoidance.c:68:42: sparse: expected struct batadv_bla_claim *claim
net/batman-adv/bridge_loop_avoidance.c:68:42: sparse: got void const *data
--
>> net/batman-adv/translation-table.c:109:12: sparse: sparse: incorrect type in assignment (different modifiers) @@ expected struct batadv_tt_common_entry *tt @@ got void const *data @@
net/batman-adv/translation-table.c:109:12: sparse: expected struct batadv_tt_common_entry *tt
net/batman-adv/translation-table.c:109:12: sparse: got void const *data
>> net/batman-adv/translation-table.c:109:12: sparse: sparse: incorrect type in assignment (different modifiers) @@ expected struct batadv_tt_common_entry *tt @@ got void const *data @@
net/batman-adv/translation-table.c:109:12: sparse: expected struct batadv_tt_common_entry *tt
net/batman-adv/translation-table.c:109:12: sparse: got void const *data
vim +68 net/batman-adv/bridge_loop_avoidance.c
53
54 static void batadv_bla_periodic_work(struct work_struct *work);
55 static void
56 batadv_bla_send_announce(struct batadv_priv *bat_priv,
57 struct batadv_bla_backbone_gw *backbone_gw);
58
59 /**
60 * batadv_choose_claim() - choose the right bucket for a claim.
61 * @data: data to hash
62 * @size: size of the hash table
63 *
64 * Return: the hash index of the claim
65 */
66 static inline u32 batadv_choose_claim(const void *data, u32 size)
67 {
> 68 struct batadv_bla_claim *claim = data;
69 u32 hash = 0;
70
71 hash = jhash(&claim->addr, sizeof(claim->addr), hash);
72 hash = jhash(&claim->vid, sizeof(claim->vid), hash);
73
74 return hash % size;
75 }
76
--
0-DAY CI Kernel Test Service
https://01.org/lkp
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] batman-adv: remove unnecessary type castings
[not found] <20220421154829.9775-1-yuzhe@nfschina.com>
` (3 preceding siblings ...)
2022-04-22 5:07 ` kernel test robot
@ 2022-04-22 7:55 ` Sven Eckelmann
2022-04-25 11:14 ` yuzhe
2022-04-25 11:36 ` Yu Zhe
5 siblings, 1 reply; 10+ messages in thread
From: Sven Eckelmann @ 2022-04-22 7:55 UTC (permalink / raw)
To: yuzhe
Cc: a, b.a.t.m.a.n, davem, kernel-janitors, kuba, linux-kernel,
liqiong, mareklindner, netdev, pabeni, sven, sw
[-- Attachment #1: Type: text/plain, Size: 1411 bytes --]
Hi,
we neither received your mail via the mailing list nor our private mail
servers. It seems your mail setup is broken:
Apr 21 15:48:37 dvalin postfix/smtpd[10256]: NOQUEUE: reject: RCPT from unknown[2400:dd01:100f:2:72e2:84ff:fe10:5f45]: 450 4.7.1 <ha.nfschina.com>: Helo command rejected: Host not found; from=<yuzhe@nfschina.com> to=<sven@narfation.org> proto=ESMTP helo=<ha.nfschina.co>
And when I test it myself, it is also not working:
$ dig @8.8.8.8 ha.nfschina.com
; <<>> DiG 9.16.27-Debian <<>> @8.8.8.8 ha.nfschina.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 39639
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;ha.nfschina.com. IN A
;; AUTHORITY SECTION:
nfschina.com. 600 IN SOA dns11.hichina.com. hostmaster.hichina.com. 2022011002 3600 1200 86400 600
;; Query time: 328 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Fri Apr 22 09:51:56 CEST 2022
;; MSG SIZE rcvd: 105
Please fix this before sending patches out.
But the kernel test bot already demonstrated why this patch is not a good
idea. You can improve it and resent it but I will not accept it in this form.
Kind regards,
Sven
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] batman-adv: remove unnecessary type castings
2022-04-22 7:55 ` Sven Eckelmann
@ 2022-04-25 11:14 ` yuzhe
0 siblings, 0 replies; 10+ messages in thread
From: yuzhe @ 2022-04-25 11:14 UTC (permalink / raw)
To: Sven Eckelmann
Cc: a, b.a.t.m.a.n, davem, kernel-janitors, kuba, linux-kernel,
liqiong, mareklindner, netdev, pabeni, sw
Hi,
thanks for your reply, we have fixed our mail server. And I'll correct and resubmit my patch.
在 2022/4/22 15:55, Sven Eckelmann 写道:
> Hi,
>
> we neither received your mail via the mailing list nor our private mail
> servers. It seems your mail setup is broken:
>
> Apr 21 15:48:37 dvalin postfix/smtpd[10256]: NOQUEUE: reject: RCPT from unknown[2400:dd01:100f:2:72e2:84ff:fe10:5f45]: 450 4.7.1 <ha.nfschina.com>: Helo command rejected: Host not found; from=<yuzhe@nfschina.com> to=<sven@narfation.org> proto=ESMTP helo=<ha.nfschina.co>
>
>
> And when I test it myself, it is also not working:
>
> $ dig @8.8.8.8 ha.nfschina.com
>
> ; <<>> DiG 9.16.27-Debian <<>> @8.8.8.8 ha.nfschina.com
> ; (1 server found)
> ;; global options: +cmd
> ;; Got answer:
> ;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 39639
> ;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1
>
> ;; OPT PSEUDOSECTION:
> ; EDNS: version: 0, flags:; udp: 512
> ;; QUESTION SECTION:
> ;ha.nfschina.com. IN A
>
> ;; AUTHORITY SECTION:
> nfschina.com. 600 IN SOA dns11.hichina.com. hostmaster.hichina.com. 2022011002 3600 1200 86400 600
>
> ;; Query time: 328 msec
> ;; SERVER: 8.8.8.8#53(8.8.8.8)
> ;; WHEN: Fri Apr 22 09:51:56 CEST 2022
> ;; MSG SIZE rcvd: 105
>
>
> Please fix this before sending patches out.
>
>
> But the kernel test bot already demonstrated why this patch is not a good
> idea. You can improve it and resent it but I will not accept it in this form.
>
>
> Kind regards,
> Sven
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH] batman-adv: remove unnecessary type castings
[not found] <20220421154829.9775-1-yuzhe@nfschina.com>
` (4 preceding siblings ...)
2022-04-22 7:55 ` Sven Eckelmann
@ 2022-04-25 11:36 ` Yu Zhe
2022-04-25 12:50 ` Sven Eckelmann
2022-04-26 10:29 ` [PATCH v2] " Yu Zhe
5 siblings, 2 replies; 10+ messages in thread
From: Yu Zhe @ 2022-04-25 11:36 UTC (permalink / raw)
To: mareklindner, sw, a, sven, davem, kuba, pabeni
Cc: b.a.t.m.a.n, netdev, linux-kernel, liqiong, kernel-janitors, Yu Zhe
remove unnecessary void* type castings.
Signed-off-by: Yu Zhe <yuzhe@nfschina.com>
---
net/batman-adv/translation-table.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c
index 8478034d3abf..cbf96eebf05b 100644
--- a/net/batman-adv/translation-table.c
+++ b/net/batman-adv/translation-table.c
@@ -2766,7 +2766,7 @@ static void batadv_tt_tvlv_generate(struct batadv_priv *bat_priv,
u32 i;
tt_tot = batadv_tt_entries(tt_len);
- tt_change = (struct batadv_tvlv_tt_change *)tvlv_buff;
+ tt_change = tvlv_buff;
if (!valid_cb)
return;
@@ -3994,7 +3994,7 @@ static void batadv_tt_tvlv_ogm_handler_v1(struct batadv_priv *bat_priv,
if (tvlv_value_len < sizeof(*tt_data))
return;
- tt_data = (struct batadv_tvlv_tt_data *)tvlv_value;
+ tt_data = tvlv_value;
tvlv_value_len -= sizeof(*tt_data);
num_vlan = ntohs(tt_data->num_vlan);
@@ -4037,7 +4037,7 @@ static int batadv_tt_tvlv_unicast_handler_v1(struct batadv_priv *bat_priv,
if (tvlv_value_len < sizeof(*tt_data))
return NET_RX_SUCCESS;
- tt_data = (struct batadv_tvlv_tt_data *)tvlv_value;
+ tt_data = tvlv_value;
tvlv_value_len -= sizeof(*tt_data);
tt_vlan_len = sizeof(struct batadv_tvlv_tt_vlan_data);
@@ -4129,7 +4129,7 @@ static int batadv_roam_tvlv_unicast_handler_v1(struct batadv_priv *bat_priv,
goto out;
batadv_inc_counter(bat_priv, BATADV_CNT_TT_ROAM_ADV_RX);
- roaming_adv = (struct batadv_tvlv_roam_adv *)tvlv_value;
+ roaming_adv = tvlv_value;
batadv_dbg(BATADV_DBG_TT, bat_priv,
"Received ROAMING_ADV from %pM (client %pM)\n",
--
2.25.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH] batman-adv: remove unnecessary type castings
2022-04-25 11:36 ` Yu Zhe
@ 2022-04-25 12:50 ` Sven Eckelmann
2022-04-26 9:52 ` yuzhe
2022-04-26 10:29 ` [PATCH v2] " Yu Zhe
1 sibling, 1 reply; 10+ messages in thread
From: Sven Eckelmann @ 2022-04-25 12:50 UTC (permalink / raw)
To: mareklindner, sw, a, davem, kuba, pabeni, Yu Zhe
Cc: b.a.t.m.a.n, netdev, linux-kernel, liqiong, kernel-janitors, Yu Zhe
[-- Attachment #1: Type: text/plain, Size: 842 bytes --]
On Monday, 25 April 2022 13:36:35 CEST Yu Zhe wrote:
> remove unnecessary void* type castings.
>
> Signed-off-by: Yu Zhe <yuzhe@nfschina.com>
> ---
> net/batman-adv/translation-table.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
If you send a second version then please use `git format-patch -v2 ...` to
format the patch. Now it looks in patchworks like you've resent the first
version again. And please also add a little changelog after "---" which
explains what you've changed. It is trivial in this little patch but still
might be useful.
Regarding the patch: Now you've removed bridge_loop_avoidance.c +
batadv_choose_tt instead of fixing your patch. I would really prefer this
patch version:
https://git.open-mesh.org/linux-merge.git/commitdiff/8864d2fcf04385cabb8c8bb159f1f2ba5790cf71
Kind regards,
Sven
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] batman-adv: remove unnecessary type castings
2022-04-25 12:50 ` Sven Eckelmann
@ 2022-04-26 9:52 ` yuzhe
0 siblings, 0 replies; 10+ messages in thread
From: yuzhe @ 2022-04-26 9:52 UTC (permalink / raw)
To: Sven Eckelmann, mareklindner, sw, a, davem, kuba, pabeni
Cc: b.a.t.m.a.n, netdev, linux-kernel, liqiong, kernel-janitors
I agree, this patch is better. And I have tested, no sparse warning anymore.
Thank your for your help.
在 2022/4/25 20:50, Sven Eckelmann 写道:
>
> On Monday, 25 April 2022 13:36:35 CEST Yu Zhe wrote:
>
>>
>> remove unnecessary void* type castings.
>>
>> Signed-off-by: Yu Zhe<yuzhe@nfschina.com>
>> ---
>> net/batman-adv/translation-table.c | 8 ++++----
>> 1 file changed, 4 insertions(+), 4 deletions(-)
>>
>
> If you send a second version then please use `git format-patch -v2 ...` to
> format the patch. Now it looks in patchworks like you've resent the first
> version again. And please also add a little changelog after "---" which
> explains what you've changed. It is trivial in this little patch but still
> might be useful.
>
> Regarding the patch: Now you've removed bridge_loop_avoidance.c +
> batadv_choose_tt instead of fixing your patch. I would really prefer this
> patch version:
>
> https://git.open-mesh.org/linux-merge.git/commitdiff/8864d2fcf04385cabb8c8bb159f1f2ba5790cf71
>
> Kind regards,
> Sven
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v2] batman-adv: remove unnecessary type castings
2022-04-25 11:36 ` Yu Zhe
2022-04-25 12:50 ` Sven Eckelmann
@ 2022-04-26 10:29 ` Yu Zhe
1 sibling, 0 replies; 10+ messages in thread
From: Yu Zhe @ 2022-04-26 10:29 UTC (permalink / raw)
To: mareklindner, sw, a, sven, davem, kuba, pabeni
Cc: b.a.t.m.a.n, netdev, linux-kernel, liqiong, kernel-janitors,
hukun, Yu Zhe, kernel test robot
Signed-off-by: Yu Zhe <yuzhe@nfschina.com>
[sven@narfation.org: Fix missing const in batadv_choose* functions]
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
Reported-by: kernel test robot <lkp@intel.com>
---
v2:
- fix discarding 'const' qualifier from pointer target type
---
net/batman-adv/bridge_loop_avoidance.c | 4 ++--
net/batman-adv/translation-table.c | 12 ++++++------
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/net/batman-adv/bridge_loop_avoidance.c b/net/batman-adv/bridge_loop_avoidance.c
index 7f8a14d99cdb..37ce6cfb3520 100644
--- a/net/batman-adv/bridge_loop_avoidance.c
+++ b/net/batman-adv/bridge_loop_avoidance.c
@@ -65,7 +65,7 @@ batadv_bla_send_announce(struct batadv_priv *bat_priv,
*/
static inline u32 batadv_choose_claim(const void *data, u32 size)
{
- struct batadv_bla_claim *claim = (struct batadv_bla_claim *)data;
+ const struct batadv_bla_claim *claim = data;
u32 hash = 0;
hash = jhash(&claim->addr, sizeof(claim->addr), hash);
@@ -86,7 +86,7 @@ static inline u32 batadv_choose_backbone_gw(const void *data, u32 size)
const struct batadv_bla_backbone_gw *gw;
u32 hash = 0;
- gw = (struct batadv_bla_backbone_gw *)data;
+ gw = data;
hash = jhash(&gw->orig, sizeof(gw->orig), hash);
hash = jhash(&gw->vid, sizeof(gw->vid), hash);
diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c
index 8478034d3abf..01d30c1e412c 100644
--- a/net/batman-adv/translation-table.c
+++ b/net/batman-adv/translation-table.c
@@ -103,10 +103,10 @@ static bool batadv_compare_tt(const struct hlist_node *node, const void *data2)
*/
static inline u32 batadv_choose_tt(const void *data, u32 size)
{
- struct batadv_tt_common_entry *tt;
+ const struct batadv_tt_common_entry *tt;
u32 hash = 0;
- tt = (struct batadv_tt_common_entry *)data;
+ tt = data;
hash = jhash(&tt->addr, ETH_ALEN, hash);
hash = jhash(&tt->vid, sizeof(tt->vid), hash);
@@ -2766,7 +2766,7 @@ static void batadv_tt_tvlv_generate(struct batadv_priv *bat_priv,
u32 i;
tt_tot = batadv_tt_entries(tt_len);
- tt_change = (struct batadv_tvlv_tt_change *)tvlv_buff;
+ tt_change = tvlv_buff;
if (!valid_cb)
return;
@@ -3994,7 +3994,7 @@ static void batadv_tt_tvlv_ogm_handler_v1(struct batadv_priv *bat_priv,
if (tvlv_value_len < sizeof(*tt_data))
return;
- tt_data = (struct batadv_tvlv_tt_data *)tvlv_value;
+ tt_data = tvlv_value;
tvlv_value_len -= sizeof(*tt_data);
num_vlan = ntohs(tt_data->num_vlan);
@@ -4037,7 +4037,7 @@ static int batadv_tt_tvlv_unicast_handler_v1(struct batadv_priv *bat_priv,
if (tvlv_value_len < sizeof(*tt_data))
return NET_RX_SUCCESS;
- tt_data = (struct batadv_tvlv_tt_data *)tvlv_value;
+ tt_data = tvlv_value;
tvlv_value_len -= sizeof(*tt_data);
tt_vlan_len = sizeof(struct batadv_tvlv_tt_vlan_data);
@@ -4129,7 +4129,7 @@ static int batadv_roam_tvlv_unicast_handler_v1(struct batadv_priv *bat_priv,
goto out;
batadv_inc_counter(bat_priv, BATADV_CNT_TT_ROAM_ADV_RX);
- roaming_adv = (struct batadv_tvlv_roam_adv *)tvlv_value;
+ roaming_adv = tvlv_value;
batadv_dbg(BATADV_DBG_TT, bat_priv,
"Received ROAMING_ADV from %pM (client %pM)\n",
--
2.25.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
end of thread, other threads:[~2022-04-26 10:29 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20220421154829.9775-1-yuzhe@nfschina.com>
2022-04-22 2:20 ` [PATCH] batman-adv: remove unnecessary type castings kernel test robot
2022-04-22 2:41 ` kernel test robot
2022-04-22 2:51 ` kernel test robot
2022-04-22 5:07 ` kernel test robot
2022-04-22 7:55 ` Sven Eckelmann
2022-04-25 11:14 ` yuzhe
2022-04-25 11:36 ` Yu Zhe
2022-04-25 12:50 ` Sven Eckelmann
2022-04-26 9:52 ` yuzhe
2022-04-26 10:29 ` [PATCH v2] " Yu Zhe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).