dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Doug Anderson <dianders@chromium.org>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: "Paul Cercueil" <paul@crapouillou.net>,
	"Thierry Reding" <thierry.reding@gmail.com>,
	"Sam Ravnborg" <sam@ravnborg.org>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	"Noralf Trønnes" <noralf@tronnes.org>
Subject: Re: [PATCH v5] drm/panel: db7430: Add driver for Samsung DB7430
Date: Thu, 10 Jun 2021 16:05:05 -0700	[thread overview]
Message-ID: <CAD=FV=U1MK+tC9mDPjsQgHKiMotWYq_GQV7PxJHSSQ4MRgCAwg@mail.gmail.com> (raw)
In-Reply-To: <CACRpkdbNVB+k80a-iG53mhZ+DmZ2FokFiTG48QgGG-r89LmEyA@mail.gmail.com>

Hi,

On Thu, Jun 10, 2021 at 4:01 PM Linus Walleij <linus.walleij@linaro.org> wrote:
>
> On Fri, Jun 11, 2021 at 12:42 AM Doug Anderson <dianders@chromium.org> wrote:
> > On Thu, Jun 10, 2021 at 3:39 PM Linus Walleij <linus.walleij@linaro.org> wrote:
>
>
> > > #define mipi_dbi_command(dbi, cmd, seq...) \
> > > ({ \
> > >         const u8 d[] = { seq }; \
> > >         mipi_dbi_command_stackbuf(dbi, cmd, d, ARRAY_SIZE(d)); \
> > > })
> > >
> > > I'll fix up the include and apply then we can think about
> > > what to do with mipi_dbi_command().
> >
> > Are you sure that doesn't work? Isn't the return value of a macro the
> > last expression? In this case the return value of
> > mipi_dbi_command_stackbuf() should just flow through.
>
> w00t I didn't know that.
>
> And I like to think of the macro processor as essentially just
> inserting the content of the macro at the cursor.
>
> But arguably it *should* rather be fixed in this macro though?
> It is used in the same way in all other drivers as well.

You want the mipi_dbi_command() to do the error checking and print the
message? Two downsides:

1. What if someone didn't _want_ the message printed? They might want
to try to handle things more elegantly, like maybe fail the function?

2. Currently the mipi_dbi_command() macro doesn't have access to a
"dev" pointer so it wouldn't be able to print as nice of an error as
you can.

That being said, I wouldn't object to introducing a macro next to
mipi_dbi_command() that also takes a dev pointer, prints an error, and
doesn't return a value.

-Doug

      reply	other threads:[~2021-06-10 23:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-10 22:05 [PATCH v5] drm/panel: db7430: Add driver for Samsung DB7430 Linus Walleij
2021-06-10 22:30 ` Doug Anderson
2021-06-10 22:38   ` Linus Walleij
2021-06-10 22:42     ` Doug Anderson
2021-06-10 23:00       ` Linus Walleij
2021-06-10 23:05         ` Doug Anderson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAD=FV=U1MK+tC9mDPjsQgHKiMotWYq_GQV7PxJHSSQ4MRgCAwg@mail.gmail.com' \
    --to=dianders@chromium.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linus.walleij@linaro.org \
    --cc=noralf@tronnes.org \
    --cc=paul@crapouillou.net \
    --cc=sam@ravnborg.org \
    --cc=thierry.reding@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).