From: Michael Still <mikal@stillhq.com>
To: kernel-janitors@vger.kernel.org
Subject: Re: [Kernel-janitors] [PATHC] fix ide.c warning
Date: Wed, 14 Apr 2004 21:10:02 +0000 [thread overview]
Message-ID: <407DA8AA.5060801@stillhq.com> (raw)
In-Reply-To: <200404140217.i3E2Hrgn023951@p-chan.krl.com>
[-- Attachment #1: Type: text/plain, Size: 1428 bytes --]
Luiz Fernando N. Capitulino wrote:
> Hi Don,
>
> Em Tue, 13 Apr 2004 22:17:53 -0400
> Don Koch <aardvark@krl.com> escreveu:
>
> | This fixes the "implicit declaration of function `pnpide_init'" warning
> | in ide.c. Based on 2.6.5-mm5.
> |
> | ===== drivers/ide/ide.c 1.132 vs edited =====
> | --- 1.132/drivers/ide/ide.c Sat Apr 10 18:22:11 2004
> | +++ edited/drivers/ide/ide.c Tue Apr 13 20:59:52 2004
> | @@ -2245,7 +2245,10 @@
> | return 1;
> | }
> | #if defined(CONFIG_BLK_DEV_IDEPNP) && defined(CONFIG_PNP) && defined(MODULE)
> | - pnpide_init(0);
> | + {
> | + extern void pnpide_init(int enable);
> | + pnpide_init(0);
> | + }
> | #endif /* CONFIG_BLK_DEV_IDEPNP */
> | #ifdef CONFIG_PROC_FS
> | ide_remove_proc_entries(drive->proc, DRIVER(drive)->proc);
>
> what about to declare pnpide_init() in include/linux/ide.h (like ide_end_request),
> and just call it ? It is a bad idea ?
I would think it's much better form to either:
- put the prototype in a header
- repeat the prototype at the top of this file (there are risks here)
With the first one being much prefered in my book. It's just not
idiomatic in C to do it this way. You also don't need the extern:
void pnpide_init(int enable);
should be sufficient.
Additionally, putting that block of code in braces is evil.
Cheers,
Mikal
PS: I didn't look at the definition of pnpide_init, and assume it's not
static or something.
[-- Attachment #2: Type: text/plain, Size: 167 bytes --]
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors
next prev parent reply other threads:[~2004-04-14 21:10 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-04-14 2:17 [Kernel-janitors] [PATHC] fix ide.c warning Don Koch
2004-04-14 18:02 ` Luiz Fernando N. Capitulino
2004-04-14 21:10 ` Michael Still [this message]
2004-04-14 21:17 ` Don Koch
2004-04-14 21:33 ` Luiz Fernando N. Capitulino
2004-04-14 21:39 ` Luiz Fernando N. Capitulino
2004-04-14 22:58 ` Michael Still
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=407DA8AA.5060801@stillhq.com \
--to=mikal@stillhq.com \
--cc=kernel-janitors@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.