From owner-svn-src-all@freebsd.org Thu Sep 5 17:20:49 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 77E34EDEE9; Thu, 5 Sep 2019 17:20:49 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46PSBn2dxcz47f0; Thu, 5 Sep 2019 17:20:49 +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 3BB64783F; Thu, 5 Sep 2019 17:20:49 +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 x85HKnE9013183; Thu, 5 Sep 2019 17:20:49 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x85HKnId013182; Thu, 5 Sep 2019 17:20:49 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201909051720.x85HKnId013182@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 5 Sep 2019 17:20:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r351877 - stable/12/sys/fs/nandfs X-SVN-Group: stable-12 X-SVN-Commit-Author: ian X-SVN-Commit-Paths: stable/12/sys/fs/nandfs X-SVN-Commit-Revision: 351877 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.29 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: Thu, 05 Sep 2019 17:20:49 -0000 Author: ian Date: Thu Sep 5 17:20:48 2019 New Revision: 351877 URL: https://svnweb.freebsd.org/changeset/base/351877 Log: Fix LINT kernel builds on powerpc64 and sparc64. This is a direct commit to 12-stable because the nandfs code no longer exists in 13-current. The build was failing with nandfs_dat.c:301: warning: comparison is always false due to limited range of data type I tried to fix it with an inline (size_t) cast of nargv->nv_nmembs in the if() expression, but that didn't help (which seems a bit buggy), but using an intermediate variable fixed it. Elegance doesn't matter as much as suppressing the warning; this code is long-dead even on this branch. Modified: stable/12/sys/fs/nandfs/nandfs_dat.c Modified: stable/12/sys/fs/nandfs/nandfs_dat.c ============================================================================== --- stable/12/sys/fs/nandfs/nandfs_dat.c Thu Sep 5 17:20:24 2019 (r351876) +++ stable/12/sys/fs/nandfs/nandfs_dat.c Thu Sep 5 17:20:48 2019 (r351877) @@ -295,10 +295,11 @@ nandfs_get_dat_bdescs_ioctl(struct nandfs_device *nffs struct nandfs_argv *nargv) { struct nandfs_bdesc *bd; - size_t size; + size_t size, sizecheck; int error; - if (nargv->nv_nmembs >= SIZE_MAX / sizeof(struct nandfs_bdesc)) + sizecheck = nargv->nv_nmembs; + if (sizecheck >= SIZE_MAX / sizeof(struct nandfs_bdesc)) return (EINVAL); size = nargv->nv_nmembs * sizeof(struct nandfs_bdesc);