mirror of
https://github.com/torvalds/linux.git
synced 2024-11-11 14:42:24 +00:00
86a0727b09
Instead of open-coding the same header details in the tx/rx frames, directly include the actual struct. Rename associated variables to the more verbose of the two versions. This also has the benefit of being able to replace a field-spanning memcpy() with a direct assignment, helping clear the way for coming FORTIFY_SOURCE improvements. "diffoscope" reports no object code differences after this change, excepting the selection of different registers when switching from memcpy() to direct assignment: --- drivers/staging/wlan-ng/prism2usb.o.before +++ drivers/staging/wlan-ng/prism2usb.o.after ├── objdump --line-numbers --disassemble --demangle --reloc --no-show-raw-insn --section=.text {} │ @@ -4887,24 +4887,24 @@ │ sub %rdi,%rcx │ add $0x3c,%ecx │ shr $0x3,%ecx │ rep stos %rax,%es:(%rdi) │ mov $0x8,%eax │ movl $0x123,0x23e(%rbx) │ mov %ax,0x244(%rbx) │ - mov (%rdx),%rcx │ - mov %rcx,0x246(%rbx) │ - mov 0x8(%rdx),%rcx │ - mov %rcx,0x24e(%rbx) │ - mov 0x10(%rdx),%rcx │ - mov %rcx,0x256(%rbx) │ - mov 0x18(%rdx),%ecx │ - mov %ecx,0x25e(%rbx) │ - movzwl 0x1c(%rdx),%edx │ - mov %dx,0x262(%rbx) │ + mov (%rdx),%rax │ + mov %rax,0x246(%rbx) │ + mov 0x8(%rdx),%rax │ + mov %rax,0x24e(%rbx) │ + mov 0x10(%rdx),%rax │ + mov %rax,0x256(%rbx) │ + mov 0x18(%rdx),%eax │ + mov %eax,0x25e(%rbx) │ + movzwl 0x1c(%rdx),%eax │ + mov %ax,0x262(%rbx) │ cmpq $0x0,0x0(%rbp) │ movzwl 0x70(%rsi),%eax │ je 477a <hfa384x_drvr_txframe+0xba> │ add $0x8,%eax │ mov $0x44,%r12d │ mov %ax,0x264(%rbx) │ mov 0x70(%r13),%edx Cc: Romain Perier <romain.perier@gmail.com> Cc: Allen Pais <apais@linux.microsoft.com> Cc: Ivan Safonov <insafonov@gmail.com> Cc: Arnd Bergmann <arnd@arndb.de> Cc: linux-staging@lists.linux.dev Signed-off-by: Kees Cook <keescook@chromium.org> Link: https://lore.kernel.org/r/20210819174537.3499227-3-keescook@chromium.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
||
---|---|---|
.. | ||
cfg80211.c | ||
hfa384x_usb.c | ||
hfa384x.h | ||
Kconfig | ||
Makefile | ||
p80211conv.c | ||
p80211conv.h | ||
p80211hdr.h | ||
p80211ioctl.h | ||
p80211metadef.h | ||
p80211metastruct.h | ||
p80211mgmt.h | ||
p80211msg.h | ||
p80211netdev.c | ||
p80211netdev.h | ||
p80211req.c | ||
p80211req.h | ||
p80211types.h | ||
p80211wep.c | ||
prism2fw.c | ||
prism2mgmt.c | ||
prism2mgmt.h | ||
prism2mib.c | ||
prism2sta.c | ||
prism2usb.c | ||
README |
TODO: - checkpatch.pl cleanups - sparse warnings - move to use the in-kernel wireless stack Please send any patches or complaints about this driver to Greg Kroah-Hartman <greg@kroah.com> and don't bother the upstream wireless kernel developers about it, they want nothing to do with it.