mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [2.6 patch] proper prototypes for mmc_attach_*()
@ 2008-04-13 18:15 Adrian Bunk
  2008-04-16 17:32 ` Pierre Ossman
  0 siblings, 1 reply; 3+ messages in thread
From: Adrian Bunk @ 2008-04-13 18:15 UTC (permalink / raw)
  To: drzeus-mmc; +Cc: linux-kernel

This patch adds proper prototypes for mmc_attach_*() in 
drivers/mmc/core/core.h

Signed-off-by: Adrian Bunk <bunk@kernel.org>

---

 drivers/mmc/core/core.c |    4 ----
 drivers/mmc/core/core.h |    4 ++++
 2 files changed, 4 insertions(+), 4 deletions(-)

bb340d80c76a77876462f62612a0795ca21f2362 diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index ab91b02..01ced4c 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -35,10 +35,6 @@
 #include "sd_ops.h"
 #include "sdio_ops.h"
 
-extern int mmc_attach_mmc(struct mmc_host *host, u32 ocr);
-extern int mmc_attach_sd(struct mmc_host *host, u32 ocr);
-extern int mmc_attach_sdio(struct mmc_host *host, u32 ocr);
-
 static struct workqueue_struct *workqueue;
 
 /*
diff --git a/drivers/mmc/core/core.h b/drivers/mmc/core/core.h
index cfa8e15..cdb332b 100644
--- a/drivers/mmc/core/core.h
+++ b/drivers/mmc/core/core.h
@@ -46,6 +46,10 @@ void mmc_rescan(struct work_struct *work);
 void mmc_start_host(struct mmc_host *host);
 void mmc_stop_host(struct mmc_host *host);
 
+int mmc_attach_mmc(struct mmc_host *host, u32 ocr);
+int mmc_attach_sd(struct mmc_host *host, u32 ocr);
+int mmc_attach_sdio(struct mmc_host *host, u32 ocr);
+
 extern int use_spi_crc;
 
 #endif


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

* Re: [2.6 patch] proper prototypes for mmc_attach_*()
  2008-04-13 18:15 [2.6 patch] proper prototypes for mmc_attach_*() Adrian Bunk
@ 2008-04-16 17:32 ` Pierre Ossman
  2008-04-16 17:58   ` Adrian Bunk
  0 siblings, 1 reply; 3+ messages in thread
From: Pierre Ossman @ 2008-04-16 17:32 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: linux-kernel

On Sun, 13 Apr 2008 21:15:50 +0300
Adrian Bunk <bunk@kernel.org> wrote:

> This patch adds proper prototypes for mmc_attach_*() in 
> drivers/mmc/core/core.h
> 
> Signed-off-by: Adrian Bunk <bunk@kernel.org>
> 

I'm not entirely convinced about these, but seems they seem to bother
you... ;)

-- 
     -- Pierre Ossman

  Linux kernel, MMC maintainer        http://www.kernel.org
  PulseAudio, core developer          http://pulseaudio.org
  rdesktop, core developer          http://www.rdesktop.org

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

* Re: [2.6 patch] proper prototypes for mmc_attach_*()
  2008-04-16 17:32 ` Pierre Ossman
@ 2008-04-16 17:58   ` Adrian Bunk
  0 siblings, 0 replies; 3+ messages in thread
From: Adrian Bunk @ 2008-04-16 17:58 UTC (permalink / raw)
  To: Pierre Ossman; +Cc: linux-kernel

On Wed, Apr 16, 2008 at 07:32:15PM +0200, Pierre Ossman wrote:
> On Sun, 13 Apr 2008 21:15:50 +0300
> Adrian Bunk <bunk@kernel.org> wrote:
> 
> > This patch adds proper prototypes for mmc_attach_*() in 
> > drivers/mmc/core/core.h
> > 
> > Signed-off-by: Adrian Bunk <bunk@kernel.org>
> > 
> 
> I'm not entirely convinced about these, but seems they seem to bother
> you... ;)

With proper prototypes in a header gcc can check that caller and callee 
agree about the function signature.

Otherwise someone might accidentally change only one of them.

That's a rare issue, but when it happens it's a nasty runtime error.

>      -- Pierre Ossman

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


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

end of thread, other threads:[~2008-04-16 17:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-13 18:15 [2.6 patch] proper prototypes for mmc_attach_*() Adrian Bunk
2008-04-16 17:32 ` Pierre Ossman
2008-04-16 17:58   ` Adrian Bunk

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®