Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp6065494ybl; Tue, 27 Aug 2019 13:55:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqyEemEHlhfbEB6UxrRzzmpYF6BtFdXUb/gVOgQulBwSEabCq15ojTSsbWl64VjmHz1dG3eV X-Received: by 2002:a17:902:9a8b:: with SMTP id w11mr875315plp.171.1566939356448; Tue, 27 Aug 2019 13:55:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566939356; cv=none; d=google.com; s=arc-20160816; b=g/MvGK9TCZs2vZJkzC8BA5EKkxAupLlpPHs2iQ1fjhyH1r99arJVkpkSAL+BmtsM60 oQxLXNtDihNNF0Co6vbriY/BQRfuMG5h/peAcTmPJ6yYO01od7V86rPkq3cJihZfmABe Fg1/Ava3qdL2xkpxn/zYBOI+LpsrFH40tB836s3pjRv6AyNaQ6u/0KEKbksAKllDjvum 2mPjpB/3DMFb77mFCZrPsiwy7HfbOMVKS75WLCKz0t/OnNjp7rFaphwbIOdPJMBb1v7E DmTHu1cMcliLpXKs2wbO7ev1EXal+G6LPgPfRktwsmAQ7f5mkd1xzDVe48XiVmtTCUuA mt3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=hWwGWM0xH4rsI/3aRe9UJFvl/Jke/kx6OG9Zrp6S39w=; b=BEvWIQGMpsL9VyUGP8J8wD20EU2MSkndoDr9R/W8J2zWPnHktbOkWz93eux3aOIi6v PiX1CEmcAxXstRABfifAjlG2DbLF/AM5beKIKE8nyQrtWgode775+2BHV0ZJ75S7aDtu 7GI68ASGGvpoZYYAkSJuj2eg/hj81Winr4WJJyf3p2i2YWlgzL8vm8fihLRWladMru6/ VrILtACk40fHYkZsatiULSh/UWuP6SXGY0yx13bmutvTXAFFxkIu5AbrbtgSPxDarxoJ 6+MhXwgqOWcduUAzguChAYBvQtRONwhYXPUE4y7txec5JLETbHt1SBgE5GSqUpggYie7 DUBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=L65GB1uN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v7si319224pfb.132.2019.08.27.13.55.36; Tue, 27 Aug 2019 13:55:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=L65GB1uN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730456AbfH0UxY (ORCPT + 99 others); Tue, 27 Aug 2019 16:53:24 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:45846 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726735AbfH0UxY (ORCPT ); Tue, 27 Aug 2019 16:53:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To: Subject:Sender:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=hWwGWM0xH4rsI/3aRe9UJFvl/Jke/kx6OG9Zrp6S39w=; b=L65GB1uNzeiW2D/geTba4rmo+ tiAlnyy6KqkQCeehaTYTNs2IMKmRUGuHR26h9co45Nqz/5TGG3onBfCPVwVAaKrT7vIuYu1jt+2mD AB4uaEmY9+z7ukO0vwEMf2zIWbuWbHX06+a6zg/2+0gAtR8fIJO+H7/zxHRvWcidQLYO1Ep3qcJ92 dBeT0O9cSFGjxbxRpKNGq94C+2r/nv+Dvg+TX3IG+8VY+kVy55IqI5gZ0rIoODpb5IlrSTHMdqLiH 6Biou6h+Lg1Yzm5JJVui8QYd5ahPjLS1c8gjHoryZYsnsOJTpbXmZNq6Wg0SlXYB9me/bWx7vxNR5 NAOE67+Og==; Received: from [2601:1c0:6200:6e8::4f71] by bombadil.infradead.org with esmtpsa (Exim 4.92 #3 (Red Hat Linux)) id 1i2iSw-00089s-0N; Tue, 27 Aug 2019 20:53:22 +0000 Subject: Re: [PATCH v1] kunit: fix failure to build without printk To: shuah , Brendan Higgins Cc: kunit-dev@googlegroups.com, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, frowand.list@gmail.com, sboyd@kernel.org, Stephen Rothwell References: <20190827174932.44177-1-brendanhiggins@google.com> From: Randy Dunlap Message-ID: <5b626f60-8472-a97e-378e-755160e5d948@infradead.org> Date: Tue, 27 Aug 2019 13:53:21 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/27/19 1:21 PM, shuah wrote: > On 8/27/19 11:49 AM, Brendan Higgins wrote: >> Previously KUnit assumed that printk would always be present, which is >> not a valid assumption to make. Fix that by ifdefing out functions which >> directly depend on printk core functions similar to what dev_printk >> does. >> >> Reported-by: Randy Dunlap >> Link: https://lore.kernel.org/linux-kselftest/0352fae9-564f-4a97-715a-fabe016259df@kernel.org/T/#t >> Cc: Stephen Rothwell >> Signed-off-by: Brendan Higgins >> --- >>   include/kunit/test.h |  7 +++++++ >>   kunit/test.c         | 41 ++++++++++++++++++++++++----------------- >>   2 files changed, 31 insertions(+), 17 deletions(-) >> >> diff --git a/include/kunit/test.h b/include/kunit/test.h >> index 8b7eb03d4971..339af5f95c4a 100644 >> --- a/include/kunit/test.h >> +++ b/include/kunit/test.h >> @@ -339,9 +339,16 @@ static inline void *kunit_kzalloc(struct kunit *test, size_t size, gfp_t gfp) >>     void kunit_cleanup(struct kunit *test); >>   +#ifdef CONFIG_PRINTK > > Please make this #if defined(CONFIG_PRINTK) explain why, please? thanks. -- ~Randy