* [PATCH 1/1] dt: fix some code indent issue in of.h
@ 2011-12-20 18:10 Dong Aisheng
[not found] ` <1324404609-3999-1-git-send-email-b29396-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
0 siblings, 1 reply; 5+ messages in thread
From: Dong Aisheng @ 2011-12-20 18:10 UTC (permalink / raw)
To: devicetree-discuss
Cc: linux-kernel, linux-arm-kernel, grant.likely, rob.herring,
shawn.guo
From: Dong Aisheng <dong.aisheng@linaro.org>
Checkpatch script will report some warnings for the old coding style:
WARNING: suspect code indent for conditional statements (8, 0)
for (child = of_get_next_child(parent, NULL); child != NULL; \
[...]
+static inline int of_get_child_count(const struct device_node *np)
Signed-off-by: Dong Aisheng <dong.aisheng@linaro.org>
Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: Rob Herring <rob.herring@calxeda.com>
---
include/linux/of.h | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/include/linux/of.h b/include/linux/of.h
index f1a490c..95dee0a 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -163,22 +163,22 @@ extern struct device_node *of_find_node_by_name(struct device_node *from,
const char *name);
#define for_each_node_by_name(dn, name) \
for (dn = of_find_node_by_name(NULL, name); dn; \
- dn = of_find_node_by_name(dn, name))
+ dn = of_find_node_by_name(dn, name))
extern struct device_node *of_find_node_by_type(struct device_node *from,
const char *type);
#define for_each_node_by_type(dn, type) \
for (dn = of_find_node_by_type(NULL, type); dn; \
- dn = of_find_node_by_type(dn, type))
+ dn = of_find_node_by_type(dn, type))
extern struct device_node *of_find_compatible_node(struct device_node *from,
const char *type, const char *compat);
#define for_each_compatible_node(dn, type, compatible) \
for (dn = of_find_compatible_node(NULL, type, compatible); dn; \
- dn = of_find_compatible_node(dn, type, compatible))
+ dn = of_find_compatible_node(dn, type, compatible))
extern struct device_node *of_find_matching_node(struct device_node *from,
const struct of_device_id *matches);
#define for_each_matching_node(dn, matches) \
for (dn = of_find_matching_node(NULL, matches); dn; \
- dn = of_find_matching_node(dn, matches))
+ dn = of_find_matching_node(dn, matches))
extern struct device_node *of_find_node_by_path(const char *path);
extern struct device_node *of_find_node_by_phandle(phandle handle);
extern struct device_node *of_get_parent(const struct device_node *node);
@@ -187,13 +187,13 @@ extern struct device_node *of_get_next_child(const struct device_node *node,
struct device_node *prev);
#define for_each_child_of_node(parent, child) \
for (child = of_get_next_child(parent, NULL); child != NULL; \
- child = of_get_next_child(parent, child))
+ child = of_get_next_child(parent, child))
extern struct device_node *of_find_node_with_property(
struct device_node *from, const char *prop_name);
#define for_each_node_with_property(dn, prop_name) \
for (dn = of_find_node_with_property(NULL, prop_name); dn; \
- dn = of_find_node_with_property(dn, prop_name))
+ dn = of_find_node_with_property(dn, prop_name))
extern struct property *of_find_property(const struct device_node *np,
const char *name,
--
1.7.0.4
^ permalink raw reply related [flat|nested] 5+ messages in thread[parent not found: <1324404609-3999-1-git-send-email-b29396-KZfg59tc24xl57MIdRCFDg@public.gmane.org>]
* Re: [PATCH 1/1] dt: fix some code indent issue in of.h [not found] ` <1324404609-3999-1-git-send-email-b29396-KZfg59tc24xl57MIdRCFDg@public.gmane.org> @ 2011-12-20 18:42 ` Rob Herring 2011-12-21 2:57 ` Dong Aisheng-B29396 0 siblings, 1 reply; 5+ messages in thread From: Rob Herring @ 2011-12-20 18:42 UTC (permalink / raw) To: Dong Aisheng Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, linux-kernel-u79uwXL29TY76Z2rM5mHXA, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r On 12/20/2011 12:10 PM, Dong Aisheng wrote: > From: Dong Aisheng <dong.aisheng-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> > > Checkpatch script will report some warnings for the old coding style: > WARNING: suspect code indent for conditional statements (8, 0) > for (child = of_get_next_child(parent, NULL); child != NULL; \ > [...] > +static inline int of_get_child_count(const struct device_node *np) > > Signed-off-by: Dong Aisheng <dong.aisheng-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> > Cc: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org> > Cc: Rob Herring <rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org> > --- > include/linux/of.h | 12 ++++++------ > 1 files changed, 6 insertions(+), 6 deletions(-) > > diff --git a/include/linux/of.h b/include/linux/of.h > index f1a490c..95dee0a 100644 > --- a/include/linux/of.h > +++ b/include/linux/of.h > @@ -163,22 +163,22 @@ extern struct device_node *of_find_node_by_name(struct device_node *from, > const char *name); > #define for_each_node_by_name(dn, name) \ > for (dn = of_find_node_by_name(NULL, name); dn; \ > - dn = of_find_node_by_name(dn, name)) > + dn = of_find_node_by_name(dn, name)) > extern struct device_node *of_find_node_by_type(struct device_node *from, > const char *type); > #define for_each_node_by_type(dn, type) \ > for (dn = of_find_node_by_type(NULL, type); dn; \ > - dn = of_find_node_by_type(dn, type)) > + dn = of_find_node_by_type(dn, type)) > extern struct device_node *of_find_compatible_node(struct device_node *from, > const char *type, const char *compat); > #define for_each_compatible_node(dn, type, compatible) \ > for (dn = of_find_compatible_node(NULL, type, compatible); dn; \ > - dn = of_find_compatible_node(dn, type, compatible)) > + dn = of_find_compatible_node(dn, type, compatible)) > extern struct device_node *of_find_matching_node(struct device_node *from, > const struct of_device_id *matches); > #define for_each_matching_node(dn, matches) \ > for (dn = of_find_matching_node(NULL, matches); dn; \ > - dn = of_find_matching_node(dn, matches)) > + dn = of_find_matching_node(dn, matches)) > extern struct device_node *of_find_node_by_path(const char *path); > extern struct device_node *of_find_node_by_phandle(phandle handle); > extern struct device_node *of_get_parent(const struct device_node *node); > @@ -187,13 +187,13 @@ extern struct device_node *of_get_next_child(const struct device_node *node, > struct device_node *prev); > #define for_each_child_of_node(parent, child) \ > for (child = of_get_next_child(parent, NULL); child != NULL; \ > - child = of_get_next_child(parent, child)) > + child = of_get_next_child(parent, child)) > > extern struct device_node *of_find_node_with_property( > struct device_node *from, const char *prop_name); > #define for_each_node_with_property(dn, prop_name) \ > for (dn = of_find_node_with_property(NULL, prop_name); dn; \ > - dn = of_find_node_with_property(dn, prop_name)) > + dn = of_find_node_with_property(dn, prop_name)) > > extern struct property *of_find_property(const struct device_node *np, > const char *name, The old way looks fine to me and indenting like this is commonly used in the kernel. Rob ^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH 1/1] dt: fix some code indent issue in of.h 2011-12-20 18:42 ` Rob Herring @ 2011-12-21 2:57 ` Dong Aisheng-B29396 2011-12-21 3:06 ` Joe Perches 0 siblings, 1 reply; 5+ messages in thread From: Dong Aisheng-B29396 @ 2011-12-21 2:57 UTC (permalink / raw) To: Rob Herring Cc: devicetree-discuss@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, grant.likely@secretlab.ca, Guo Shawn-R65073 > -----Original Message----- > From: Rob Herring [mailto:robherring2@gmail.com] > Sent: Wednesday, December 21, 2011 2:42 AM > To: Dong Aisheng-B29396 > Cc: devicetree-discuss@lists.ozlabs.org; linux-kernel@vger.kernel.org; linux- > arm-kernel@lists.infradead.org; grant.likely@secretlab.ca; Guo Shawn-R65073 > Subject: Re: [PATCH 1/1] dt: fix some code indent issue in of.h > Importance: High > > On 12/20/2011 12:10 PM, Dong Aisheng wrote: > > From: Dong Aisheng <dong.aisheng@linaro.org> > > > > Checkpatch script will report some warnings for the old coding style: > > WARNING: suspect code indent for conditional statements (8, 0) > > for (child = of_get_next_child(parent, NULL); child != NULL; \ > > [...] > > +static inline int of_get_child_count(const struct device_node *np) > > > > Signed-off-by: Dong Aisheng <dong.aisheng@linaro.org> > > Cc: Grant Likely <grant.likely@secretlab.ca> > > Cc: Rob Herring <rob.herring@calxeda.com> > > --- > > include/linux/of.h | 12 ++++++------ > > 1 files changed, 6 insertions(+), 6 deletions(-) > > > > diff --git a/include/linux/of.h b/include/linux/of.h index > > f1a490c..95dee0a 100644 > > --- a/include/linux/of.h > > +++ b/include/linux/of.h > > @@ -163,22 +163,22 @@ extern struct device_node *of_find_node_by_name(struct > device_node *from, > > const char *name); > > #define for_each_node_by_name(dn, name) \ > > for (dn = of_find_node_by_name(NULL, name); dn; \ > > - dn = of_find_node_by_name(dn, name)) > > + dn = of_find_node_by_name(dn, name)) > > extern struct device_node *of_find_node_by_type(struct device_node *from, > > const char *type); > > #define for_each_node_by_type(dn, type) \ > > for (dn = of_find_node_by_type(NULL, type); dn; \ > > - dn = of_find_node_by_type(dn, type)) > > + dn = of_find_node_by_type(dn, type)) > > extern struct device_node *of_find_compatible_node(struct device_node *from, > > const char *type, const char *compat); #define > > for_each_compatible_node(dn, type, compatible) \ > > for (dn = of_find_compatible_node(NULL, type, compatible); dn; \ > > - dn = of_find_compatible_node(dn, type, compatible)) > > + dn = of_find_compatible_node(dn, type, compatible)) > > extern struct device_node *of_find_matching_node(struct device_node *from, > > const struct of_device_id *matches); #define > > for_each_matching_node(dn, matches) \ > > for (dn = of_find_matching_node(NULL, matches); dn; \ > > - dn = of_find_matching_node(dn, matches)) > > + dn = of_find_matching_node(dn, matches)) > > extern struct device_node *of_find_node_by_path(const char *path); > > extern struct device_node *of_find_node_by_phandle(phandle handle); > > extern struct device_node *of_get_parent(const struct device_node > > *node); @@ -187,13 +187,13 @@ extern struct device_node > *of_get_next_child(const struct device_node *node, > > struct device_node *prev); > > #define for_each_child_of_node(parent, child) \ > > for (child = of_get_next_child(parent, NULL); child != NULL; \ > > - child = of_get_next_child(parent, child)) > > + child = of_get_next_child(parent, child)) > > > > extern struct device_node *of_find_node_with_property( > > struct device_node *from, const char *prop_name); #define > > for_each_node_with_property(dn, prop_name) \ > > for (dn = of_find_node_with_property(NULL, prop_name); dn; \ > > - dn = of_find_node_with_property(dn, prop_name)) > > + dn = of_find_node_with_property(dn, prop_name)) > > > > extern struct property *of_find_property(const struct device_node *np, > > const char *name, > > The old way looks fine to me and indenting like this is commonly used in the > kernel. > Yes, i was also ok without those annoying warning. Do you think if we need to fix the checkpatch.pl if the it is commonly used In the kernel? Regards Dong Aisheng ^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH 1/1] dt: fix some code indent issue in of.h 2011-12-21 2:57 ` Dong Aisheng-B29396 @ 2011-12-21 3:06 ` Joe Perches 2011-12-21 11:37 ` Andy Whitcroft 0 siblings, 1 reply; 5+ messages in thread From: Joe Perches @ 2011-12-21 3:06 UTC (permalink / raw) To: Dong Aisheng-B29396, Andy Whitcroft Cc: Rob Herring, devicetree-discuss@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, grant.likely@secretlab.ca, Guo Shawn-R65073 On Wed, 2011-12-21 at 02:57 +0000, Dong Aisheng-B29396 wrote: > > On 12/20/2011 12:10 PM, Dong Aisheng wrote: > > > From: Dong Aisheng <dong.aisheng@linaro.org> > > > Checkpatch script will report some warnings for the old coding style: > > > WARNING: suspect code indent for conditional statements (8, 0) > > > for (child = of_get_next_child(parent, NULL); child != NULL; \ > > > [...] [] > > > diff --git a/include/linux/of.h b/include/linux/of.h index [] > > > @@ -163,22 +163,22 @@ extern struct device_node *of_find_node_by_name(struct > > device_node *from, > > > const char *name); > > > #define for_each_node_by_name(dn, name) \ > > > for (dn = of_find_node_by_name(NULL, name); dn; \ > > > - dn = of_find_node_by_name(dn, name)) > > > + dn = of_find_node_by_name(dn, name)) > > The old way looks fine to me and indenting like this is commonly used in the > > kernel. > Yes, i was also ok without those annoying warning. > Do you think if we need to fix the checkpatch.pl if the it is commonly used > In the kernel? I don't. I think it's better for people to realize that checkpatch is and will always be an imperfect tool and that they should learn to ignore inappropriate warnings. ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] dt: fix some code indent issue in of.h 2011-12-21 3:06 ` Joe Perches @ 2011-12-21 11:37 ` Andy Whitcroft 0 siblings, 0 replies; 5+ messages in thread From: Andy Whitcroft @ 2011-12-21 11:37 UTC (permalink / raw) To: Joe Perches Cc: Dong Aisheng-B29396, Rob Herring, devicetree-discuss@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, grant.likely@secretlab.ca, Guo Shawn-R65073 On Tue, Dec 20, 2011 at 07:06:22PM -0800, Joe Perches wrote: > On Wed, 2011-12-21 at 02:57 +0000, Dong Aisheng-B29396 wrote: > > > On 12/20/2011 12:10 PM, Dong Aisheng wrote: > > > > From: Dong Aisheng <dong.aisheng@linaro.org> > > > > Checkpatch script will report some warnings for the old coding style: > > > > WARNING: suspect code indent for conditional statements (8, 0) > > > > for (child = of_get_next_child(parent, NULL); child != NULL; \ > > > > [...] > [] > > > > diff --git a/include/linux/of.h b/include/linux/of.h index > [] > > > > @@ -163,22 +163,22 @@ extern struct device_node *of_find_node_by_name(struct > > > device_node *from, > > > > const char *name); > > > > #define for_each_node_by_name(dn, name) \ > > > > for (dn = of_find_node_by_name(NULL, name); dn; \ > > > > - dn = of_find_node_by_name(dn, name)) > > > > + dn = of_find_node_by_name(dn, name)) > > > The old way looks fine to me and indenting like this is commonly used in the > > > kernel. > > Yes, i was also ok without those annoying warning. > > Do you think if we need to fix the checkpatch.pl if the it is commonly used > > In the kernel? > > I don't. I think it's better for people to realize that > checkpatch is and will always be an imperfect tool and > that they should learn to ignore inappropriate warnings. Right. Checkpatch is simply a helper, if you have checkpatch warnings in a patch you are submitting then you need to be able to mentally justify them. It is there to catch the basic stuff that wastes so much of the reviewers time and to help you get your patches accepted quicker. It is not a substitute for your own common sense. -apw ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-12-21 11:37 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-20 18:10 [PATCH 1/1] dt: fix some code indent issue in of.h Dong Aisheng
[not found] ` <1324404609-3999-1-git-send-email-b29396-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2011-12-20 18:42 ` Rob Herring
2011-12-21 2:57 ` Dong Aisheng-B29396
2011-12-21 3:06 ` Joe Perches
2011-12-21 11:37 ` Andy Whitcroft
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox