On Tue, 5 May 2026 at 21:21, Bernhard Beschow <[email protected]> wrote: > Am 5. Mai 2026 18:41:52 UTC schrieb Peter Maydell <[email protected]>: > >On Tue, 5 May 2026 at 19:03, Bernhard Beschow <[email protected]> wrote: > >> I guess the only open issue is the licensing of struct FlexcanRegs [1] > >> which originates from Linux? How do we proceed here? > >> > >> Best regards, > >> Bernhard > >> > >> [1] https://lore.kernel.org/qemu-devel/[email protected]/ > > > >Could you say what the problem is? In general there is no problem > >with taking header structs from the Linux kernel, as they are > >GPL-2-only and that is a QEMU-compatible license. The relevant > >source files or pieces of source files would need to be noted > >as 2-only rather than our default of 2-or-later, but that is > >doable -- we already do that for other things we have borrowed > >from the kernel. > > In > https://lore.kernel.org/qemu-devel/[email protected]/ > I raised this review question: "The following structure looks like being > based on Linux. Does this affect the copyright of this file?" I was just > asking for advice and I'm glad the solution is that easy.
If the struct was copied from the kernel, then it's GPL-2.0-only, and we should just note the license and where we got the code from. If the struct is just very similar to the kernel's one because it's the obvious representation taken from the datasheet, then it's not related to the kernel code and we can treat it as GPL-2.0-or-later like the rest of the file. Since Matyáš says in the cover letter here "the headers (struct FlexcanRegs and flexcan_regs.h macros) were copied from the Linux kernel" then we're in case 1. You can mark this up by having the file's SPDX tag be "SPDX-License-Identifier: (GPL-2.0-only AND GPL-2.0-or-later)" Then have a normal comment in the file next to the part that is 2.0-only that says /* * [This struct / the macros X, Y, Z / whatever ] are borrowed * from the Linux kernel, and so (unlike the rest of this file) * they are GPL-2.0-only. */ thanks -- PMM
