From owner-svn-src-all@freebsd.org Sun Apr 10 23:17:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B8C3B0A4AC; Sun, 10 Apr 2016 23:17:07 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1DF151A14; Sun, 10 Apr 2016 23:17:07 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3ANH6PG094375; Sun, 10 Apr 2016 23:17:06 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3ANH6Gg094374; Sun, 10 Apr 2016 23:17:06 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201604102317.u3ANH6Gg094374@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sun, 10 Apr 2016 23:17:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297794 - head/sys/dev/gpio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Apr 2016 23:17:07 -0000 Author: gonzo Date: Sun Apr 10 23:17:06 2016 New Revision: 297794 URL: https://svnweb.freebsd.org/changeset/base/297794 Log: Fix IIC "how" argument dereferencing on big-endian platforms "how" argument is passed as value of int* pointer to callback function but dereferenced as char* so only one byte taken into into account. On little-endian systems it happens to work because first byte is LSB that contains actual value, on big-endian it's MSB and in this case it's always equal zero PR: 207786 Submitted by: chadf@triularity.org Modified: head/sys/dev/gpio/gpioiic.c Modified: head/sys/dev/gpio/gpioiic.c ============================================================================== --- head/sys/dev/gpio/gpioiic.c Sun Apr 10 23:07:00 2016 (r297793) +++ head/sys/dev/gpio/gpioiic.c Sun Apr 10 23:17:06 2016 (r297794) @@ -157,7 +157,7 @@ gpioiic_callback(device_t dev, int index int error, how; how = GPIOBUS_DONTWAIT; - if (data != NULL && (int)*data == IIC_WAIT) + if (data != NULL && *(int*)data == IIC_WAIT) how = GPIOBUS_WAIT; error = 0; switch (index) {