Skip to content

Commit

Permalink
parisc: remove obsolete manual allocation aligning in iosapic
Browse files Browse the repository at this point in the history
kmalloc() returns memory with __assume_kmalloc_alignment, which is
__alignof__(unsigned long long) for parisc.

Signed-off-by: Rolf Eike Beer <eike-kernel@sf-tec.de>
Signed-off-by: Helge Deller <deller@gmx.de>
  • Loading branch information
Rolf Eike Beer authored and Helge Deller committed Sep 15, 2022
1 parent 9536374 commit e359b70
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions drivers/parisc/iosapic.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,16 +221,7 @@ static size_t irt_num_entry;

static struct irt_entry *iosapic_alloc_irt(int num_entries)
{
unsigned long a;

/* The IRT needs to be 8-byte aligned for the PDC call.
* Normally kmalloc would guarantee larger alignment, but
* if CONFIG_DEBUG_SLAB is enabled, then we can get only
* 4-byte alignment on 32-bit kernels
*/
a = (unsigned long)kmalloc(sizeof(struct irt_entry) * num_entries + 8, GFP_KERNEL);
a = (a + 7UL) & ~7UL;
return (struct irt_entry *)a;
return kcalloc(num_entries, sizeof(struct irt_entry), GFP_KERNEL);
}

/**
Expand Down

0 comments on commit e359b70

Please sign in to comment.