Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753547AbdLMTBm (ORCPT ); Wed, 13 Dec 2017 14:01:42 -0500 Received: from smtprelay0218.hostedemail.com ([216.40.44.218]:50407 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751644AbdLMTBl (ORCPT ); Wed, 13 Dec 2017 14:01:41 -0500 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::,RULES_HIT:41:355:379:541:599:966:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1540:1593:1594:1711:1730:1747:1777:1792:2194:2196:2199:2200:2393:2559:2562:2828:3138:3139:3140:3141:3142:3352:3622:3865:3867:3868:3872:4321:4385:5007:6119:7875:7903:8603:10004:10400:10848:11026:11232:11658:11914:12043:12296:12740:12760:12895:13069:13311:13357:13439:14659:21080:21324:21451:21627:30054:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:2,LUA_SUMMARY:none X-HE-Tag: river63_65b39765e1e55 X-Filterd-Recvd-Size: 1889 Message-ID: <1513191696.27409.33.camel@perches.com> Subject: Re: [PATCH 2/8] staging: pi433: move var declaration to function level From: Joe Perches To: Valentin Vidic , Greg Kroah-Hartman Cc: Simon =?ISO-8859-1?Q?Sandstr=F6m?= , Marcin Ciupak , Marcus Wolf , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Date: Wed, 13 Dec 2017 11:01:36 -0800 In-Reply-To: <20171213142156.3201-2-Valentin.Vidic@CARNet.hr> References: <20171213142156.3201-1-Valentin.Vidic@CARNet.hr> <20171213142156.3201-2-Valentin.Vidic@CARNet.hr> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.26.1-1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 850 Lines: 23 On Wed, 2017-12-13 at 15:21 +0100, Valentin Vidic wrote: > WARNING: Missing a blank line after declarations [] > diff --git a/drivers/staging/pi433/pi433_if.c b/drivers/staging/pi433/pi433_if.c [] > @@ -565,6 +565,7 @@ pi433_tx_thread(void *data) > bool rx_interrupted = false; > int position, repetitions; > int retval; > + int temp; > > while (1) { > /* wait for fifo to be populated or for request to terminate*/ > @@ -700,7 +701,7 @@ pi433_tx_thread(void *data) > while ((repetitions > 0) && (size > position)) { > if ((size - position) > device->free_in_fifo) { > /* msg to big for fifo - take a part */ > - int temp = device->free_in_fifo; > + temp = device->free_in_fifo; It's generally better to keep variable declarations to the innermost scope possible and not move them outwards unnecessarily.