Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp202381img; Wed, 27 Feb 2019 20:20:45 -0800 (PST) X-Google-Smtp-Source: AHgI3IZykRCKjVbWabp+GmOu2kuHsng23uFRutc2eM1kBY2J7u+LWh4Oy7uQ0X/91CJLHQELsc2b X-Received: by 2002:a62:aa08:: with SMTP id e8mr5314106pff.139.1551327645627; Wed, 27 Feb 2019 20:20:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551327645; cv=none; d=google.com; s=arc-20160816; b=A6tKhPHYIlThCg8/nHhy5T8mKEwaZ9JdaEw+tRzveMo4L5oNxCwwvlOvZp+HKRlIAa xBFO+1uTyoZj8+gzmq9QP24xQYMTinppiq8ZZgytBDwG5XyCAeLLoC61vN73ZPc50BSH zJmuBgjB/UKncj3Yato50ob4kp4F4oHAg05BHX3eXq19Yu8wOv6QloYojUj4X+dwSBWM v0h8mLkVVSS0lxCQA9kH+bnInOGRHucZK90ku4dae56EN6Cdfw5Qc4qoHbM6r4VeSDfv pSGMfAf3w1LIqjVRbIoZDMxX1/oGWrAGf4+9C1/xjoh7zay51DiQ7ySlwXXSxSXjPLXl dMHA== 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=kYcUG6WC0M7s1zzaRAYjx0mAZZ16h/4zXB0siEm4NnM=; b=JXXfDwk96HBQE53n1b1V/H08qtUaTGXxIAkquIV5doeiz7tXGEk9z2/Qp3zVY4aCZ8 QaFCrA0oBTNcN/fN+D/6cqcs8UQ+SVb65oG1XebIO7DVl+vMKNEOURcvxMzEgrWyt7A+ zVKKvuaiUltBiF8r53y3/ilYX3RQEdy/dCN10pjUhondHqT3F+QBncy6UvEmKOeNXvnN aqifnNuQtBjMuaDM3pYt9C7PxhHA3gl19OVGQZnTYsR0KLVULlGKiyMNzdJXuUtwt0B8 3/i3l8P8wB6/4gnGQygtmalnEJUvz521nqEdLHPpoVSrwnomwv6HyjC/XdXZWZf5oK9U cjKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=dwyxiPx3; 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 136si17007692pfu.221.2019.02.27.20.20.29; Wed, 27 Feb 2019 20:20:45 -0800 (PST) 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=dwyxiPx3; 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 S1730600AbfB1ES7 (ORCPT + 99 others); Wed, 27 Feb 2019 23:18:59 -0500 Received: from mail-oi1-f194.google.com ([209.85.167.194]:45663 "EHLO mail-oi1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730240AbfB1ES6 (ORCPT ); Wed, 27 Feb 2019 23:18:58 -0500 Received: by mail-oi1-f194.google.com with SMTP id t82so15396592oie.12 for ; Wed, 27 Feb 2019 20:18:58 -0800 (PST) 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=kYcUG6WC0M7s1zzaRAYjx0mAZZ16h/4zXB0siEm4NnM=; b=dwyxiPx3LguhovjXrpiGWwonMlOId9sN3uVnMtRaWGFcAUruW8CsdspVoYURNH63of O+8P4gBW7eBtX/vpUNlPXCjwgGTRNtA9ArCZwmhauOdDPKDY+rl1GXBj/UN6IZhEff8F iUK6XbiOnSNl7dcK0d1GsfqMuoKq/BTpJgvcQwsy2ApHZLbvJ6trmR9weELukOqGp9c0 tVLoymnU8eTAsVvMLrZKXWAo2ZrPr0p+ud+9RrzDlavfMPQdZiWOUm0qJGJU8U+VdqGs MB7w91xgRGtkdvjqmUgo9UVQYI3BhExx4dhydutXRN5KSkBBtz59m6rL5xSzT1b6QMgk ikgw== 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=kYcUG6WC0M7s1zzaRAYjx0mAZZ16h/4zXB0siEm4NnM=; b=P417iTOB0QV9ktr1FLTmfxAZMR4FGhzluYGrlZGA0Idkmb5l45KZDEKTot3kWftqh8 H76LArDOOULbBxQAW1YfKPwiRNLG4zuZYRKSlL68rZm154esGc/4+cWDsXda7dH6VZl2 PeHcwMTLJVMnsLK0yp85Mg6mRugYFtmrq2Re9b8R1xAvUqwfA+sY21FPY0NTL+toSZWn BI/4I6CVtcTFRbOh6XiOa2L5Op/JpaF55aXNbM3CNCU5MeWHVTI1bmgn+PhTPfEuJ0sv q4FtK8JwHt+EBBmTkG1IfHErGOsl7MTG6XOrjtFnUOd6TDr2YlFtSV+qtQR2+m3OWjx9 7SsQ== X-Gm-Message-State: AHQUAuY8hk0xZ66Cmerp0hnz/OjZ4lFv7fzsCxBhwg9hXFo5KivpHhgC ZCGFCEwxHvZ+JCaXz+jdhRoctcsOr2diFBIFnwtSHQ== X-Received: by 2002:aca:7503:: with SMTP id q3mr1738723oic.76.1551327537432; Wed, 27 Feb 2019 20:18:57 -0800 (PST) MIME-Version: 1.0 References: <20190214213729.21702-1-brendanhiggins@google.com> <4dff3b1a-7ded-7218-5325-3c397cc3c73e@gmail.com> <871s3zeeay.fsf@morokweng.localdomain> In-Reply-To: <871s3zeeay.fsf@morokweng.localdomain> From: Brendan Higgins Date: Wed, 27 Feb 2019 20:18:46 -0800 Message-ID: Subject: Re: [RFC v4 00/17] kunit: introduce KUnit, the Linux kernel unit testing framework To: Thiago Jung Bauermann Cc: Frank Rowand , Kees Cook , Luis Chamberlain , shuah@kernel.org, Rob Herring , Kieran Bingham , Greg KH , Joel Stanley , Michael Ellerman , Joe Perches , brakmo@fb.com, Steven Rostedt , "Bird, Timothy" , Kevin Hilman , Julia Lawall , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Linux Kernel Mailing List , Jeff Dike , Richard Weinberger , linux-um@lists.infradead.org, Daniel Vetter , dri-devel , Dan Williams , linux-nvdimm , Knut Omang , devicetree , Petr Mladek , Sasha Levin , Amir Goldstein , dan.carpenter@oracle.com, wfg@linux.intel.com 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 Fri, Feb 22, 2019 at 12:53 PM Thiago Jung Bauermann wrote: > > > Frank Rowand writes: > > > On 2/19/19 10:34 PM, Brendan Higgins wrote: > >> On Mon, Feb 18, 2019 at 12:02 PM Frank Rowand wrote: > >> > >>> I have not read through the patches in any detail. I have read some of > >>> the code to try to understand the patches to the devicetree unit tests. > >>> So that may limit how valid my comments below are. > >> > >> No problem. > >> > >>> > >>> I found the code difficult to read in places where it should have been > >>> much simpler to read. Structuring the code in a pseudo object oriented > >>> style meant that everywhere in a code path that I encountered a dynamic > >>> function call, I had to go find where that dynamic function call was > >>> initialized (and being the cautious person that I am, verify that > >>> no where else was the value of that dynamic function call). With > >>> primitive vi and tags, that search would have instead just been a > >>> simple key press (or at worst a few keys) if hard coded function > >>> calls were done instead of dynamic function calls. In the code paths > >>> that I looked at, I did not see any case of a dynamic function being > >>> anything other than the value it was originally initialized as. > >>> There may be such cases, I did not read the entire patch set. There > >>> may also be cases envisioned in the architects mind of how this > >>> flexibility may be of future value. Dunno. > >> > >> Yeah, a lot of it is intended to make architecture specific > >> implementations and some other future work easier. Some of it is also > >> for testing purposes. Admittedly some is for neither reason, but given > >> the heavy usage elsewhere, I figured there was no harm since it was > >> all private internal usage anyway. > >> > > > > Increasing the cost for me (and all the other potential code readers) > > to read the code is harm. > > Dynamic function calls aren't necessary for arch-specific > implementations either. See for example arch_kexec_image_load() in > kernel/kexec_file.c, which uses a weak symbol that is overriden by > arch-specific code. Not everybody likes weak symbols, so another > alternative (which admitedly not everybody likes either) is to use a > macro with the name of the arch-specific function, as used by > arch_kexec_post_alloc_pages() in for instance. I personally have a strong preference for dynamic function calls over weak symbols or macros, but I can change it if it really makes anyone's eyes bleed.