Page MenuHomeFreeBSD

linuxkpi: Move `ARRAY_SIZE` to <linux/array_size.h>
ClosedPublic

Authored by dumbbell on Apr 22 2026, 8:16 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Jul 5, 7:28 AM
Unknown Object (File)
Sun, Jul 5, 12:27 AM
Unknown Object (File)
Fri, Jul 3, 5:35 AM
Unknown Object (File)
Tue, Jun 30, 5:21 PM
Unknown Object (File)
Fri, Jun 26, 2:01 PM
Unknown Object (File)
Thu, Jun 25, 4:36 PM
Unknown Object (File)
Wed, Jun 24, 12:57 AM
Unknown Object (File)
Mon, Jun 22, 11:31 PM

Details

Summary

The DRM generic code started to import this header directly in Linux 6.12.x. Let's move the definition of ARRAY_SIZE() (the only thing that <linux/array_size.h> defines) to this header.

Also, include <linux/array_size.h> from the same headers as Linux. This includes <linux/kernel.h>, so the change should not break anything.

This is part of the update of DRM drivers to Linux 6.12.81.

Sponsored by: The FreeBSD Foundation

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

dumbbell added a reviewer: linuxkpi.
dumbbell set the repository for this revision to rG FreeBSD src repository.
bz requested changes to this revision.Apr 22 2026, 1:59 PM
bz added a subscriber: bz.
bz added inline comments.
sys/compat/linuxkpi/common/include/linux/array_size.h
9

When ARRAY_SIZE came into LinuxKPI in aa0a1e58f0189 there were only three (c) on the file:

+ * Copyright (c) 2010 Isilon Systems, Inc.
+ * Copyright (c) 2010 iX Systems, Inc.
+ * Copyright (c) 2010 Panasas, Inc.

I think we can trim it down to them ast least for this.

This revision now requires changes to proceed.Apr 22 2026, 1:59 PM
This revision is now accepted and ready to land.Apr 22 2026, 7:20 PM