From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932375AbcH1H2n (ORCPT ); Sun, 28 Aug 2016 03:28:43 -0400 Received: from mout.web.de ([212.227.17.12]:61937 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932323AbcH1H2l (ORCPT ); Sun, 28 Aug 2016 03:28:41 -0400 Subject: Re: [PATCH 5/8] cris-cryptocop: Move an assignment for the variable "nooutpages" in cryptocop_ioctl_process() To: Julia Lawall References: <566ABCD9.1060404@users.sourceforge.net> <2a70980b-54e3-812c-b76e-6b64640c469c@users.sourceforge.net> 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 From: SF Markus Elfring Message-ID: <02c343e7-a7ac-26d1-4e79-ae50d3ec6dbb@users.sourceforge.net> Date: Sun, 28 Aug 2016 09:28:04 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:3r5BKC/CSlIHh54vmtnuCh90mf25dTbSKrSZwFUxBmutUa1WFhw bst5LkpbqaG6Q9YG14K2TcYsDFoYji9i29Pvq15VKKQMgRGPsTki114n+l3aE7vXYCnMXgj t2U8T5oUSCoGVTqIos5K5Yekq6NoOTiPNZEtwvzYTPgyHihpl/Sm+0KkcdKBxRAvT8GkJVa lEjpeHFafzm8G0jRsemhg== X-UI-Out-Filterresults: notjunk:1;V01:K0:TofTw5EcmU8=:fINpj183qG14+H7XURDP2C QND9uhWL2dOJxpU/mkinxyC+5+PaXa2DTx9F2lmFRcbYWGl4Ko79TvQW6hovG3cAuzNk/U28B Xntv+0wxK6fiWAB+d4UDkSvU/RsWvHFnnbFd0fXir874EBktvqgnwUo2jsmAz/YFKCHoPaqH6 GuqHpxSpb+5T3TjNHP/g+Ovn7JVJYwOaCBiYxDGqjQuyJyZKjx4ZYGbSZmts2TS5NCI7mJnPc AMzWxrYeVlaC744mlSnNs018YOReAYsQ+xE31q9cNkE5YhnFpYkhrdnrQ1bWPfin4UEC59F/w rp3LDa7EUUzqiry6yisbywkzC2iXz3h9fo2naeY9/eI1JZC0kbyTwojIUrwNq7FAev0BmUwZ5 uWgQ1OHDSp5j9CHgGfX6wCrlQlUa7vIGlUvToscYUkE7+eLqYcR+9yRcL3r/RBLFJx1SSNrq8 EgDXg62JPL2W2bk1U75tCe+6WGACdh+8yqsduGHhj0voY51Ks3XzCVh0JaE4mbgZNlij2eHQM 2Qugim5gADOKzbVnJZFGrUOTNCIJ41wJjDGMyE7JtCzJssOT6Sj99s5vAm9iwuEzjIG9U/S76 pz/djkQo78ic08a9moejiwSxiRVMz3zBPsh6PVWeahZutpHIQhkHIU7auFwfybTh+GyXe9m9A Q5iFNUSWYzEIAH9Ak39BKqqiIAOdeaBXFZI0zpu3JgoXqXD6sbfosFUT8j8931QgQthVpec1H GeRUSGPzWc7vYcgjuvuYgRLJLf8mfJSnufwV+rAKEF7K97sbPUl8gWNCOxOYRAex0+524TRf8 W9DcUVn Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >> +++ 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