Am 24.02.2012 01:36, schrieb David Gibson:
> Currently get_image_size(), used to find the size of files, returns an int.> But for modern systems, int may be only 32-bit and we can have files> larger than that.> > This patch, therefore, changes the return type of get_image_size() to off_t> (the same as the return type from lseek() itself). It also audits all the> callers of get_image_size() to make sure they process the new unsigned> return type correctly.
It's a size, so why off_t and not size_t?
Andreas
> > This leaves load_image_targphys() with a limited return type, but one thing> at a time (that function has far more callers to be audited, so it will> take longer to fix).> > Signed-off-by: David Gibson <david@gibson.dropbear.id.au>

On Fri, Feb 24, 2012 at 10:15:51AM +0100, Andreas Färber wrote:
> Am 24.02.2012 01:36, schrieb David Gibson:> > Currently get_image_size(), used to find the size of files, returns an int.> > But for modern systems, int may be only 32-bit and we can have files> > larger than that.> > > > This patch, therefore, changes the return type of get_image_size() to off_t> > (the same as the return type from lseek() itself). It also audits all the> > callers of get_image_size() to make sure they process the new unsigned> > return type correctly.> > It's a size, so why off_t and not size_t?
Because it's a file size, rather than an in-memory size. Or more
specifically, off_t is the return type of lseek() which is where the
information is coming from in the first place.