LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Teodori Serge <teodori.serge@gmail.com>
Cc: Teodori Serge <teodori.serge@hotmail.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH 1/1] drivers/char/mem.c
Date: Sun, 23 Sep 2012 14:16:51 +0000	[thread overview]
Message-ID: <201209231416.52067.arnd@arndb.de> (raw)
In-Reply-To: <1348348812-17201-1-git-send-email-teodori.serge@hotmail.com>

On Saturday 22 September 2012, Teodori Serge wrote:
> replace 'arch_has_dev_port()' to 'CONFIG_DEVPORT'
> 
> modified:   arch/powerpc/include/asm/io.h
> modified:   drivers/char/mem.c
> modified:   include/linux/io.h
> 
> why do we need 'arch_has_dev_port()' if we have a 'CONFIG_DEVPORT'?
> 
> Signed-off-by: Teodori Serge <teodori.serge@hotmail.com>
> ---
>  arch/powerpc/include/asm/io.h |    2 +-
>  drivers/char/mem.c            |    6 ------
>  include/linux/io.h            |    9 ---------
>  3 files changed, 1 insertion(+), 16 deletions(-)
> 
> diff --git a/arch/powerpc/include/asm/io.h b/arch/powerpc/include/asm/io.h
> index f94ef42..cb8b663 100644
> --- a/arch/powerpc/include/asm/io.h
> +++ b/arch/powerpc/include/asm/io.h
> @@ -25,7 +25,7 @@ extern struct pci_dev *isa_bridge_pcidev;
>  /*
>   * has legacy ISA devices ?
>   */
> -#define arch_has_dev_port()	(isa_bridge_pcidev != NULL)
> +#define CONFIG_DEVPORT	(isa_bridge_pcidev != NULL)
>  #endif
>  
>  #include <linux/device.h>

By convention, CONFIG_* symbols should only be set by Kconfig and not used
for runtime checks.

Also, the existing checks for those symbols check for whether it is
defined, not for the actual value. With what you have there,
the driver will always enable /dev/ports because CONFIG_DEVPORT
is defined.

What are you actually trying to achieve?

	Arnd

      reply	other threads:[~2012-09-23 14:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <Teodori Serge <teodori.serge@hotmail.com>
2012-09-22 21:20 ` [PATCH 1/1] drivers/char/mem.c Teodori Serge
2012-09-23 14:16   ` Arnd Bergmann [this message]

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=201209231416.52067.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=teodori.serge@gmail.com \
    --cc=teodori.serge@hotmail.com \
    /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