On Tue, Jan 22, 2019 at 3:13 PM Elliott, Robert (Persistent Memory)
<[email protected]> wrote:
>
>
>
> > -----Original Message-----
> > From: Dan Williams [mailto:[email protected]]
> > Sent: Tuesday, January 22, 2019 4:24 PM
> > To: Elliott, Robert (Persistent Memory) <[email protected]>
> > Cc: linux-nvdimm <[email protected]>
> > Subject: Re: [PATCH] libnvdimm: normalize dev_debug failed and succeeded 
> > wording
> >
> > Looks ok, just some formatting nits...
> >
> > On Tue, Jan 22, 2019 at 2:14 PM Robert Elliott <[email protected]> wrote:
> > >
> > >         if (rc < 0) {
> > >                 nvdimm_put_key(key);
> > >                 key = NULL;
> > > -       }
> > > +               dev_dbg(dev, "key: %d revalidation failed: %d\n",
> > > +                       key_serial(key), rc);
> > > +       } else
> > > +               dev_dbg(dev, "key: %d revalidation succeeded\n",
> > > +                       key_serial(key));
> >
> > For all of these success vs fail cases I would prefer to continue to
> > use a ternary:
> >
> >     dev_dbg(dev, "key: %d revalidation %s: %d\n",
> >         key_serial(key), rc == 0 ? "succeeded" : "failed", rc);
> >
> > ...as to not clutter the code with extra debug statements.
>
> That'll result in printing the return code for successful cases:
>     ...succeeded: 0
>
> I guess that's fine for the dev_dbg level.

Yeah, I'm ok with that price for slightly more compact code.
_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm

Reply via email to