LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Stefan Haun <tux@netz39.de>
To: y@mail.netz39.de
Cc: John McCutchan <john@johnmccutchan.com>,
	Robert Love <rlove@rlove.org>, Eric Paris <eparis@parisplace.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] fs: fix checkpatch code warnings for inotify
Date: Sat, 24 Jan 2015 22:39:04 +0100	[thread overview]
Message-ID: <201501242239.13739.tux@netz39.de> (raw)
In-Reply-To: <1421421311-4475-2-git-send-email-y>

[-- Attachment #1: Type: Text/Plain, Size: 5655 bytes --]

I just noticed that I failed in setting the right From: header. Sorry for 
this, I will re-post the patches with correct meta-data set.


Am Freitag, 16. Januar 2015, 16:15:11 schrieb y@mail.netz39.de:
> From: Stefan Haun <tux@netz39.de>
> 
> ./fs/notify/inotify/inotify.h:23:
> CHECK: extern prototypes should be avoided in .h files
> ./fs/notify/inotify/inotify.h:25:
> CHECK: extern prototypes should be avoided in .h files
> 
> 	Removed extrn keywords; the matter, however, seems to be an open
> 	debate.
> 
> ./fs/notify/inotify/inotify_fsnotify.c:140:
> ERROR: do not initialise statics to 0 or NULL
> 
> 	Replace the initialization by a comment:
> 	Compiler takes care of the proper initialization.
> 
> ./fs/notify/inotify/inotify_fsnotify.c:159:
> WARNING: Prefer [subsystem eg: netdev]_warn([subsystem]dev, ... then
> dev_warn(dev, ... then pr_warn(...  to printk(KERN_WARNING ...
> ./fs/notify/inotify/inotify_user.c:473:
> WARNING: Prefer [subsystem eg: netdev]_err([subsystem]dev, ... then
> dev_err(dev, ... then pr_err(...  to printk(KERN_ERR ...
> ./fs/notify/inotify/inotify_user.c:474:
> WARNING: quoted string split across lines
> 
> 	Use pr_warn instead of printk and fix line break.
> 
> ./fs/notify/inotify/inotify_user.c:645:
> CHECK: Prefer kmalloc(sizeof(*oevent)...) over
> kmalloc(sizeof(struct inotify_event_info)...)
> 
> 	Done that (complies to coding stlye).
> 
> Signed-off-by: Stefan Haun <tux@netz39.de>
> ---
>  fs/notify/inotify/inotify.h          |   16 ++++++++--------
>  fs/notify/inotify/inotify_fsnotify.c |    6 +++---
>  fs/notify/inotify/inotify_user.c     |    8 ++++----
>  3 files changed, 15 insertions(+), 15 deletions(-)
> 
> diff --git a/fs/notify/inotify/inotify.h b/fs/notify/inotify/inotify.h
> index ed855ef..9d6d4e2 100644
> --- a/fs/notify/inotify/inotify.h
> +++ b/fs/notify/inotify/inotify.h
> @@ -20,13 +20,13 @@ static inline struct inotify_event_info
> *INOTIFY_E(struct fsnotify_event *fse) return container_of(fse, struct
> inotify_event_info, fse);
>  }
> 
> -extern void inotify_ignored_and_remove_idr(struct fsnotify_mark *fsn_mark,
> -					   struct fsnotify_group *group);
> -extern int inotify_handle_event(struct fsnotify_group *group,
> -				struct inode *inode,
> -				struct fsnotify_mark *inode_mark,
> -				struct fsnotify_mark *vfsmount_mark,
> -				u32 mask, void *data, int data_type,
> -				const unsigned char *file_name, u32 cookie);
> +void inotify_ignored_and_remove_idr(struct fsnotify_mark *fsn_mark,
> +				    struct fsnotify_group *group);
> +
> +int inotify_handle_event(struct fsnotify_group *group, struct inode
> *inode, +			 struct fsnotify_mark *inode_mark,
> +			 struct fsnotify_mark *vfsmount_mark,
> +			 u32 mask, void *data, int data_type,
> +			 const unsigned char *file_name, u32 cookie);
> 
>  extern const struct fsnotify_ops inotify_fsnotify_ops;
> diff --git a/fs/notify/inotify/inotify_fsnotify.c
> b/fs/notify/inotify/inotify_fsnotify.c index 0238615..16efe98 100644
> --- a/fs/notify/inotify/inotify_fsnotify.c
> +++ b/fs/notify/inotify/inotify_fsnotify.c
> @@ -137,7 +137,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; /* = false;  default by GCC */
> 
>  	if (warned)
>  		return 0;
> @@ -156,8 +156,8 @@ static int idr_callback(int id, void *p, void *data)
>  	 * BUG() that was here.
>  	 */
>  	if (fsn_mark)
> -		printk(KERN_WARNING "fsn_mark->group=%p inode=%p wd=%d\n",
> -		       fsn_mark->group, fsn_mark->inode, i_mark->wd);
> +		pr_warn("fsn_mark->group=%p inode=%p wd=%d\n",
> +			fsn_mark->group, fsn_mark->inode, i_mark->wd);
>  	return 0;
>  }
> 
> diff --git a/fs/notify/inotify/inotify_user.c
> b/fs/notify/inotify/inotify_user.c index 3214e2b..d7e3e58 100644
> --- a/fs/notify/inotify/inotify_user.c
> +++ b/fs/notify/inotify/inotify_user.c
> @@ -470,9 +470,9 @@ static void inotify_remove_from_idr(struct
> fsnotify_group *group, * one ref grabbed by inotify_idr_find
>  	 */
>  	if (unlikely(atomic_read(&i_mark->fsn_mark.refcnt) < 3)) {
> -		printk(KERN_ERR "%s: i_mark=%p i_mark->wd=%d i_mark->group=%p"
> -			" i_mark->inode=%p\n", __func__, i_mark, i_mark->wd,
> -			i_mark->fsn_mark.group, i_mark->fsn_mark.inode);
> +		pr_err("%s: i_mark=%p i_mark->wd=%d i_mark->group=%p
> i_mark->inode=%p\n", +		       __func__, i_mark, i_mark->wd,
> i_mark->fsn_mark.group,
> +		       i_mark->fsn_mark.inode);
>  		/* we can't really recover with bad ref cnting.. */
>  		BUG();
>  	}
> @@ -642,7 +642,7 @@ static struct fsnotify_group
> *inotify_new_group(unsigned int max_events) if (IS_ERR(group))
>  		return group;
> 
> -	oevent = kmalloc(sizeof(struct inotify_event_info), GFP_KERNEL);
> +	oevent = kmalloc(sizeof(*oevent), GFP_KERNEL);
>  	if (unlikely(!oevent)) {
>  		fsnotify_destroy_group(group);
>  		return ERR_PTR(-ENOMEM);


-- 
Netz39 e.V. - Real World Virtuality                http://www.netz39.de
Stefan Haun                                               tux@netz39.de


E-Mail: kontakt@netz39.de

Vertretungsberechtigter Vorstand: René Meye, Sebastian Mai
Inhaltlich verantwortlich gemäß §55 (2) RStV: René Meye

Registergericht: Amtsgericht Stendal
Registernummer:  VR 3169


Disclaimer:   Diese E-Mail ist in keiner Form böse oder beleidigend ge-
meint. Sollte sie an Stellen doch so sein, dann sage mir das bitte. Ich 
werde Dein Feedback annehmen und nur beantworten, falls Du es ausdrück-
lich wünschst.

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2015-01-24 21:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-16 15:15 [PATCH 1/2] fs: fix code-formatting issues in inotify y
2015-01-16 15:15 ` [PATCH 2/2] fs: fix checkpatch code warnings for inotify y
2015-01-24 21:39   ` Stefan Haun [this message]
2015-01-24 21:40 [PATCH 1/2] fs: fix code-formatting issues in inotify Stefan Haun
2015-01-24 21:40 ` [PATCH 2/2] fs: fix checkpatch code warnings for inotify Stefan Haun

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201501242239.13739.tux@netz39.de \
    --to=tux@netz39.de \
    --cc=eparis@parisplace.org \
    --cc=john@johnmccutchan.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rlove@rlove.org \
    --cc=y@mail.netz39.de \
    --subject='Re: [PATCH 2/2] fs: fix checkpatch code warnings for inotify' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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).