linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
To: Emil Velikov <emil.l.velikov@gmail.com>
Cc: ML dri-devel <dri-devel@lists.freedesktop.org>,
	devicetree <devicetree@vger.kernel.org>,
	"Linux-Kernel@Vger. Kernel. Org" <linux-kernel@vger.kernel.org>,
	David Airlie <airlied@linux.ie>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	Rob Herring <robh+dt@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>
Subject: Re: [PATCH v6 2/3] drm: Add support for the LogiCVC display controller
Date: Thu, 7 May 2020 22:11:03 +0200	[thread overview]
Message-ID: <20200507201103.GH2422122@aptenodytes> (raw)
In-Reply-To: <CACvgo51mRse3su4exyTqXYJRPPc0VqaX9+tRyKUuBPtm5Q+6XQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2113 bytes --]

Hi Emil,

Thanks for the review!

On Mon 04 May 20, 14:28, Emil Velikov wrote:
> Just had a casual quick look for custom KMS properties, since new
> drivers made that mistake in the past.
> Thanks for not including any o/

Yeah I made sure not to include any, I know it easily gets very problematic and
creates disparity between drivers while needing to be kept alive even when a
standard way arises due to the no API breakage policy.

The not-for-merge patch that I've sent does introduce some for the colorkey,
and that's why they are marked as such :)

> I made a couple of trivial suggestions - if you agree, feel free to
> keep them as follow-up patches.
> 
> On Thu, 30 Apr 2020 at 20:28, Paul Kocialkowski
> <paul.kocialkowski@bootlin.com> wrote:
> 
> > +int logicvc_of_property_parse_u32(struct device_node *of_node,
> > +                                 const char *name, u32 *target)
> > +{
> > +       struct logicvc_of_property *property;
> > +       const char *string;
> > +       u32 value;
> > +       int ret;
> > +
> > +       property = logicvc_of_property_lookup(name);
> > +       if (!property)
> > +               return -EINVAL;
> > +
> One could have the logicvc_of_properties[] entries indexed with the
> logicvc_of_property_parse_{u32,bool} caller, using that instead of the
> name string.

Do I understand correctly that you're suggesting passing each entry's
struct logicvc_of_property pointer to the function?

I went for strings to make the code explicit and easy to read so I'd really
like to keep it that way and avoid passing things like
&logicvc_of_properties[4] or an index integer.

> Aside: I suspect the array (as most other arrays in this patch) should
> be annotated const, correct?

Ah yes that's a good point, thanks!

> 
> > +       if (property->range[0] || property->range[1])
> > +               if (value < property->range[0] || value > property->range[1])
> Combine the two ifs?

Definitely :)

Cheers,

Paul

-- 
Paul Kocialkowski, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2020-05-07 20:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-30 19:27 [PATCH v6 0/3] drm: LogiCVC display controller support Paul Kocialkowski
2020-04-30 19:27 ` [PATCH v6 1/3] dt-bindings: display: Document the Xylon LogiCVC display controller Paul Kocialkowski
2020-04-30 19:27 ` [PATCH v6 2/3] drm: Add support for the " Paul Kocialkowski
2020-05-04 13:28   ` Emil Velikov
2020-05-07 20:11     ` Paul Kocialkowski [this message]
2020-05-08 10:32       ` Emil Velikov
2020-04-30 19:27 ` [PATCH v6 3/3] NOTFORMERGE: drm/logicvc: Add plane colorkey support Paul Kocialkowski

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=20200507201103.GH2422122@aptenodytes \
    --to=paul.kocialkowski@bootlin.com \
    --cc=airlied@linux.ie \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=emil.l.velikov@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=tzimmermann@suse.de \
    /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).