Skip to content

Commit 241d50e

Browse files
yuzhenfschinaborkmann
authored andcommitted
bpf: Remove unnecessary type castings
Remove/clean up unnecessary void * type castings. Signed-off-by: Yu Zhe <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
1 parent 68477ed commit 241d50e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

kernel/bpf/bpf_struct_ops.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ int bpf_struct_ops_map_sys_lookup_elem(struct bpf_map *map, void *key,
263263
/* No lock is needed. state and refcnt do not need
264264
* to be updated together under atomic context.
265265
*/
266-
uvalue = (struct bpf_struct_ops_value *)value;
266+
uvalue = value;
267267
memcpy(uvalue, st_map->uvalue, map->value_size);
268268
uvalue->state = state;
269269
refcount_set(&uvalue->refcnt, refcount_read(&kvalue->refcnt));
@@ -353,7 +353,7 @@ static int bpf_struct_ops_map_update_elem(struct bpf_map *map, void *key,
353353
if (err)
354354
return err;
355355

356-
uvalue = (struct bpf_struct_ops_value *)value;
356+
uvalue = value;
357357
err = check_zero_holes(t, uvalue->data);
358358
if (err)
359359
return err;

kernel/bpf/hashtab.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,7 @@ static void check_and_free_timer(struct bpf_htab *htab, struct htab_elem *elem)
738738
*/
739739
static bool htab_lru_map_delete_node(void *arg, struct bpf_lru_node *node)
740740
{
741-
struct bpf_htab *htab = (struct bpf_htab *)arg;
741+
struct bpf_htab *htab = arg;
742742
struct htab_elem *l = NULL, *tgt_l;
743743
struct hlist_nulls_head *head;
744744
struct hlist_nulls_node *n;

0 commit comments

Comments
 (0)