Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932393AbcC2Ojq (ORCPT ); Tue, 29 Mar 2016 10:39:46 -0400 Received: from webbox1416.server-home.net ([77.236.96.61]:49817 "EHLO webbox1416.server-home.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932375AbcC2Ojo (ORCPT ); Tue, 29 Mar 2016 10:39:44 -0400 From: Alexander Stein To: linux-kernel@vger.kernel.org Cc: Yong Li , linux-gpio@vger.kernel.org, Phil Reid Subject: Re: [PATCH] gpio: pca953x: Use correct u16 value for register word write Date: Tue, 29 Mar 2016 16:39:38 +0200 Message-ID: <1680089.6CCf2RWg8O@ws-stein> User-Agent: KMail/4.14.10 (Linux/4.1.15-gentoo-r1; KDE/4.14.16; x86_64; ; ) In-Reply-To: References: <1459232852-15697-1-git-send-email-sdliyong@gmail.com> <56FA6FB6.4040003@electromag.com.au> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 499 Lines: 13 You missed CC'ing Phil (Added for this post) On Tuesday 29 March 2016 20:53:58, Yong Li wrote: > Thanks for your comment, I think I can change it to val[0] | (val[1] > << 8), is it okay ? Mh, currently there is only one caller (device_pca953x_init) which passes only 0, 0 or 0xff, 0xff, so endianess is irrelevant. But to be future proof this should be done in an endian-safe manner. Though cpu_to_le16p does not work, due to same alignment problem as casting to u16*. Best regards, Alexander