From owner-svn-src-all@freebsd.org Sun Apr 1 18:53:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F8E0F7476E; Sun, 1 Apr 2018 18:53:28 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E988378E63; Sun, 1 Apr 2018 18:53:27 +0000 (UTC) (envelope-from ian@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E46DD2CCC; Sun, 1 Apr 2018 18:53:27 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w31IrR9D003324; Sun, 1 Apr 2018 18:53:27 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w31IrR5X003323; Sun, 1 Apr 2018 18:53:27 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201804011853.w31IrR5X003323@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 1 Apr 2018 18:53:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331869 - head/sys/dev/nxge X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/nxge X-SVN-Commit-Revision: 331869 X-SVN-Commit-Repository: base 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.25 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, 01 Apr 2018 18:53:28 -0000 Author: ian Date: Sun Apr 1 18:53:27 2018 New Revision: 331869 URL: https://svnweb.freebsd.org/changeset/base/331869 Log: Fix the build on arches with default unsigned char. Capture the fubyte() return value in an int as well as the char, and test the full int value for fubyte() failure. Modified: head/sys/dev/nxge/if_nxge.c Modified: head/sys/dev/nxge/if_nxge.c ============================================================================== --- head/sys/dev/nxge/if_nxge.c Sun Apr 1 18:22:24 2018 (r331868) +++ head/sys/dev/nxge/if_nxge.c Sun Apr 1 18:53:27 2018 (r331869) @@ -1366,12 +1366,13 @@ xge_ioctl_stats(xge_lldev_t *lldev, struct ifreq *ifre xge_hal_status_e status = XGE_HAL_OK; char cmd, mode; void *info = NULL; - int retValue = EINVAL; + int retValue; - cmd = fubyte(ifr_data_get_ptr(ifreqp)); - if (cmd == -1) + cmd = retValue = fubyte(ifr_data_get_ptr(ifreqp)); + if (retValue == -1) return (EFAULT); + retValue = EINVAL; switch(cmd) { case XGE_QUERY_STATS: mtx_lock(&lldev->mtx_drv);