* [PATCH][ATM]: [lanai] ioctl only meant for debugging (from mitch@sfgoth.com)
@ 2003-09-22 17:03 chas williams
2003-09-22 17:07 ` Christoph Hellwig
0 siblings, 1 reply; 7+ messages in thread
From: chas williams @ 2003-09-22 17:03 UTC (permalink / raw)
To: davem; +Cc: netdev
pleae apply to 2.4. --thanks
# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
# ChangeSet 1.1115 -> 1.1116
# drivers/atm/lanai.c 1.4 -> 1.5
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/09/22 chas@relax.cmf.nrl.navy.mil 1.1116
# [ATM]: [lanai] ioctl only meant for debugging (from mitch@sfgoth.com)
# --------------------------------------------
#
diff -Nru a/drivers/atm/lanai.c b/drivers/atm/lanai.c
--- a/drivers/atm/lanai.c Mon Sep 22 13:01:23 2003
+++ b/drivers/atm/lanai.c Mon Sep 22 13:01:23 2003
@@ -2574,6 +2574,7 @@
/* NOTE: these are all DEBUGGING ONLY currently */
static int lanai_ioctl(struct atm_dev *atmdev, unsigned int cmd, void *arg)
{
+#if 0
int result = 0;
struct lanai_dev *lanai = (struct lanai_dev *) atmdev->dev_data;
switch(cmd) {
@@ -2653,6 +2654,10 @@
result = -EINVAL;
}
return result;
+#else /* !0 */
+ (void) atmdev; (void) cmd; (void) arg; /* no compiler warnings */
+ return -ENOIOCTLCMD;
+#endif /* 0 */
}
static int lanai_send(struct atm_vcc *atmvcc, struct sk_buff *skb)
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH][ATM]: [lanai] ioctl only meant for debugging (from mitch@sfgoth.com)
2003-09-22 17:03 [PATCH][ATM]: [lanai] ioctl only meant for debugging (from mitch@sfgoth.com) chas williams
@ 2003-09-22 17:07 ` Christoph Hellwig
2003-09-22 17:55 ` chas williams
0 siblings, 1 reply; 7+ messages in thread
From: Christoph Hellwig @ 2003-09-22 17:07 UTC (permalink / raw)
To: chas3; +Cc: davem, netdev
Umm, shouldn't you just ifdef out the whole function and it's
assignment to the operations vector? This looks horribly ugly..
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH][ATM]: [lanai] ioctl only meant for debugging (from mitch@sfgoth.com)
2003-09-22 17:07 ` Christoph Hellwig
@ 2003-09-22 17:55 ` chas williams
2003-09-22 18:00 ` Christoph Hellwig
2003-09-23 10:57 ` David S. Miller
0 siblings, 2 replies; 7+ messages in thread
From: chas williams @ 2003-09-22 17:55 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: davem, netdev
In message <20030922180749.A26432@infradead.org>,Christoph Hellwig writes:
>Umm, shouldn't you just ifdef out the whole function and it's
>assignment to the operations vector? This looks horribly ugly..
i suppose i am not convinced that two #ifdef/#endif's are better than an
#if/#else/#endif
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH][ATM]: [lanai] ioctl only meant for debugging (from mitch@sfgoth.com)
2003-09-22 17:55 ` chas williams
@ 2003-09-22 18:00 ` Christoph Hellwig
2003-09-23 4:45 ` Mitchell Blank Jr
2003-09-23 10:57 ` David S. Miller
1 sibling, 1 reply; 7+ messages in thread
From: Christoph Hellwig @ 2003-09-22 18:00 UTC (permalink / raw)
To: chas williams; +Cc: Christoph Hellwig, davem, netdev
On Mon, Sep 22, 2003 at 01:55:07PM -0400, chas williams wrote:
> In message <20030922180749.A26432@infradead.org>,Christoph Hellwig writes:
> >Umm, shouldn't you just ifdef out the whole function and it's
> >assignment to the operations vector? This looks horribly ugly..
>
> i suppose i am not convinced that two #ifdef/#endif's are better than an
> #if/#else/#endif
first ifdefs in a function are always worse than around functions,
second ifdefs in a function that make it a stuv are pretty ugly and
third your (void)arg crap is ugly as hell. (what compiler do you have
that complains about this, btw, gcc 3.3 doesn't..).
So if you prefer one if/else/endif you can do it as
#if FOO
foo_ioctl()
{
}
#else
#define foo_ioctl NULL
#endif
but in the case of assigning a function pointer to an operation vector
I find this more confusing than the above variant.
---end quoted text---
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH][ATM]: [lanai] ioctl only meant for debugging (from mitch@sfgoth.com)
2003-09-22 18:00 ` Christoph Hellwig
@ 2003-09-23 4:45 ` Mitchell Blank Jr
0 siblings, 0 replies; 7+ messages in thread
From: Mitchell Blank Jr @ 2003-09-23 4:45 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: chas williams, davem, netdev
Christoph Hellwig wrote (in two different emails):
> Umm, shouldn't you just ifdef out the whole function and it's
> assignment to the operations vector? This looks horribly ugly..
Sorry for any ugliness - its my fault. I personally don't think it really
makes a difference either way. Its already #ifdef'ed the same way in 2.6.
> and
> third your (void)arg crap is ugly as hell. (what compiler do you have
> that complains about this, btw, gcc 3.3 doesn't..).
"gcc -Wunused-parameter"
It's true that the kernel doesn't compile with that option but I've gotten
in the habit of adding the "(void) x;" from working on other projects that
do. I think it's pretty harmless.
> #if FOO
> foo_ioctl()
> {
> }
> #else
> #define foo_ioctl NULL
> #endif
Yes, that would probably be (a bit) cleaner. That's what we already
use for lanai_proc_read if !CONFIG_PROC_FS
-Mitch
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH][ATM]: [lanai] ioctl only meant for debugging (from mitch@sfgoth.com)
2003-09-22 17:55 ` chas williams
2003-09-22 18:00 ` Christoph Hellwig
@ 2003-09-23 10:57 ` David S. Miller
2003-09-23 11:42 ` chas williams
1 sibling, 1 reply; 7+ messages in thread
From: David S. Miller @ 2003-09-23 10:57 UTC (permalink / raw)
To: chas williams; +Cc: hch, netdev
On Mon, 22 Sep 2003 13:55:07 -0400
chas williams <chas@cmf.nrl.navy.mil> wrote:
> i suppose i am not convinced that two #ifdef/#endif's are better than an
> #if/#else/#endif
True, but how about we use an LANAI_DEBUG or something instead of "#if
0" that can sit undef'd at the top of the file?
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH][ATM]: [lanai] ioctl only meant for debugging (from mitch@sfgoth.com)
2003-09-23 10:57 ` David S. Miller
@ 2003-09-23 11:42 ` chas williams
0 siblings, 0 replies; 7+ messages in thread
From: chas williams @ 2003-09-23 11:42 UTC (permalink / raw)
To: David S. Miller; +Cc: hch, netdev, mitch
In message <20030923035729.2aa1afd6.davem@redhat.com>,"David S. Miller" writes:
>On Mon, 22 Sep 2003 13:55:07 -0400
>chas williams <chas@cmf.nrl.navy.mil> wrote:
>
>> i suppose i am not convinced that two #ifdef/#endif's are better than an
>> #if/#else/#endif
>
>True, but how about we use an LANAI_DEBUG or something instead of "#if
>0" that can sit undef'd at the top of the file?
i suppose i might suggest DEBUG_RW which already exists in the code.
/*
* Debug _all_ register operations with card, except the memory test.
* Also disables the timed poll to prevent extra chattiness. This
* isn't for normal use
*/
#undef DEBUG_RW
DEBUG seems to be typically defined so isnt a great choice. any
comments mitch?
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2003-09-23 11:42 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-09-22 17:03 [PATCH][ATM]: [lanai] ioctl only meant for debugging (from mitch@sfgoth.com) chas williams
2003-09-22 17:07 ` Christoph Hellwig
2003-09-22 17:55 ` chas williams
2003-09-22 18:00 ` Christoph Hellwig
2003-09-23 4:45 ` Mitchell Blank Jr
2003-09-23 10:57 ` David S. Miller
2003-09-23 11:42 ` chas williams
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).