Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp517203iob; Wed, 4 May 2022 01:51:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyLcD2MsUshdd5AVewJ+LQNrOnwxhgGx2Jy5AhMkwqE/8Z0dUaGK4MyGjw05qXksCA1KLil X-Received: by 2002:a17:90b:17c1:b0:1dc:a6e6:ef26 with SMTP id me1-20020a17090b17c100b001dca6e6ef26mr368447pjb.22.1651654297567; Wed, 04 May 2022 01:51:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651654297; cv=none; d=google.com; s=arc-20160816; b=SD3WHXWtD/26USvRYgxODEop7nxcQRqTY1OYsMepADYuzULrhm8X4YzPlDY50nd6+X Xkb0NJfxfhUD63bFfxY45wh/PV5VYUrd7UNGp6a8YZCAv6jJgZAcvqcxbCneoO/1pp7u N+kCyNGkfpYvahhE4VcrSBHLpTFAVwMlqi7OAn8zwU6HHjj0aW489OMPzloUl0SVBdLC fBWToTWbrYqdBgr8dtUnf1UCH6MS3CsZYHocWpNthJQyVMso02NdQh2s0+uV8rtP+BEz LNVGGR3juCMYL9vstkcc5mCGNMpOdmxb+HrM/EIQUYLtFpU/6eoKu7TG7hqnXka0r3Ir qEUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=Lu0+Qy04jOfWQIM0Gy8rraQtjHpXPEO19LjLG52mw9o=; b=IX3H2Lo9zk2WmBvtK1hYSVfjTE741Goc72vNd8ZTDPdVH8YHn7wttsmXOwOzJmg3gn mN2eHfvXWDTzPVYV1SLIaJfj74mvdas+bp7N0udGQZlSQNBiwDYs0ub/7c/24DsnLqKc CD+zT57Kg8MATM3JZSjyyzCYCqPpCdZS+4Ma6eMY3t/hbJKUzcszi/Kj9YHDTr5rXK2Z QRyzzaN5WvST8Y5EBB4ghwCInEbr6AldmhErOXzud+FB0R7AuN+yDM6B/zDFP0vFdYlh AQRVESkIEE4vKlGGWt9wZNXeJRdSh10OyIfpugx7+OqLeb/ZY6XkYlB7wpJ7ryEar9Ln +sfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=USH7ZZ1L; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s34-20020a632162000000b003ab7a1a2193si18883852pgm.151.2022.05.04.01.51.22; Wed, 04 May 2022 01:51:37 -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=@gmail.com header.s=20210112 header.b=USH7ZZ1L; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346064AbiEDINY (ORCPT + 99 others); Wed, 4 May 2022 04:13:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42268 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346022AbiEDINV (ORCPT ); Wed, 4 May 2022 04:13:21 -0400 Received: from mail-io1-xd31.google.com (mail-io1-xd31.google.com [IPv6:2607:f8b0:4864:20::d31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 679982250D; Wed, 4 May 2022 01:09:46 -0700 (PDT) Received: by mail-io1-xd31.google.com with SMTP id h85so713628iof.12; Wed, 04 May 2022 01:09:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Lu0+Qy04jOfWQIM0Gy8rraQtjHpXPEO19LjLG52mw9o=; b=USH7ZZ1LQxTWexyjMl5Br1eNEI8WY2FaP7ZmbZvKUCSYIzweA/CqteP5DPe//EJjN5 5Dr+jMlNHozgcGkiYnujYJ4cwtaL0BYYBiAyWJjFHJqE+bk1esuyjR4IEbzz/rSmmPCj OEbjnV18sHMNz4e8fYSmBedf1THpyFIRLbgKpY70Pkl1BzyH7yvYfbxMNep1XMEt1V1x ahxI+FblPLUydAYyUVYDB6rGf3aYgAhQot0cJNDqNprViM+9uLdD1IJVAPa/1tFSyQwr 4ykPkTT+a9Wj8LLIOvviFYk+pCNn8fh2TYo2zduaLt5d8pjvIhYrXJ19PIeNGzpDkXZo bbow== 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; bh=Lu0+Qy04jOfWQIM0Gy8rraQtjHpXPEO19LjLG52mw9o=; b=Oz40c/M6+E4DUfBy0P9o5+eSp/TCVcJz538R8MBH296iPElrZY/SC9FO7vava6SLUR FdqdafpWNupiJsBuIQ+d1oN7OFOatYsuFfQmOnOQ3mUXVPZlFPStI1uB4yKUB2rAIaoU GBRvm+jSOAsA6RIMSOEVrqrDAROq2B3Kf9pVyx9VgOEKLUIcXrkFX0AV+BjU/uF9sCtp KG4c/lZoI0cin2L+rkmY+GcdmuXiz5YUwJi78320x0AQpqhL/M1ryxTRXBBzTd8cXyjo 6H81yrfWzAiipEOBxxILWE0d+A8qeTueSO8YNuwClbl1QFnPYO2fWOpT0h4cv5mKhG1X ZwmQ== X-Gm-Message-State: AOAM532BEmEz1wTwhL7kN7KTnlVx8/kVW+f3UoZc0osUjLvjDDrDym4e SpVja5OT+SpQ6gQMukGtMDg209Xx0k21tXQC9CrFkHZ3T08= X-Received: by 2002:a02:c6af:0:b0:32a:f5f6:34bc with SMTP id o15-20020a02c6af000000b0032af5f634bcmr8955794jan.186.1651651785880; Wed, 04 May 2022 01:09:45 -0700 (PDT) MIME-Version: 1.0 References: <20220502093625.GA23225@kernel.org> In-Reply-To: From: Miguel Ojeda Date: Wed, 4 May 2022 10:09:34 +0200 Message-ID: Subject: Re: [PATCH] kunit: take `kunit_assert` as `const` To: Daniel Latypov Cc: Miguel Ojeda , Brendan Higgins , "open list:KERNEL SELFTEST FRAMEWORK" , kunit-dev@googlegroups.com, linux-kernel Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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 Hi Daniel, On Mon, May 2, 2022 at 9:44 PM Daniel Latypov wrote: > > Reviewed-by: Daniel Latypov > > Thanks for this, the code definitely should have been this way from the start. > > I had wanted to make this change but mistakenly thought the format > func took it via non-const for some reason. > I must have misread it once and got it into my head that we were > leaving the door open for mutable child structs (which sounds like a > bad idea). Thanks for reviewing it so quickly! Yeah, I was unsure too if there was an external reason such as some future plan to use the mutability as you mention or maybe some out-of-tree user was relying on it already. But I thought it would be best to make it stricter until it is actually needed (if ever); or if there is an actual user for mutability, it should be documented/noted in-tree. It also simplifies a tiny bit a Rust-side call to `kunit_do_failed_assertion` that I am using within generated Rust documentation tests. Cheers, Miguel