# \[PATCH\] raid5-ppl: silence a misleading warning message

- Subsystems: SOFTWARE RAID (Multiple Disks) SUPPORT, THE REST
- Maintainers: Song Liu, Yu Kuai, Linus Torvalds
- List: linux-raid
- 3 messages, 3 authors
- Page: https://ratatoskr.run/linux-raid/2017/03/6634921/t

## \[PATCH\] raid5-ppl: silence a misleading warning message

- From: Dan Carpenter \<hidden\>
- Date: 2017-03-21 20:43:05 
- Message: https://ratatoskr.run/linux-raid/2017/03/6634921.md

```text
The "need_cache_flush" variable is never set to false.  When the
variable is true that means we print a warning message at the end of
the function.

Fixes: 3418d036c81d ("raid5-ppl: Partial Parity Log write logging implementation")
Signed-off-by: Dan Carpenter <redacted>

diff --git a/drivers/md/raid5-ppl.c b/drivers/md/raid5-ppl.c
index 27bad3e2d7ce..86ea9addb51a 100644
--- a/drivers/md/raid5-ppl.c
+++ b/drivers/md/raid5-ppl.c
@@ -1070,7 +1070,7 @@ int ppl_init_log(struct r5conf *conf)
 	struct mddev *mddev = conf->mddev;
 	int ret = 0;
 	int i;
-	bool need_cache_flush;
+	bool need_cache_flush = false;
 
 	pr_debug("md/raid:%s: enabling distributed Partial Parity Log\n",
 		 mdname(conf->mddev));
```

## Re: \[PATCH\] raid5-ppl: silence a misleading warning message

- From: Artur Paszkiewicz \<hidden\>
- Date: 2017-03-23 12:00:40 
- Message: https://ratatoskr.run/linux-raid/2017/03/6634950.md

```text
On 03/21/2017 09:43 PM, Dan Carpenter wrote:
> The "need_cache_flush" variable is never set to false.  When the
> variable is true that means we print a warning message at the end of
> the function.
> 
> Fixes: 3418d036c81d ("raid5-ppl: Partial Parity Log write logging implementation")
> Signed-off-by: Dan Carpenter <redacted>

Good catch, thanks. I thought gcc would warn about such issues, I'll
have to be more careful.

Reviewed-by: Artur Paszkiewicz <redacted>
```

## Re: \[PATCH\] raid5-ppl: silence a misleading warning message

- From: Shaohua Li \<shli@kernel.org\>
- Date: 2017-03-24 05:37:56 
- Message: https://ratatoskr.run/linux-raid/2017/03/6634953.md

```text
On Tue, Mar 21, 2017 at 11:43:05PM +0300, Dan Carpenter wrote:
> The "need_cache_flush" variable is never set to false.  When the
> variable is true that means we print a warning message at the end of
> the function.
> 
> Fixes: 3418d036c81d ("raid5-ppl: Partial Parity Log write logging implementation")
> Signed-off-by: Dan Carpenter <redacted>

applied, thanks!
 
> diff --git a/drivers/md/raid5-ppl.c b/drivers/md/raid5-ppl.c
> index 27bad3e2d7ce..86ea9addb51a 100644
> --- a/drivers/md/raid5-ppl.c
> +++ b/drivers/md/raid5-ppl.c
> @@ -1070,7 +1070,7 @@ int ppl_init_log(struct r5conf *conf)
>  	struct mddev *mddev = conf->mddev;
>  	int ret = 0;
>  	int i;
> -	bool need_cache_flush;
> +	bool need_cache_flush = false;
>  
>  	pr_debug("md/raid:%s: enabling distributed Partial Parity Log\n",
>  		 mdname(conf->mddev));
```
