Skip to content

ioctls: Convert ten architectures to asm-generic/ioctls.h

Jeff Mahoney lkml 1 version Applied

Status from this message: Applied

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest10 patches 8 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/10ioctl: Use asm-generic/ioctls.h on arm (enables termiox)arch/arm/include/asm/ioctls.h+1 -822 replies
2/10ioctl: Use asm-generic/ioctls.h on avr32 (enables termiox)arch/avr32/include/asm/ioctls.h+1 -851 reply
3/10ioctl: Use asm-generic/ioctls.h on cris (enables termiox)arch/cris/include/asm/ioctls.h include/asm-generic/ioctls.h+3 -830 replies
4/10ioctl: Use asm-generic/ioctls.h on frv (enables termiox)arch/frv/include/asm/ioctls.h+1 -793 replies
5/10ioctl: Use asm-generic/ioctls.h on h8300 (enables termiox)arch/h8300/include/asm/ioctls.h+1 -800 replies
6/10ioctl: Use asm-generic/ioctls.h on ia64 (enables termiox)arch/ia64/include/asm/ioctls.h+1 -880 replies
7/10ioctl: Use asm-generic/ioctls.h on m32r (enables termiox)arch/m32r/include/asm/ioctls.h+1 -820 replies
8/10ioctl: Use asm-generic/ioctls.h on m68k (enables termiox)arch/m68k/include/asm/ioctls.h+1 -791 reply
9/10ioctl: Use asm-generic/ioctls.h on mn10300 (enables termiox)arch/mn10300/include/asm/ioctls.h+1 -830 replies
10/10ioctl: Use asm-generic/ioctls.h on s390 (enables termiox)arch/s390/include/asm/ioctls.h+1 -870 replies

Reviews trailers per patch

2 of 10 patches have a Reviewed-by or Acked-by.

PatchHaavard SkinnemoenRussell King
1/10R-b
2/10A-b
3/10
4/10
5/10
6/10
7/10
8/10
9/10
10/10

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [patch 00/10] ioctls: Convert ten architectures to asm-generic/ioctls.h

Around the time of the 32-/64-bit x86 merge, asm-generic/ioctls.h was created. It was modeled after the x86 version and new architectures are encouraged to use it.

It turns out that ten other architectures have done essentially the same thing, but by copying it instead. This series of patches updates those architectures to use the generic version.

There were a few differences between the arch-specific versions and the generic one, but none problematic enough to preclude this merge.

Specifically:
- 5 architectures define their own FIOQSIZE. asm-generic/ioctls.h already contains an ifndef for exactly this case.
- cris defines two new rs-485 ioctls and redefines another one. The two new ones are kept private and an ifndef line is added to the generic list.
- frv and h8300 provide TIOCTTYGSTRUCT, which is completely unused. I've kept it private to those architectures but it should probably be removed.
- The generic list contains the termiox ioctl set. This seems to have been added to x86 with the expectation that other arch maintainers would add it to their own. New architectures have inherited this automatically via asm-generic/ioctls.h and there isn't anything inherently architecture specific about it. It's safe to just add it to the affected architectures. If there is resistance to this, I can submit a separate patchset to enable it on those architectures and THEN apply this patchet, but it seems like a waste of time.
- The generic list provides TIOCGRS485 and TIOCSRS485, but they are still only used by two drivers, which are only available on arm, avr32, and cris. Again, there is nothing inherently architecture specific about it and new architectures have inherited it already.

All this can be verified with the following script. It strips whitespace, comments, and the leading ifndef/define header, sorts the output, and compares it without whitespace. It doesn't do any value processing, strictly 1:1 text.

I plan to audit the remaining architectures when I get a chance. Those are parisc, powerpc, sh, and xtensa.

-Jeff

---->8----
#!/bin/sh

process_include() {
	sed -ne 's/^#[[:space:]]*define/#define/p' < $1 | \
	sed -e 's#/\*.*##'| sed -e 's/[[:space:]]*$//' | \
	egrep -v '#define _*(ASM|ARCH)'|grep -v ^$ | sort -k 2
}

process_include include/asm-generic/ioctls.h > generic_ioctls

for arch in arm avr32 cris frv h8300 ia64 m32r m68k mn10300 s390; do
process_include arch/$arch/include/asm/ioctls.h > $arch-ioctls echo [$arch]
diff -wu $arch-ioctls generic_ioctls #|grep '^+#' rm -f $arch-ioctls
done

rm generic_ioctls
----8<----