linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fsnotify: do not initialise statics to false
@ 2016-06-07  2:17 Wei Tang
  2016-06-07  6:47 ` Nikolay Borisov
  0 siblings, 1 reply; 2+ messages in thread
From: Wei Tang @ 2016-06-07  2:17 UTC (permalink / raw)
  To: john, rlove, eparis; +Cc: linux-kernel, Wei Tang

This patch fixes the checkpatch.pl error to inotify_fsnotify.c:

ERROR: do not initialise statics to false

Signed-off-by: Wei Tang <tangwei@cmss.chinamobile.com>
---
 fs/notify/inotify/inotify_fsnotify.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/notify/inotify/inotify_fsnotify.c b/fs/notify/inotify/inotify_fsnotify.c
index 2cd900c..09c5393 100644
--- a/fs/notify/inotify/inotify_fsnotify.c
+++ b/fs/notify/inotify/inotify_fsnotify.c
@@ -136,7 +136,7 @@ static int idr_callback(int id, void *p, void *data)
 {
 	struct fsnotify_mark *fsn_mark;
 	struct inotify_inode_mark *i_mark;
-	static bool warned = false;
+	static bool warned;
 
 	if (warned)
 		return 0;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] fsnotify: do not initialise statics to false
  2016-06-07  2:17 [PATCH] fsnotify: do not initialise statics to false Wei Tang
@ 2016-06-07  6:47 ` Nikolay Borisov
  0 siblings, 0 replies; 2+ messages in thread
From: Nikolay Borisov @ 2016-06-07  6:47 UTC (permalink / raw)
  To: Wei Tang, john, rlove, eparis; +Cc: linux-kernel



On 06/07/2016 05:17 AM, Wei Tang wrote:
> This patch fixes the checkpatch.pl error to inotify_fsnotify.c:
> 
> ERROR: do not initialise statics to false

So if a variable is declared as static this means it's going to live in
the BSS which is zeroed out on load. So implicitly it is going to be 0,
however I think this is a subtle detail. I personally rather have the
false there and live with the warning. Not everything that checkpatch
reports must be fixed.


> 
> Signed-off-by: Wei Tang <tangwei@cmss.chinamobile.com>
> ---
>  fs/notify/inotify/inotify_fsnotify.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/notify/inotify/inotify_fsnotify.c b/fs/notify/inotify/inotify_fsnotify.c
> index 2cd900c..09c5393 100644
> --- a/fs/notify/inotify/inotify_fsnotify.c
> +++ b/fs/notify/inotify/inotify_fsnotify.c
> @@ -136,7 +136,7 @@ static int idr_callback(int id, void *p, void *data)
>  {
>  	struct fsnotify_mark *fsn_mark;
>  	struct inotify_inode_mark *i_mark;
> -	static bool warned = false;
> +	static bool warned;
>  
>  	if (warned)
>  		return 0;
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-06-07  6:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-07  2:17 [PATCH] fsnotify: do not initialise statics to false Wei Tang
2016-06-07  6:47 ` Nikolay Borisov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).