Re: [PATCH 01/31] gpu: nova-core: print FB sizes, along with ranges

From: Timur Tabi

Date: Wed Dec 03 2025 - 14:35:48 EST


On Tue, 2025-12-02 at 21:58 -0800, John Hubbard wrote:
> +impl fmt::Debug for FbRange {
> +    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
> +        let size_mb = (self.0.end - self.0.start) >> 20;
> +        f.write_fmt(fmt!(
> +            "{:#x}..{:#x} ({} MB)",
> +            self.0.start,
> +            self.0.end,
> +            size_mb
> +        ))
> +    }
> +}
> +

How about printing size_kb if size_mb == 0 or if it's not an even multiple of MB?

Also, why not just add this function to Range<> instead of creating a new type?