Re: unused 'size' assignment in filemap_nopage

From: Jan Engelhardt
Date: Wed Mar 23 2005 - 01:56:25 EST


> size = (i_size_read(inode) + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
> if (pgoff >= size)
> goto outside_data_content;
> ...
> if (size > endoff)
> size = endoff;
>
>After this, size is not referenced. So, either this potential reassignment
>of size is superfluous, or we are missing some other code later on in the
>function. If it is the former, I've attached a patch which will remove the
>code.

Only if you can make sure the SIZE will never be bigger than ENDOFF.
What you see here is basically:
size = min(endoff, (i_size_read...))
With a pgoff>=size somewhere ;)


Jan Engelhardt
--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/