From patchwork Tue Jul 18 05:27:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miguel Ojeda X-Patchwork-Id: 121766 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp1521061vqt; Mon, 17 Jul 2023 22:32:01 -0700 (PDT) X-Google-Smtp-Source: APBJJlHBvv7mFz4hge00/6npiZg/ujyQTb4X6/GJ+Xvrl/xWkXVNUB7cPsDdcPwip7BaBcYlmLrs X-Received: by 2002:a50:ee18:0:b0:51d:a679:7555 with SMTP id g24-20020a50ee18000000b0051da6797555mr12935403eds.31.1689658320860; Mon, 17 Jul 2023 22:32:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689658320; cv=none; d=google.com; s=arc-20160816; b=mx585otttSGOlpMeuyQsrovHrfXydo33/5o8mB/bWLChlx9t7kHldmNPKhBqIdE9Lc CeVIt9VOO5Um3iiXmtORmamkRhFdOKUxGQmFi87yxcvL3ySSIAWdxbMfYrOFUHoi2WzG nrpbnYTFUYOk1Duck8dyHwj8mND+vbKE6FgVoQAP89VZJ0I+NxCsNVQ5WLjUGXPyVLhr l+6f8Qt0UBtgYD5rhfg5ttjP5KzGYYGhSnxy6cGm9REhyHJU5AKJrrK/d78lkvV/DUY1 ukhK6Qb4C4rmnGE8JZE9CH/Zn3fUS7waaOx87+Dv+abxpuJru7qUUA2z6OmVwOZZ3ERk 4YEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=YHJpD7hf5aJjuV6fYyd/Z8y6DIcnIphyg3Pff/8QKE8=; fh=+Nc5xztosWmfm+xMhMtR4ZOWQSq85/kQPA6E94oJU9I=; b=GWi9UjdUJ+HVJlMrSNuE9f1kKPMIaKEanV7e8dCPH5rFj2os8Ax18DP3aocMoobFvR K28OHUkK+qCMTPlXmPlKEJhV/jt+fJ2Ux2Bc6l+/BKykkZQlm/RpT2IGElkbFEkGwLaU 0CMY6MxBFlwwlfOyFYqCFs8M7QJWu8b8yAfnCX3xVgM9KZHtzF2yDWEyLEWytFaNN09A P9KzhB/4+1c+V/hFMyuoiav7qr2PXJF1KKL4WHUN08Pd1ZwM/CqcqZqjIkGMQUCje33O gV3nYqLx88cxK7GUerb8eEUaFOQHPEUKu1jf8VDjGNDKww7Ajd7Xwu8o8A9j4Fn3B5lH RE4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ki79avhf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g12-20020aa7d1cc000000b005217412e3b1si602877edp.463.2023.07.17.22.31.37; Mon, 17 Jul 2023 22:32:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ki79avhf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229972AbjGRF2Z (ORCPT + 99 others); Tue, 18 Jul 2023 01:28:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35950 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229724AbjGRF2X (ORCPT ); Tue, 18 Jul 2023 01:28:23 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F7BA1B6; Mon, 17 Jul 2023 22:28:23 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id AFDA0612ED; Tue, 18 Jul 2023 05:28:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A1525C433C8; Tue, 18 Jul 2023 05:28:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689658102; bh=xI4obn244cY8Q+3uoNdU7rfmCYQDFQ/FNZ5BuI7JKb4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ki79avhf+MFTmpgrn762d3n7YkOcX4RD6ODRBckw0ziZHddezjRCbKIOMR4bwmL4u du/EL3U2xedsGeqmeMFAuKQjh/Ox1ZMTFNEnOdI/IvIcbdqFn6/emN/zjgaqMHKwuV LEqfm+0AFHa8ARWPgZMsk0VTR64Gwnc0OFzy7w5GGcd/n+a4BNr7SSZ4JPhzx+JMty e2a7iXsNCy4HqRPVmrSbvJ3ad58C2Bf6l5/s1NXO7I/x11/NxlTgR4UcCf4bwlA3UB rkNRJvK/fBvMuz13D+25s6VAGm+so+BaZDPxr1QpY2RMvHmWHT8p1VFpev7et6pA4E jlOjjsDW8thSA== From: Miguel Ojeda To: David Gow , Brendan Higgins , Miguel Ojeda , Wedson Almeida Filho , Alex Gaynor Cc: Boqun Feng , Gary Guo , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Alice Ryhl , Andreas Hindborg , kunit-dev@googlegroups.com, linux-kselftest@vger.kernel.org, rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, patches@lists.linux.dev Subject: [PATCH v2 1/7] kunit: test-bug.h: include `stddef.h` for `NULL` Date: Tue, 18 Jul 2023 07:27:46 +0200 Message-ID: <20230718052752.1045248-2-ojeda@kernel.org> In-Reply-To: <20230718052752.1045248-1-ojeda@kernel.org> References: <20230718052752.1045248-1-ojeda@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771735163166648338 X-GMAIL-MSGID: 1771735163166648338 The header uses `NULL` in both `CONFIG_KUNIT=y` and `=n` cases, but does not include it explicitly. When `CONFIG_KUNIT=y`, the header is already getting included via the other headers, so it is not a problem for users. However, when `CONFIG_KUNIT=n`, it is not, and thus a user could hit a build error when including `kunit/test-bug.h`, like we are doing later in this series [1]. Thus include `linux/stddef.h`, and do so outside the `#if`, since it is used in both cases. Reported-by: Boqun Feng Closes: https://lore.kernel.org/rust-for-linux/ZJ8cNUW3oR2p+gL1@boqun-archlinux/ [1] Signed-off-by: Miguel Ojeda Reviewed-by: David Gow --- include/kunit/test-bug.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/kunit/test-bug.h b/include/kunit/test-bug.h index 30ca541b6ff2..47aa8f21ccce 100644 --- a/include/kunit/test-bug.h +++ b/include/kunit/test-bug.h @@ -9,6 +9,8 @@ #ifndef _KUNIT_TEST_BUG_H #define _KUNIT_TEST_BUG_H +#include /* for NULL */ + #if IS_ENABLED(CONFIG_KUNIT) #include /* For static branch */