Re: linux-next: build failure after merge of the hte tree

From: Dipen Patel
Date: Wed May 04 2022 - 23:18:01 EST


Hi Stephen, Thierry,

Before sending patches I compiled and tested with or without HTE config successfully, I used gcc arm64 cross compiler. The initial problem kernel boat reported (reproduce step snippet below) used clang as compiler and that gives typedef issue which is what hte_return_t is. Do you know if we have to treat it differently with clang vs gcc or did I miss something?

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/swarren/linux-tegra.git hte/for-next
head:   cedbe14082d169f4c1136c70c5170a76bd9a076a
commit: 98935236600d4e179b664ffcfcd54e0ec3a1b4e3 [7/10] gpiolib: cdev: Add hardware timestamp clock type
config: arm-ep93xx_defconfig (https://download.01.org/0day-ci/archive/20220504/202205040454.CGWxoTt3-lkp@xxxxxxxxx/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 363b3a645a1e30011cc8da624f13dac5fd915628)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install arm cross compiling tool for clang build
        # apt-get install binutils-arm-linux-gnueabi
        # https://git.kernel.org/pub/scm/linux/kernel/git/swarren/linux-tegra.git/commit/?id=98935236600d4e179b664ffcfcd54e0ec3a1b4e3
        git remote add arm-tegra https://git.kernel.org/pub/scm/linux/kernel/git/swarren/linux-tegra.git
        git fetch --no-tags arm-tegra hte/for-next
        git checkout 98935236600d4e179b664ffcfcd54e0ec3a1b4e3
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash


However below failure seems like (correct me if I am wrong) Thierry might have changed typedef to int in one place and possibly not all other places.

On 5/4/22 12:04 AM, Thierry Reding wrote:
> On Wed, May 04, 2022 at 04:59:56PM +1000, Stephen Rothwell wrote:
>> Hi all,
>>
>> After merging the hte tree, today's linux-next build (arm
>> multi_v7_defconfig) failed like this:
>>
>> drivers/gpio/gpiolib-cdev.c:572:8: error: unknown type name 'hte_return_t'
>> 572 | static hte_return_t process_hw_ts_thread(void *p)
>> | ^~~~~~~~~~~~
>> drivers/gpio/gpiolib-cdev.c:623:8: error: unknown type name 'hte_return_t'
>> 623 | static hte_return_t process_hw_ts(struct hte_ts_data *ts, void *p)
>> | ^~~~~~~~~~~~
>> drivers/gpio/gpiolib-cdev.c: In function 'hte_edge_setup':
>> drivers/gpio/gpiolib-cdev.c:851:41: error: passing argument 2 of 'hte_request_ts_ns' from incompatible pointer type [-Werror=incompatible-pointer-types]
>> 851 | return hte_request_ts_ns(hdesc, process_hw_ts,
>> | ^~~~~~~~~~~~~
>> | |
>> | int (*)(struct hte_ts_data *, void *)
>> In file included from drivers/gpio/gpiolib-cdev.c:27:
>> include/linux/hte.h:234:75: note: expected 'hte_ts_cb_t' {aka 'enum hte_return (*)(struct hte_ts_data *, void *)'} but argument is of type 'int (*)(struct hte_ts_data *, void *)'
>> 234 | static inline int hte_request_ts_ns(struct hte_ts_desc *desc, hte_ts_cb_t cb,
>> | ~~~~~~~~~~~~^~
>> drivers/gpio/gpiolib-cdev.c:852:34: error: passing argument 3 of 'hte_request_ts_ns' from incompatible pointer type [-Werror=incompatible-pointer-types]
>> 852 | process_hw_ts_thread, line);
>> | ^~~~~~~~~~~~~~~~~~~~
>> | |
>> | int (*)(void *)
>> In file included from drivers/gpio/gpiolib-cdev.c:27:
>> include/linux/hte.h:235:53: note: expected 'hte_ts_sec_cb_t' {aka 'enum hte_return (*)(void *)'} but argument is of type 'int (*)(void *)'
>> 235 | hte_ts_sec_cb_t tcb, void *data)
>> | ~~~~~~~~~~~~~~~~^~~
>> cc1: some warnings being treated as errors
>>
>> Something has been missed in the contruction of the git tree :-(
>>
>> I have dropped the hte tree for today.
> Yeah, oddly I didn't catch that when I was doing the test build. Let me
> recheck what went wrong there.
>
> Sorry for the mess,
> Thierry