From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755225AbbICEkY (ORCPT ); Thu, 3 Sep 2015 00:40:24 -0400 Received: from mail-pa0-f49.google.com ([209.85.220.49]:36129 "EHLO mail-pa0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752397AbbICEkW (ORCPT ); Thu, 3 Sep 2015 00:40:22 -0400 Date: Thu, 3 Sep 2015 10:10:12 +0530 From: Sudip Mukherjee To: Dimitri Sivanich Cc: Arnd Bergmann , Greg Kroah-Hartman , linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/4] drivers/misc/sgi-gru: remove unused variable Message-ID: <20150903044012.GA3965@sudip-pc> References: <1441193098-13885-1-git-send-email-sudipm.mukherjee@gmail.com> <20150902144204.GA26958@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150902144204.GA26958@sgi.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > > --- > > > > + 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