From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 404F8C433EF for ; Wed, 4 May 2022 08:09:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346067AbiEDINZ (ORCPT ); Wed, 4 May 2022 04:13:25 -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-Google-Smtp-Source: ABdhPJzlbXuZcZ7lFZxvsNXNPvutssuzEIO//oGx7vMAwvE2mWagneIY//QqfdB3Ib+6SyZN37tutH53ntzIL2i6qDw= 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" 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