lkml.org 
[lkml]   [2017]   [Dec]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 2/8] staging: pi433: move var declaration to function level
From
Date
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.

\
 
 \ /
  Last update: 2017-12-13 20:01    [W:0.106 / U:5.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site