Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp6076337ybl; Tue, 27 Aug 2019 14:05:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqzzS8M54cCko2MJ6aTXh424Q1pW+lpzs1a/HpwM/CLc2/pAXnx+MnTMCtx8Cmm84f5S9ChO X-Received: by 2002:aa7:851a:: with SMTP id v26mr537447pfn.238.1566939950794; Tue, 27 Aug 2019 14:05:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566939950; cv=none; d=google.com; s=arc-20160816; b=wphIHMR2g0S1axUA7lUyVbW6P/ZQS+WYpK1qxUwbV+eYh3KLAtJl6IK6RZX9A9Ioia qE2TUsUIP4lAobqt/8axTcuTi62wmB/syi+UlTvrNvtsjrO3DxhhsiXwehhrHdSf652Z E/ZmW4tGb+ZuqP68ITwPxumy5p53VmS8boSTrr29/r+yY9KD3jqGjU7c03EEZYxGDRiS vFEjZ0YFsltudZRXywrEBb7eoP3DHUjGd7c7hmsdSG7WlMoYEJQO39r+V8j/qgitn1Cg VXWyIV7I4awEOE827ljNI4lKftaNJ2kDx39nrMn5ryp6rr8Fcn8JTIJd9suLKjR6juzk VHEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=xqJGmhaCQ0mE4KAqKVKLY8OtGEQ4WA7SvplNI/CPuH8=; b=yeqhYnX1gPdrHCdymgBp0t2nheoflrNUv2ZCtvtMLpNN2M3VK15vlRLROEdnt5b4WY F3ELm9X5kDOd+zXCQi1HpE8KSswEAfPeTFHLEq8t6eC/J9BphTbxIdrQxR4wyrsQw5pq PnaLZC8jXuLmJi8vrFyxmoJrvZGyyE02lWCzuxlZ0Xdj+vQtw7ydJgiHSBkSR5x89Cmu 1Z+eC388mui91S2Wae1UTukQwrsFpfvw28l6d45ggU5c8svZbl5sjR/FnxNKraGdDqfx 5ah4VpqXJd7aIb+6nPDfUemArADSKAGXoZMaGsefpLipiObrnR8EMQujENRj2ugKPEdh 8YJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=jqVXnO87; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q145si396050pfc.31.2019.08.27.14.05.34; Tue, 27 Aug 2019 14:05:50 -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=pass header.i=@google.com header.s=20161025 header.b=jqVXnO87; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730473AbfH0VDk (ORCPT + 99 others); Tue, 27 Aug 2019 17:03:40 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:41316 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726675AbfH0VDk (ORCPT ); Tue, 27 Aug 2019 17:03:40 -0400 Received: by mail-pf1-f194.google.com with SMTP id 196so183833pfz.8 for ; Tue, 27 Aug 2019 14:03:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=xqJGmhaCQ0mE4KAqKVKLY8OtGEQ4WA7SvplNI/CPuH8=; b=jqVXnO87Y94ALi10nxX/DLFreu43gwvLsNu/ONVxZGD1OB5Axb2fRwBl5DNDuypTUh iksvVZWNThyaETR2uelRflKf6YuzHxTRBZfLJepcSU9/e/3TKradFWAvI4yl3FKTBMX5 P697YyJdaoTE/Ntlq+Su5JLvyj98HWV5GD2tXQNQR7GwUFzk/bCgd4oiQbEZpULIDz8Q VkacS3ZyXmHp4/75Hh2KnuAB0QIgyyVdTN3fUs8naECDt2IGklQVrpUtaB+ZJXukF7cb YBDRWcIa/hpq9bKX8U7dXOaqOrjSvLvvWy+pzHXomaSQ3cmYJgfTpnVZd9tim1pmlPN0 3HWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=xqJGmhaCQ0mE4KAqKVKLY8OtGEQ4WA7SvplNI/CPuH8=; b=kJO9Cgy7A8wTvxMlzSmpt7GUq1SjTjCunTNQOTxa9ZOWSwUgAfIRddnXyxQnYHCUZV WiTD9RA49/BBBH/FfMAtxrRt5pq36YF9w9ZOu2rYbdL+zkGGfizNHV6Nkon/t/5fc8Bp RASpZ7BOxKz8CSjRwZYul0KiapAmyXp47DTpEDW9NlaIOd0E19or6xoVuq95PzZ8GUQJ Hu0enT7+G93YI6JqT/aB6DYO89BnZRqEkWd0Bf4Q9mEWlbQ/rRzd9TBhVu7mVZhXs1sB DPRTsAPvsE3I7bDbNhEfN78hruhU1lY4Uu3KJtpuBt6nXFKWQx/v1FgeNNpNLhPuaKqf vQyg== X-Gm-Message-State: APjAAAXd8lBMI+nonYlM5GpeE9EgikqOZPmtEDpijBhotlUWKEhz3Aoi 6LQzyNMm8dBojdB8V2B/3dCvVjClm3T2vt0xddtvOqzF X-Received: by 2002:a63:205f:: with SMTP id r31mr356078pgm.159.1566939818927; Tue, 27 Aug 2019 14:03:38 -0700 (PDT) MIME-Version: 1.0 References: <20190827174932.44177-1-brendanhiggins@google.com> In-Reply-To: From: Brendan Higgins Date: Tue, 27 Aug 2019 14:03:27 -0700 Message-ID: Subject: Re: [PATCH v1] kunit: fix failure to build without printk To: shuah Cc: kunit-dev@googlegroups.com, Linux Kernel Mailing List , "open list:KERNEL SELFTEST FRAMEWORK" , Frank Rowand , Stephen Boyd , Randy Dunlap , Stephen Rothwell Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 27, 2019 at 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) [...] > Okay after reviewing this, I am not sure why you need to do all > this. > > Why can't you just change the root function that throws the warn: > > static int kunit_vprintk_emit(int level, const char *fmt, va_list args) > { > return vprintk_emit(0, level, NULL, 0, fmt, args); > } > > You aren'r really doing anything extra here, other than calling > vprintk_emit() Yeah, I did that a while ago. I think it was a combination of trying to avoid an extra layer of adding and then removing the log level, and that's what dev_printk and friends did. But I think you are probably right. It's a lot of maintenance overhead to get rid of that. Probably best to just use what the printk people have. > Unless I am missing something, can't you solve this problem by including > printk.h and let it handle the !CONFIG_PRINTK case? Randy, I hope you don't mind, but I am going to ask you to re-ack my next revision since it basically addresses the problem in a totally different way.