All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brian Norris <briannorris@chromium.org>
To: Archit Taneja <architt@codeaurora.org>
Cc: hl@rock-chips.com, linux-rockchip@lists.infradead.org,
	David Airlie <airlied@linux.ie>,
	hoegsberg@gmail.com, Philippe Cornu <philippe.cornu@st.com>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	Yannick Fertre <yannick.fertre@st.com>,
	Nickey Yang <nickey.yang@rock-chips.com>,
	mka@chromium.org,
	Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
	zyw@rock-chips.com, xbl@rock-chips.com,
	Vincent Abriou <vincent.abriou@st.com>
Subject: Re: [PATCH v2 2/2] drm/bridge/synopsys: dsi: handle endianness correctly in dw_mipi_dsi_write()
Date: Tue, 16 Jan 2018 10:57:37 -0800	[thread overview]
Message-ID: <20180116185736.GA149565@google.com> (raw)
In-Reply-To: <e4d9d6d6-76c4-4914-d800-c007a6e8938b@codeaurora.org>

On Tue, Jan 16, 2018 at 12:22:52PM +0530, Archit Taneja wrote:
> On 01/10/2018 08:03 PM, Andrzej Hajda wrote:
> >On 09.01.2018 21:32, Brian Norris wrote:
> >>@@ -386,9 +386,9 @@ static int dw_mipi_dsi_write(struct dw_mipi_dsi *dsi,
> >>  		}
> >>  	}
> >>-	remainder = 0;
> >>-	memcpy(&remainder, packet->header, sizeof(packet->header));
> >>-	return dw_mipi_dsi_gen_pkt_hdr_write(dsi, remainder);
> >>+	word = 0;
> >>+	memcpy(&word, packet->header, sizeof(packet->header));
> >>+	return dw_mipi_dsi_gen_pkt_hdr_write(dsi, le32_to_cpu(word));
> >
> >You could create and use appropriate helper, lets say:
> >
> >u32 le_to_cpup(const u8 *p, int count)
> >{
> >     __le32 r = 0;
> >
> >     memcpy(&r, p, count);
> >     return le32_to_cpu(r);
> >}

I suppose that could be a small improvement, for future consideration,
if this gets too out of hand.

> >With or without this change:
> >Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>

Thanks!

> Queued to drm-misc-next as is.

Thanks!

Brian
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

WARNING: multiple messages have this Message-ID (diff)
From: Brian Norris <briannorris@chromium.org>
To: Archit Taneja <architt@codeaurora.org>
Cc: Andrzej Hajda <a.hajda@samsung.com>,
	Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
	David Airlie <airlied@linux.ie>,
	Yannick Fertre <yannick.fertre@st.com>,
	Philippe Cornu <philippe.cornu@st.com>,
	Vincent Abriou <vincent.abriou@st.com>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	Sean Paul <seanpaul@chromium.org>,
	Nickey Yang <nickey.yang@rock-chips.com>,
	hl@rock-chips.com, linux-rockchip@lists.infradead.org,
	mka@chromium.org, hoegsberg@gmail.com, zyw@rock-chips.com,
	xbl@rock-chips.com
Subject: Re: [PATCH v2 2/2] drm/bridge/synopsys: dsi: handle endianness correctly in dw_mipi_dsi_write()
Date: Tue, 16 Jan 2018 10:57:37 -0800	[thread overview]
Message-ID: <20180116185736.GA149565@google.com> (raw)
In-Reply-To: <e4d9d6d6-76c4-4914-d800-c007a6e8938b@codeaurora.org>

On Tue, Jan 16, 2018 at 12:22:52PM +0530, Archit Taneja wrote:
> On 01/10/2018 08:03 PM, Andrzej Hajda wrote:
> >On 09.01.2018 21:32, Brian Norris wrote:
> >>@@ -386,9 +386,9 @@ static int dw_mipi_dsi_write(struct dw_mipi_dsi *dsi,
> >>  		}
> >>  	}
> >>-	remainder = 0;
> >>-	memcpy(&remainder, packet->header, sizeof(packet->header));
> >>-	return dw_mipi_dsi_gen_pkt_hdr_write(dsi, remainder);
> >>+	word = 0;
> >>+	memcpy(&word, packet->header, sizeof(packet->header));
> >>+	return dw_mipi_dsi_gen_pkt_hdr_write(dsi, le32_to_cpu(word));
> >
> >You could create and use appropriate helper, lets say:
> >
> >u32 le_to_cpup(const u8 *p, int count)
> >{
> >     __le32 r = 0;
> >
> >     memcpy(&r, p, count);
> >     return le32_to_cpu(r);
> >}

I suppose that could be a small improvement, for future consideration,
if this gets too out of hand.

> >With or without this change:
> >Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>

Thanks!

> Queued to drm-misc-next as is.

Thanks!

Brian

  reply	other threads:[~2018-01-16 18:57 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-09 20:32 [PATCH v2 1/2] drm/bridge/synopsys: dsi: use common mipi_dsi_create_packet() Brian Norris
2018-01-09 20:32 ` Brian Norris
2018-01-09 20:32 ` [PATCH v2 2/2] drm/bridge/synopsys: dsi: handle endianness correctly in dw_mipi_dsi_write() Brian Norris
2018-01-09 20:32   ` Brian Norris
2018-01-10 14:33   ` Andrzej Hajda
2018-01-10 14:33     ` Andrzej Hajda
2018-01-16  6:52     ` Archit Taneja
2018-01-16  6:52       ` Archit Taneja
2018-01-16 18:57       ` Brian Norris [this message]
2018-01-16 18:57         ` Brian Norris
2018-01-11 13:51 ` [PATCH v2 1/2] drm/bridge/synopsys: dsi: use common mipi_dsi_create_packet() Philippe CORNU
2018-01-11 13:51   ` Philippe CORNU
     [not found]   ` <e9a46fa1-e934-169b-6fe3-1035a2823039-qxv4g6HH51o@public.gmane.org>
2018-01-12  7:10     ` Andrzej Hajda
2018-01-12  7:10       ` Andrzej Hajda
2018-01-16  6:56 ` Archit Taneja
2018-01-16  6:56   ` Archit Taneja
2018-01-16 19:04 ` Brian Norris

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=20180116185736.GA149565@google.com \
    --to=briannorris@chromium.org \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=airlied@linux.ie \
    --cc=architt@codeaurora.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hl@rock-chips.com \
    --cc=hoegsberg@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=mka@chromium.org \
    --cc=nickey.yang@rock-chips.com \
    --cc=philippe.cornu@st.com \
    --cc=vincent.abriou@st.com \
    --cc=xbl@rock-chips.com \
    --cc=yannick.fertre@st.com \
    --cc=zyw@rock-chips.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 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.