Re: [PATCH 61/7] x86/pci: add cap_4g

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/11/2009 06:11 PM, Yinghai Lu wrote:
>  
> +static inline u64 cap_4g(u64 val)
> +{
> +	if (sizeof(resource_size_t) >= sizeof(u64))
> +		return val;
> +
> +	if (val < 1ULL)
> +		return val;
> +
> +	return 0xffffffff;
> +}
>  #endif

How about:

static inline resource_size_t cap_resource(u64 val)
{
	if (val > ~(resource_size_t)0)
		return ~(resource_size_t)0;
	else
		return val;
}


-- 
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.

--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux