Re: [PATCH 5/8] cris-cryptocop: Move an assignment for the variable "nooutpages" in cryptocop_ioctl_process()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>> +++ 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
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux