From mboxrd@z Thu Jan 1 00:00:00 1970 From: SF Markus Elfring Date: Sun, 28 Aug 2016 07:28:04 +0000 Subject: Re: [PATCH 5/8] cris-cryptocop: Move an assignment for the variable "nooutpages" in cryptocop_ioctl_ Message-Id: <02c343e7-a7ac-26d1-4e79-ae50d3ec6dbb@users.sourceforge.net> List-Id: References: <566ABCD9.1060404@users.sourceforge.net> <2a70980b-54e3-812c-b76e-6b64640c469c@users.sourceforge.net> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Julia Lawall Cc: linux-cris-kernel@axis.com, Adam Buchbinder , Dave Hansen , Ingo Molnar , Jesper Nilsson , Jiri Kosina , Mikael Starvik , Thomas Gleixner , LKML , kernel-janitors@vger.kernel.org, Paolo Bonzini >> +++ b/arch/cris/arch-v32/drivers/cryptocop.c >> @@ -2469,7 +2469,7 @@ static int cryptocop_ioctl_process(struct inode *inode, struct file *filp, unsig >> struct page **inpages = NULL; >> struct page **outpages = NULL; >> int noinpages = 0; >> - int nooutpages = 0; >> + int nooutpages; >> >> struct cryptocop_desc descs[5]; /* Max 5 descriptors are needed, there are three transforms that >> * can get connected/disconnected on different places in the indata. */ >> @@ -2695,6 +2695,8 @@ static int cryptocop_ioctl_process(struct inode *inode, struct file *filp, unsig >> err = -ENOMEM; >> goto free_inpages; >> } >> + } else { >> + nooutpages = 0; > > Why is it better? 4 characters have becomes 2 lines. I suggest to express in a more precise way where this variable is needed actually. * It would also be an update candidate for the refactoring "Reduce the scope of a variable", wouldn't it? * Or would the refactoring "Split the implementation of a function into further functions" more appropriate here? Regards, Markus