mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: monstr@seznam.cz
Cc: paulus@samba.org, arnd@arndb.de, linux-kernel@vger.kernel.org,
	linux-arch@vger.kernel.org, Michal Simek <monstr@monstr.eu>
Subject: Re: [PATCH 1/2] OF: Fix coding style violation in of_device.c and of_platform.c
Date: Mon, 5 May 2008 09:56:49 +1000	[thread overview]
Message-ID: <20080505095649.fccb57bf.sfr@canb.auug.org.au> (raw)
In-Reply-To: <765c6c8053679c45eb370255a110f7bc680a8f25.1209824033.git.monstr@monstr.eu>

[-- Attachment #1: Type: text/plain, Size: 4467 bytes --]

Hi Michal,

On Sat,  3 May 2008 16:22:11 +0200 monstr@seznam.cz wrote:
>
> From: Michal Simek <monstr@monstr.eu>
> 
> 
> Signed-off-by: Michal Simek <monstr@monstr.eu>
> ---
>  arch/powerpc/kernel/of_device.c   |   25 ++++++++++++++-----------
>  arch/powerpc/kernel/of_platform.c |    5 ++++-

These two files are the architecture specific parts of
drivers/of/device.c and platform.c respectively.  If there are parts that
are usable more generally than just powerpc, then those parts should be
removed from the current sources and merged into the drivers/of files.

Some of what you have below are not cleanups and not relevant to the
powerpc architecture.

Any changes to the drivers of files should be cc'd to me (who did the
initial splitup) and Dave Miller since you may impact the sparc code
(which is the other user).

>  2 files changed, 18 insertions(+), 12 deletions(-)
> 
> diff --git a/arch/powerpc/kernel/of_device.c b/arch/powerpc/kernel/of_device.c
> index 5748ddb..db9ed02 100644
> --- a/arch/powerpc/kernel/of_device.c
> +++ b/arch/powerpc/kernel/of_device.c
> @@ -8,7 +8,10 @@
>  #include <linux/of_device.h>
>  
>  #include <asm/errno.h>
> +
> +#ifdef CONFIG_PPC_PSERIES
>  #include <asm/dcr.h>
> +#endif
>  
>  static void of_device_make_bus_id(struct of_device *dev)
>  {
> @@ -106,7 +109,7 @@ ssize_t of_device_get_modalias(struct of_device *ofdev,
>  		return csize;
>  
>  	/* Find true end (we tolerate multiple \0 at the end */
> -	for (i=(cplen-1); i>=0 && !compat[i]; i--)
> +	for (i = (cplen-1); i >= 0 && !compat[i]; i--)
>  		cplen--;
>  	if (!cplen)
>  		return csize;
> @@ -116,26 +119,27 @@ ssize_t of_device_get_modalias(struct of_device *ofdev,
>  	tsize = csize + cplen;
>  	repend = tsize;
>  
> -	if (csize>=len)		/* @ the limit, all is already filled */
> +	if (csize >= len)	/* @ the limit, all is already filled */
>  		return tsize;
>  
> -	if (tsize>=len) {		/* limit compat list */
> -		cplen = len-csize-1;
> +	if (tsize >= len) {	/* limit compat list */
> +		cplen = len - csize - 1;
>  		repend = len;
>  	}
>  
>  	/* Copy and do char replacement */
>  	memcpy(&str[csize+1], compat, cplen);
> -	for (i=csize; i<repend; i++) {
> +	for (i = csize; i < repend; i++) {
>  		char c = str[i];
> -		if (c=='\0')
> +		if (c == '\0')
>  			str[i] = 'C';
> -		else if (c==' ')
> +		else if (c == ' ')
>  			str[i] = '_';
>  	}
>  
>  	return tsize;
>  }
> +EXPORT_SYMBOL(of_device_get_modalias);
>  
>  int of_device_uevent(struct device *dev, struct kobj_uevent_env *env)
>  {
> @@ -154,9 +158,9 @@ int of_device_uevent(struct device *dev, struct kobj_uevent_env *env)
>  	if (add_uevent_var(env, "OF_TYPE=%s", ofdev->node->type))
>  		return -ENOMEM;
>  
> -        /* Since the compatible field can contain pretty much anything
> -         * it's not really legal to split it out with commas. We split it
> -         * up using a number of environment variables instead. */
> +	/* Since the compatible field can contain pretty much anything
> +	 * it's not really legal to split it out with commas. We split it
> +	 * up using a number of environment variables instead. */
>  
>  	compat = of_get_property(ofdev->node, "compatible", &cplen);
>  	while (compat && *compat && cplen > 0) {
> @@ -184,4 +188,3 @@ int of_device_uevent(struct device *dev, struct kobj_uevent_env *env)
>  	return 0;
>  }
>  EXPORT_SYMBOL(of_device_uevent);
> -EXPORT_SYMBOL(of_device_get_modalias);
> diff --git a/arch/powerpc/kernel/of_platform.c b/arch/powerpc/kernel/of_platform.c
> index e79ad8a..cd9336e 100644
> --- a/arch/powerpc/kernel/of_platform.c
> +++ b/arch/powerpc/kernel/of_platform.c
> @@ -26,9 +26,12 @@
>  #include <asm/errno.h>
>  #include <asm/topology.h>
>  #include <asm/pci-bridge.h>
> -#include <asm/ppc-pci.h>
>  #include <asm/atomic.h>
>  
> +#ifdef CONFIG_PPC_PSERIES
> +#include <asm/ppc-pci.h>
> +#endif
> +
>  /*
>   * The list of OF IDs below is used for matching bus types in the
>   * system whose devices are to be exposed as of_platform_devices.
> -- 
> 1.5.4.GIT
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-arch" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

  parent reply	other threads:[~2008-05-04 23:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-03 14:22 Moving OF firware to arch independent folder monstr
2008-05-03 14:22 ` [PATCH 1/2] OF: Fix coding style violation in of_device.c and of_platform.c monstr
2008-05-03 14:22   ` [PATCH 2/2] OF: Move of_device.c and of_platform.c to drivers/of/ monstr
2008-05-03 21:04   ` [PATCH 1/2] OF: Fix coding style violation in of_device.c and of_platform.c Arnd Bergmann
2008-05-04  8:20     ` Michal Simek
2008-05-04 19:42       ` Arnd Bergmann
2008-05-05  6:33         ` Michal Simek
2008-05-04 23:56   ` Stephen Rothwell [this message]
2008-05-05  0:06     ` David Miller
2008-05-06  8:57       ` Michal Simek

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=20080505095649.fccb57bf.sfr@canb.auug.org.au \
    --to=sfr@canb.auug.org.au \
    --cc=arnd@arndb.de \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=monstr@monstr.eu \
    --cc=monstr@seznam.cz \
    --cc=paulus@samba.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®