Re: [PATCH v12 03/18] kunit: test: add string_stream a std::stream like string builder

2019-08-13 Thread Stephen Boyd
Quoting Brendan Higgins (2019-08-13 02:12:54) > On Tue, Aug 13, 2019 at 2:04 AM Brendan Higgins > wrote: > > > > On Mon, Aug 12, 2019 at 10:30 PM Stephen Boyd wrote: > > > > > > Quoting Brendan Higgins (2019-08-12 22:02:59) > > > > However, now that I added the kunit_resource_destroy, I thought

Re: [PATCH v12 03/18] kunit: test: add string_stream a std::stream like string builder

2019-08-13 Thread Brendan Higgins
On Tue, Aug 13, 2019 at 2:04 AM Brendan Higgins wrote: > > On Mon, Aug 12, 2019 at 10:30 PM Stephen Boyd wrote: > > > > Quoting Brendan Higgins (2019-08-12 22:02:59) > > > On Mon, Aug 12, 2019 at 9:56 PM Stephen Boyd wrote: > > > > > > > > Quoting Brendan Higgins (2019-08-12 17:41:05) > > > > >

Re: [PATCH v12 03/18] kunit: test: add string_stream a std::stream like string builder

2019-08-13 Thread Brendan Higgins
On Mon, Aug 12, 2019 at 10:30 PM Stephen Boyd wrote: > > Quoting Brendan Higgins (2019-08-12 22:02:59) > > 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: > > > > > > > > >

Re: [PATCH v12 03/18] kunit: test: add string_stream a std::stream like string builder

2019-08-12 Thread Stephen Boyd
Quoting Brendan Higgins (2019-08-12 22:02:59) > 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

Re: [PATCH v12 03/18] kunit: test: add string_stream a std::stream like string builder

2019-08-12 Thread Brendan Higgins
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? > > > >

Re: [PATCH v12 03/18] kunit: test: add string_stream a std::stream like string builder

2019-08-12 Thread Stephen Boyd
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

Re: [PATCH v12 03/18] kunit: test: add string_stream a std::stream like string builder

2019-08-12 Thread Brendan Higgins
On Mon, Aug 12, 2019 at 4:59 PM Stephen Boyd wrote: > > Quoting Brendan Higgins (2019-08-12 16:33:36) > > On Mon, Aug 12, 2019 at 03:55:19PM -0700, Stephen Boyd wrote: > > > Quoting Brendan Higgins (2019-08-12 11:24:06) > > > > +void string_stream_clear(struct string_stream *stream) > > > > +{ >

Re: [PATCH v12 03/18] kunit: test: add string_stream a std::stream like string builder

2019-08-12 Thread Stephen Boyd
Quoting Brendan Higgins (2019-08-12 16:33:36) > On Mon, Aug 12, 2019 at 03:55:19PM -0700, Stephen Boyd wrote: > > Quoting Brendan Higgins (2019-08-12 11:24:06) > > > +void string_stream_clear(struct string_stream *stream) > > > +{ > > > + struct string_stream_fragment *frag_container, > > >

Re: [PATCH v12 03/18] kunit: test: add string_stream a std::stream like string builder

2019-08-12 Thread Brendan Higgins
On Mon, Aug 12, 2019 at 03:55:19PM -0700, Stephen Boyd wrote: > Quoting Brendan Higgins (2019-08-12 11:24:06) > > +void string_stream_clear(struct string_stream *stream) > > +{ > > + struct string_stream_fragment *frag_container, *frag_container_safe; > > + > > + spin_lock(>lock); > >

Re: [PATCH v12 03/18] kunit: test: add string_stream a std::stream like string builder

2019-08-12 Thread Stephen Boyd
Quoting Brendan Higgins (2019-08-12 11:24:06) > +void string_stream_clear(struct string_stream *stream) > +{ > + struct string_stream_fragment *frag_container, *frag_container_safe; > + > + spin_lock(>lock); > + list_for_each_entry_safe(frag_container, > +

[PATCH v12 03/18] kunit: test: add string_stream a std::stream like string builder

2019-08-12 Thread Brendan Higgins
A number of test features need to do pretty complicated string printing where it may not be possible to rely on a single preallocated string with parameters. So provide a library for constructing the string as you go similar to C++'s std::string. string_stream is really just a string builder,