Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Feb 2018 11:04:57 -0700
From:      Ian Lepore <ian@freebsd.org>
To:        Alan Somers <asomers@FreeBSD.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r329830 - head/sbin/nvmecontrol
Message-ID:  <1519322697.91697.138.camel@freebsd.org>
In-Reply-To: <201802221747.w1MHlGJS032223@repo.freebsd.org>
References:  <201802221747.w1MHlGJS032223@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 2018-02-22 at 17:47 +0000, Alan Somers wrote:
> Author: asomers
> Date: Thu Feb 22 17:47:16 2018
> New Revision: 329830
> URL: https://svnweb.freebsd.org/changeset/base/329830
> 
> Log:
>   nvmecontrol: fix build on amd64/clang
>   
>   Broken by:	329824
>   Sponsored by:	Spectra Logic Corp
> 
> Modified:
>   head/sbin/nvmecontrol/identify.c
> 
> Modified: head/sbin/nvmecontrol/identify.c
> ==============================================================================
> --- head/sbin/nvmecontrol/identify.c	Thu Feb 22 17:09:26 2018	(r329829)
> +++ head/sbin/nvmecontrol/identify.c	Thu Feb 22 17:47:16 2018	(r329830)
> @@ -112,7 +112,7 @@ print_controller(struct nvme_controller_data *cdata)
>  	if (cdata->mdts == 0)
>  		printf("Unlimited\n");
>  	else
> -		printf("%ld\n", PAGE_SIZE * (1 << cdata->mdts));
> +		printf("%d\n", PAGE_SIZE * (1 << cdata->mdts));
>  	printf("Controller ID:              0x%02x\n", cdata->ctrlr_id);
>  	printf("\n");

If cdata->mdts > 19 that'll overflow 32 bits.  I'm not sure if that can
happen in the real world or not.  If so, maybe it'd be better to do

  printf("%ju\n", PAGE_SIZE * ((uintmax_t)1 << cdata->mdts));

-- Ian



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1519322697.91697.138.camel>