From owner-svn-src-all@freebsd.org Fri Jun 26 18:03:20 2015 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 9E41998CA07; Fri, 26 Jun 2015 18:03:20 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 8EEBF169E; Fri, 26 Jun 2015 18:03:20 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5QI3KWe078937; Fri, 26 Jun 2015 18:03:20 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5QI3K1o078936; Fri, 26 Jun 2015 18:03:20 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201506261803.t5QI3K1o078936@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 26 Jun 2015 18:03:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284878 - head/sys/boot/i386/boot2 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.20 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: Fri, 26 Jun 2015 18:03:20 -0000 Author: delphij Date: Fri Jun 26 18:03:19 2015 New Revision: 284878 URL: https://svnweb.freebsd.org/changeset/base/284878 Log: Reduce warnings: - Add prototype for boot2 main() - Don't make assignment within if statement, split it into two. No functional or binary change -- verified with sha256(1). MFC after: 2 weeks Modified: head/sys/boot/i386/boot2/boot2.c Modified: head/sys/boot/i386/boot2/boot2.c ============================================================================== --- head/sys/boot/i386/boot2/boot2.c Fri Jun 26 18:00:29 2015 (r284877) +++ head/sys/boot/i386/boot2/boot2.c Fri Jun 26 18:03:19 2015 (r284878) @@ -150,6 +150,7 @@ static int comspeed = SIOSPD; static uint8_t ioctrl = IO_KEYBOARD; #endif +int main(void); void exit(int); static void load(void); static int parse(void); @@ -481,7 +482,8 @@ parse() ? DRV_HARD : 0) + drv; dsk_meta = 0; } - if (k = ep - arg) { + k = ep - arg; + if (k > 0) { if (k >= sizeof(knamebuf)) return -1; memcpy(knamebuf, arg, k + 1);