From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751700AbeAPS5n (ORCPT + 1 other); Tue, 16 Jan 2018 13:57:43 -0500 Received: from mail-pl0-f68.google.com ([209.85.160.68]:40937 "EHLO mail-pl0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751060AbeAPS5l (ORCPT ); Tue, 16 Jan 2018 13:57:41 -0500 X-Google-Smtp-Source: ACJfBovkMNYO6LjcvrxFSrnUrkrY0slAaD5t7gm1asbYCztfrSwhybFUznRvsYDoF61eVC0fyBXDbw== Date: Tue, 16 Jan 2018 10:57:37 -0800 From: Brian Norris To: Archit Taneja Cc: Andrzej Hajda , Laurent Pinchart , David Airlie , Yannick Fertre , Philippe Cornu , Vincent Abriou , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Sean Paul , Nickey Yang , 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() Message-ID: <20180116185736.GA149565@google.com> References: <20180109203248.139249-1-briannorris@chromium.org> <20180109203248.139249-2-briannorris@chromium.org> <199f9097-736e-afe8-2093-bb28fba8b308@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: 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 Thanks! > Queued to drm-misc-next as is. Thanks! Brian