From mboxrd@z Thu Jan 1 00:00:00 1970 From: Brendan Higgins Subject: Re: [PATCH v12 03/18] kunit: test: add string_stream a std::stream like string builder Date: Mon, 12 Aug 2019 22:02:59 -0700 Message-ID: References: <20190812182421.141150-1-brendanhiggins@google.com> <20190812182421.141150-4-brendanhiggins@google.com> <20190812225520.5A67C206A2@mail.kernel.org> <20190812233336.GA224410@google.com> <20190812235940.100842063F@mail.kernel.org> <20190813045623.F3D9520842@mail.kernel.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: In-Reply-To: <20190813045623.F3D9520842@mail.kernel.org> Sender: linux-kernel-owner@vger.kernel.org To: Stephen Boyd Cc: Frank Rowand , Greg KH , Josh Poimboeuf , Kees Cook , Kieran Bingham , Luis Chamberlain , Peter Zijlstra , Rob Herring , shuah , Theodore Ts'o , Masahiro Yamada , devicetree , dri-devel , kunit-dev@googlegroups.com, "open list:DOCUMENTATION" , linux-fsdevel@vger.kernel.org, linux-kbuild , Linux Kernel Mailing List , open list:KERNEL SELFTEST FRAMEWORK List-Id: devicetree@vger.kernel.org On Mon, Aug 12, 2019 at 9:56 PM Stephen Boyd wrote: > > Quoting Brendan Higgins (2019-08-12 17:41:05) > > On Mon, Aug 12, 2019 at 4:59 PM Stephen Boyd wrote: > > > > > > > kunit_resource_destroy (respective equivalents to devm_kfree, and > > > > devres_destroy) and use kunit_kfree here? > > > > > > > > > > Yes, or drop the API entirely? Does anything need this functionality? > > > > Drop the kunit_resource API? I would strongly prefer not to. > > No. I mean this API, string_stream_clear(). Does anything use it? Oh, right. No. However, now that I added the kunit_resource_destroy, I thought it might be good to free the string_stream after I use it in each call to kunit_assert->format(...) in which case I will be using this logic. So I think the right thing to do is to expose string_stream_destroy so kunit_do_assert can clean up when it's done, and then demote string_stream_clear to static. Sound good?