From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1458FC433F5 for ; Thu, 30 Sep 2021 22:39:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DC16261882 for ; Thu, 30 Sep 2021 22:39:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344246AbhI3Wlk (ORCPT ); Thu, 30 Sep 2021 18:41:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36544 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343926AbhI3Wli (ORCPT ); Thu, 30 Sep 2021 18:41:38 -0400 Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B8ECC06176D for ; Thu, 30 Sep 2021 15:39:55 -0700 (PDT) Received: by mail-lf1-x12c.google.com with SMTP id i25so31331080lfg.6 for ; Thu, 30 Sep 2021 15:39:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=vpEK1RK+z1DYVOyk9DbEX3Qy0CptNAutN/+eoXhnNAg=; b=MPcV1nKTG41YsS6nzyECLzS8XJcpcOFfbS7VcjU0nJu/vyyILaiw89TNbZRdv06fp/ Su2MmLA9dka8g53MV7Nlkf5KlBiC8susP2eemNZkkZ6deq7x1t0rsM+v1MbBcgAk5rBO 9wS9iw6ysXstOGP3itVu6SHxJoTKmTvSCEE99X50nF7tSPbEXiG3VsfZ0n9sYNzhlpz5 iWlmE7HHx0SjYIqoa6LfJiyqxsTCwSsw5Dq4iWAufzv11x0kG3zJGCH7FPkzlsLJvttm nuq2hv0yG8538ZdydG/D4n44TePQPrpr69XoaMMfk46zVgUlx4+VnNTnaJ9/bjPyJE8w IYvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=vpEK1RK+z1DYVOyk9DbEX3Qy0CptNAutN/+eoXhnNAg=; b=0LG5/8uQ+Wgjvb8Fl2sWkRvO3IDREPpU/O1ttK1JU3MAmtwmlhX1lEaRndv0y3aRwK IQl/95lDvdOwLZxCTrZVbwI0RHKrnuJdgSet0xUra29sDjl+VFFcUhntfSTyjqnp4sbe dWHPj/2qpFgJHBzDoKt3jopz6ev5AIP7EAzFs0rQ4luXU37mSSj7bf4y2sv5+HvfhCDt NhsR5dCGapE9YCyyUOmIdyvA5Jff6Pu1+GotCASXazFTl+URp/Ls0bh9KJrr6B1gwH3R PCzF9nIJT3/fWIJnWEbDwRHeCINrHO9HE6k12dxV/GxW3II3UlX2eRajs25ZHfJKPdVs vpZA== X-Gm-Message-State: AOAM530d3C/FLar9kLaZaVGL6avPXM4e9N5P0pcm4/JtME9oDvGxago+ 0ucUQYhwHZAXMMav3eziPKpCOEh97tOCO7nnDQIlSw== X-Google-Smtp-Source: ABdhPJysr58yCMlOKQdoTUQe1CpCXlV7Z0NZ/4XMkU/oHfVF8EPT50KZPM/Gvlr1q5u8LKPCiV9rRwIUOUwRmWuXU5E= X-Received: by 2002:a05:6512:1303:: with SMTP id x3mr1728584lfu.291.1633041593380; Thu, 30 Sep 2021 15:39:53 -0700 (PDT) MIME-Version: 1.0 References: <20210903012236.160858-1-lizhijian@cn.fujitsu.com> In-Reply-To: <20210903012236.160858-1-lizhijian@cn.fujitsu.com> From: Linus Walleij Date: Fri, 1 Oct 2021 00:39:42 +0200 Message-ID: Subject: Re: [PATCH v2] selftests/gpio: Fix gpio compiling error To: Li Zhijian , Bartosz Golaszewski Cc: Shuah Khan , "open list:GPIO SUBSYSTEM" , linux-kselftest@vger.kernel.org, linux-kernel , Philip Li , kernel test robot Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Hi Li, thanks for your patch! It needs to be sent directly to Bartosz Golaszewski so he can apply it to the GPIO tree. Thanks! Linus Walleij On Fri, Sep 3, 2021 at 3:18 AM Li Zhijian wrote: > > [root@iaas-rpma gpio]# make > gcc gpio-mockup-cdev.c -o /home/lizhijian/linux/tools/testing/selfte= sts/gpio/gpio-mockup-cdev > gpio-mockup-cdev.c: In function =E2=80=98request_line_v2=E2=80=99: > gpio-mockup-cdev.c:24:30: error: storage size of =E2=80=98req=E2=80=99 is= n=E2=80=99t known > 24 | struct gpio_v2_line_request req; > | ^~~ > gpio-mockup-cdev.c:32:14: error: =E2=80=98GPIO_V2_LINE_FLAG_OUTPUT=E2=80= =99 undeclared (first use in this function); did you mean =E2=80=98GPIOLINE= _FLAG_IS_OUT=E2=80=99? > 32 | if (flags & GPIO_V2_LINE_FLAG_OUTPUT) { > | ^~~~~~~~~~~~~~~~~~~~~~~~ > > gpio-mockup-cdev.c includes which could be provided by > kernel-headers package, and where it's expected to declare > GPIO_V2_LINE_FLAG_OUTPUT. However distros or developers will not always > install the same kernel-header as we are compiling. > > So we can tell compiler to search headers from linux tree simply like oth= ers, > such as sched. > > CC: Philip Li > Reported-by: kernel test robot > Signed-off-by: Li Zhijian > > --- > V2: add more details about the fix > --- > tools/testing/selftests/gpio/Makefile | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/tools/testing/selftests/gpio/Makefile b/tools/testing/selfte= sts/gpio/Makefile > index 39f2bbe8dd3d..42ea7d2aa844 100644 > --- a/tools/testing/selftests/gpio/Makefile > +++ b/tools/testing/selftests/gpio/Makefile > @@ -3,5 +3,6 @@ > TEST_PROGS :=3D gpio-mockup.sh > TEST_FILES :=3D gpio-mockup-sysfs.sh > TEST_GEN_PROGS_EXTENDED :=3D gpio-mockup-cdev > +CFLAGS +=3D -I../../../../usr/include > > include ../lib.mk > -- > 2.31.1 > > >