Re: [PATCH v2 3/5] kdb: Remove special case logic from kdb_read()
From: Daniel Thompson
Date: Thu Oct 10 2019 - 05:50:15 EST
On Wed, Oct 09, 2019 at 10:28:36AM -0700, Doug Anderson wrote:
> On Wed, Oct 9, 2019 at 2:30 AM Daniel Thompson
> <daniel.thompson@xxxxxxxxxx> wrote:
> > > > @@ -741,7 +732,7 @@ int vkdb_printf(enum kdb_msgsrc src, const char *fmt, va_list ap)
> > > >
> > > > /* check for having reached the LINES number of printed lines */
> > > > if (kdb_nextline >= linecount) {
> > > > - char buf1[16] = "";
> > > > + char ch;
> > >
> > > The type of "ch" should be the same as returned by kdb_getchar()?
> > > Either "int" if you're keeping it "int" or "unsigned char"?
> >
> > Probably... although the assumption that kdb strings are char * is burnt
> > in a lot of places so there will still be further tidy up needed.
>
> True. It doesn't matter a whole lot so if you think it's easier to
> keep it as char that's OK too.
After looking at it from a number of angles I think we can have this
match the return type of kdb_getchar()... but the best way to achieve
this is to make kdb_getchar() return a unqualified char.
That ends up consistent across the sub-system and shouldn't do any
narrowing that wouldn't already have been happening inside kdb_read().
Daniel.