All of lore.kernel.org
 help / color / mirror / Atom feed
From: Amit Barzilai <amit.barzilai22@gmail.com>
To: Andy Shevchenko <andriy.shevchenko@intel.com>
Cc: Javier Martinez Canillas <javierm@redhat.com>,
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 6/6] drm/ssd130x: Add SSD135X_FAMILY and SSD1351 support
Date: Tue, 18 Aug 2026 23:13:29 +0300	[thread overview]
Message-ID: <20260818201331.39232-1-amit.barzilai22@gmail.com> (raw)
In-Reply-To: <aoQd7qsojnphARpH@ashevche-desk.local>

On Tue, Aug 18, 2026 at 11:55 AM Andy Shevchenko
<andriy.shevchenko@intel.com> wrote:
>
> > +static int ssd135x_init(struct ssd130x_device *ssd130x)
> > +{
> > +     u8 remap = SSD135X_SET_REMAP_65K | SSD135X_SET_REMAP_COM_SPLIT |
> > +                SSD135X_SET_REMAP_COLOR_BGR | SSD135X_SET_REMAP_COM_SCAN;
>
> Same comment about const.

Will do, same as in 2/6.

> > +     int ret;
>
> Why not placing it after cmds?

No particular reason. Moved below cmds[] in v5.

> > +static void ssd135x_clear_screen(struct ssd130x_device *ssd130x, u8 *data_array)
> > +{
> > +     const struct drm_format_info *fi = drm_format_info(DRM_FORMAT_RGB565);
> > +     unsigned int pitch;
>
> > +     if (!fi)
> > +             return;
>
> It's less maintainable than
>
>         const struct drm_format_info *fi;
>         unsigned int pitch;
>
>         fi = drm_format_info(DRM_FORMAT_RGB565);
>         if (!fi)
>                 return;
> ...
> > +static int ssd135x_fb_blit_rect(struct drm_framebuffer *fb,
> > +                             const struct iosys_map *vmap,
> > +                             struct drm_rect *rect, u8 *data_array,
> > +                             struct drm_format_conv_state *fmtcnv_state)
> > +{
> > +     struct ssd130x_device *ssd130x = drm_to_ssd130x(fb->dev);
> > +     const struct drm_format_info *fi = drm_format_info(DRM_FORMAT_RGB565);
> > +     unsigned int dst_pitch;
> > +     struct iosys_map dst;
> > +
> > +     if (!fi)
> > +             return -EINVAL;
>
> Ditto. The problem is that the current style is tempting for subtle mistakes
> such as defining more variables that may use fi in between.

Noted, I'll move the fi assignment just before the guard in both functions.

> > +static void ssd135x_primary_plane_atomic_disable(struct drm_plane *plane,
> > +                                              struct drm_atomic_commit *state)
> > +{
> > +     struct drm_device *drm = plane->dev;
> > +     struct ssd130x_device *ssd130x = drm_to_ssd130x(drm);
> > +     struct drm_plane_state *plane_state = drm_atomic_get_new_plane_state(state, plane);
> > +     struct drm_crtc_state *crtc_state;
> > +     struct ssd130x_crtc_state *ssd130x_crtc_state;
> > +     int idx;
> > +
> > +     if (!plane_state->crtc)
> > +             return;
>
> In the similar way here.

I'll move plane_state to just before this guard as well.

-- 
Thanks,
Amit

      reply	other threads:[~2026-08-18 20:13 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-18  8:06 [PATCH v4 0/6] drm/ssd130x: Add support for the Solomon SSD1351 OLED controller Amit Barzilai
2026-08-18  8:06 ` [PATCH v4 1/6] dt-bindings: display: Add " Amit Barzilai
2026-08-18  8:06 ` [PATCH v4 2/6] drm/ssd130x: Change SSD133X color format to RGB565 from RGB332 Amit Barzilai
2026-08-18  8:18   ` sashiko-bot
2026-08-18  8:36   ` Andy Shevchenko
2026-08-18 18:58     ` Amit Barzilai
2026-08-18  8:06 ` [PATCH v4 3/6] drm/ssd130x: Constify ssd130x_write_data() 'values' parameter Amit Barzilai
2026-08-18  8:37   ` Andy Shevchenko
2026-08-18  8:06 ` [PATCH v4 4/6] drm/ssd130x: Replace positional ssd130x_spi_id[] initialization with C99 Amit Barzilai
2026-08-18  8:40   ` Andy Shevchenko
2026-08-18 19:25     ` Amit Barzilai
2026-08-20  9:06       ` Amit Barzilai
2026-08-20 13:24         ` Javier Martinez Canillas
2026-08-18  8:06 ` [PATCH v4 5/6] drm/ssd130x: Implement ssd130x_write_cmd() on top of ssd130x_write_cmds() Amit Barzilai
2026-08-18  8:43   ` Andy Shevchenko
2026-08-18 19:34     ` Amit Barzilai
2026-08-18  8:06 ` [PATCH v4 6/6] drm/ssd130x: Add SSD135X_FAMILY and SSD1351 support Amit Barzilai
2026-08-18  8:24   ` sashiko-bot
2026-08-18  8:55   ` Andy Shevchenko
2026-08-18 20:13     ` Amit Barzilai [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=20260818201331.39232-1-amit.barzilai22@gmail.com \
    --to=amit.barzilai22@gmail.com \
    --cc=airlied@gmail.com \
    --cc=andriy.shevchenko@intel.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=javierm@redhat.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=robh@kernel.org \
    --cc=simona@ffwll.ch \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.