Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1218244

Re: [PATCH 1/4] drivers/misc/sgi-gru: remove unused variable

From Dimitri Sivanich <sivanich@sgi.com>
Newsgroups linux.kernel
Subject Re: [PATCH 1/4] drivers/misc/sgi-gru: remove unused variable
Date 2015-09-03 15:20 +0200
Message-ID <q4CAN-4CZ-1@gated-at.bofh.it> (permalink)
References <q4eoN-3Cm-1@gated-at.bofh.it> <q4hwn-81p-41@gated-at.bofh.it> <q4uDf-1wY-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Sep 03, 2015 at 10:10:12AM +0530, Sudip Mukherjee wrote:
> 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?
>
The likely intent was to return an error when the buffer isn't big enough
to hold GRU_NUM_TFM * GRU_CACHE_LINE_BYTES.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 1/4] drivers/misc/sgi-gru: remove unused variable Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2015-09-02 13:30 +0200
  [PATCH 2/4] drivers/misc/sgi-gru: make functions static Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2015-09-02 13:30 +0200
    Re: [PATCH 2/4] drivers/misc/sgi-gru: make functions static Dimitri Sivanich <sivanich@sgi.com> - 2015-09-02 16:50 +0200
  [PATCH 3/4] drivers/misc/sgi-gru: remove always false condition Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2015-09-02 13:30 +0200
    Re: [PATCH 3/4] drivers/misc/sgi-gru: remove always false condition Dimitri Sivanich <sivanich@sgi.com> - 2015-09-02 16:50 +0200
  [PATCH 4/4] drivers/misc/sgi-gru: fix dereference of ERR_PTR Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2015-09-02 13:30 +0200
    Re: [PATCH 4/4] drivers/misc/sgi-gru: fix dereference of ERR_PTR Dimitri Sivanich <sivanich@sgi.com> - 2015-09-02 17:20 +0200
  Re: [PATCH 1/4] drivers/misc/sgi-gru: remove unused variable Dimitri Sivanich <sivanich@sgi.com> - 2015-09-02 16:50 +0200
    Re: [PATCH 1/4] drivers/misc/sgi-gru: remove unused variable Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2015-09-03 06:50 +0200
      Re: [PATCH 1/4] drivers/misc/sgi-gru: remove unused variable Dimitri Sivanich <sivanich@sgi.com> - 2015-09-03 15:20 +0200

csiph-web