Skip to content

Change xmm7360_tty_write_room to unsigned in xmm7360.c - #139

Merged
tgxn merged 3 commits into
xmm7360:masterfrom
nursoda:master
Feb 10, 2022
Merged

tgxn merged 3 commits into
xmm7360:masterfrom
nursoda:master

Conversation

@nursoda

@nursoda nursoda commented Sep 16, 2021

Copy link
Copy Markdown
Contributor

Signed-off-by: Olav Seyfarth nursoda@users.noreply.github.com

Signed-off-by: Olav Seyfarth <nursoda@users.noreply.github.com>
@nursoda nursoda mentioned this pull request Sep 16, 2021
@deelerke

Copy link
Copy Markdown

in the meantime please see my workaround in the issue section

ccflags-y := -Wno-multichar -Wno-incompatible-pointer-types

@flokli

flokli commented Nov 28, 2021

Copy link
Copy Markdown

Did this change across kernel versions?

If I apply this patch on 5.10, I get the following error:

error: builder for '/nix/store/yfn7nyi8zfrnxi469m3nhi6fmj7x2503-xmm7360-pci-unstable-2021-07-19.drv' failed with exit code 2;
       last 10 log lines:
       > /build/source/xmm7360.c:1322:16: error: initialization of 'int (*)(struct tty_struct *)' from incompatible pointer type 'unsigned int (*)(struct tty_struct *)' [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wincompatible-pointer-types-Werror=incompatible-pointer-types8;;]
       >  1322 |  .write_room = xmm7360_tty_write_room,
       >       |                ^~~~~~~~~~~~~~~~~~~~~~
       > /build/source/xmm7360.c:1322:16: note: (near initialization for 'xmm7360_tty_ops.write_room')
       > cc1: some warnings being treated as errors
       > make[3]: *** [/nix/store/f3q21byc5my9cgd6f28vbzfhiz7x8rzz-linux-5.10.81-dev/lib/modules/5.10.81/source/scripts/Makefile.build:280: /build/source/xmm7360.o] Error 1
       > make[2]: *** [/nix/store/f3q21byc5my9cgd6f28vbzfhiz7x8rzz-linux-5.10.81-dev/lib/modules/5.10.81/source/Makefile:1822: /build/source] Error 2
       > make[1]: *** [/nix/store/f3q21byc5my9cgd6f28vbzfhiz7x8rzz-linux-5.10.81-dev/lib/modules/5.10.81/source/Makefile:185: __sub-make] Error 2
       > make[1]: Leaving directory '/nix/store/f3q21byc5my9cgd6f28vbzfhiz7x8rzz-linux-5.10.81-dev/lib/modules/5.10.81/build'
       > make: *** [Makefile:9: default] Error 2
       For full logs, run 'nix log /nix/store/yfn7nyi8zfrnxi469m3nhi6fmj7x2503-xmm7360-pci-unstable-2021-07-19.drv'.

With 5.14 and 5.15 it seems to build…

flokli added a commit to flokli/nixpkgs that referenced this pull request Dec 2, 2021
As of v5.15, the `put_tty_driver` alias has been dropped in favor of
directly calling `tty_driver_kref_put` (9f90a4ddef4e). Apply this change
in the xmm7360 driver in order to allow building on recent kernels:
xmm7360/xmm7360-pci#152

Also, apply some [incompatible pointer type fixes](xmm7360/xmm7360-pci#139)
and [stability fixes](xmm7360/xmm7360-pci#149)
which are queued in that repository.

I successfully built this for 5.14 and 5.15, so let's remove the
isBroken for these versions.
@tgxn

tgxn commented Feb 6, 2022 •

Copy link
Copy Markdown
Contributor

Hi, I get the same error as @flokli from this, the error is the same form the CI task in #159 (comment)

I'm guessing this is a cleaner method for this issue #137 (comment)

@zear

zear commented Feb 6, 2022

Copy link
Copy Markdown
Contributor

Looks like the return type for tty_write_room has been changed in v5.14 (03b3b1a2405cc):
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?h=next-20220204&id=03b3b1a2405ccd71570cd5ec1fe4abd7bb4891cb

@tgxn tgxn added this to the kernel 5.15 support milestone Feb 6, 2022
@tgxn

tgxn commented Feb 10, 2022

Copy link
Copy Markdown
Contributor

I can confirm the patch from here resolves the issue building on my kernel.

@tgxn
tgxn merged commit cf6625a into xmm7360:master Feb 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants