lkml.org 
[lkml]   [2015]   [Sep]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/4] drivers/misc/sgi-gru: remove unused variable
On Wed, Sep 02, 2015 at 09:42:04AM -0500, Dimitri Sivanich wrote:
> On Wed, Sep 02, 2015 at 04:54:55PM +0530, Sudip Mukherjee wrote:
> > These variables were only assigned some value and were never used.
> >
> > Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
> > ---
> >
<snip>
> > + int i;
> +
> + if ((GRU_NUM_TFM * GRU_CACHE_LINE_BYTES) > (ubufend - ubuf))
> + return -EFBIG;
Just a minor (or major) doubt.
The function returns GRU_NUM_TFM * GRU_CACHE_LINE_BYTES and the for loop
is also running till GRU_NUM_TFM so I am assuming that the function can
handle buffer till size of GRU_NUM_TFM * GRU_CACHE_LINE_BYTES. So the
error -EFBIG should occur when the buffer is more than this. Then
shouldn't it be:
if ((GRU_NUM_TFM * GRU_CACHE_LINE_BYTES) < (ubufend - ubuf))
return -EFBIG;

or i am wrong in interpreting it?

regards
sudip


\
 
 \ /
  Last update: 2015-09-03 07:21    [W:0.070 / U:1.028 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site