Werner Zeh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34386 )
Change subject: util/lint/checkpatch.pl: Update line length to 96 ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/c/coreboot/+/34386/1/util/lint/checkpatch.pl File util/lint/checkpatch.pl:
https://review.coreboot.org/c/coreboot/+/34386/1/util/lint/checkpatch.pl@54 PS1, Line 54: my $max_line_length = 96;
That happened because that patchset was based on a commit that didn't have the 96 characters per lin […]
I found this issue when we were working on https://review.coreboot.org/c/coreboot/+/34384/1. If I for instance take src/drivers/spi/winbond.c and move the call to ret = spi_flash_cmd_wait_ready(flash, SPI_FLASH_PROG_TIMEOUT_MS); on a single line, this will end up being 81 characters. Adding this patch will then let checkpatch.pl complain about 80 characters:
WARNING: line over 80 characters #11: FILE: src/drivers/spi/winbond.c:329: + ret = spi_flash_cmd_wait_ready(flash, SPI_FLASH_PROG_TIMEOUT_MS);
Though it is just a warning my expectation was that even the warning should not appear after increasing the length to 96 characters.
After searching around for a while I found that the change made in CB:33405 will only be active if one have updated the pre-commit-hook to the new style which uses 'util/lint/lint-007-checkpatch diff' now. My old pre-commit-hook still have the style like this:
#!/bin/sh make lint-stable git diff --cached | util/lint/checkpatch.pl --no-signoff -q -
And here is where the 96 characters are missing. This pretty much explains the issue I have.
And you cannot get the new hook if you still have the old in place as the gitconfig.sh script checks for an existing hook and will not update it if it is already there with the needed name.
Nevertheless, while I was looking for this issue I found the usage text in checkpatch.pl which says how to pass the argument for max-line-length to checkpatch.pl. Here it states:
--max-line-length=n set the maximum line length, if exceeded, warn
What CB:33405 introduced was:
opts="--max-line-length 96"
and
util/lint/checkpatch.pl --quiet --no-signoff $opts $args -
Am I mistaken or is there a missing '=' before 96?