netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Denis Vlasenko <vda@ilport.com.ua>
To: "Carlos Martín" <carlos@cmartin.tk>
Cc: netdev@vger.kernel.org, acx100-devel@lists.sourceforge.net,
	"Christoph Hellwig" <hch@infradead.org>
Subject: Re: [PATH][RFC] acxsm: Make acx mdoular again
Date: Mon, 27 Feb 2006 12:20:14 +0200	[thread overview]
Message-ID: <200602271220.14853.vda@ilport.com.ua> (raw)
In-Reply-To: <200602261710.33923.carlos@cmartin.tk>

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

On Sunday 26 February 2006 18:10, Carlos Martín wrote:
> Hi,
> 
> Well, here it is. I've not been able to run-test it yet, but it at least 
> compiles and loads without problems. This is on x86_64 compiled against 
> Linville's wireless-2.6 git tree. (I don't have any x86 boxes running Linux 
> right now, but it should be alright).
> 
> I've added a struct acx_ops with function pointers and deleted the functions 
> that just call the PCI/USB version depending on what we're using at the 
> moment. A few functions I've just made empty to simplify and not having to 
> check every time wether we do have it or not. These are only called on 
> load/unload and error conditions. Normal operation shouldn't suffer any speed 
> decrease it may be faster at times because we dereference a few pointers 
> instead of calling a couple of functions (just guessing, though).
> 
> The patch is 38K uncompressed. I've compressed and attached it and uploaded to 
> http://www.cmartin.tk/acx/acxsm-modularise.patch
> 
>    text    data     bss     dec     hex filename
>   55491     588       4   56083    db13 acx-common.ko
>   33523    1040       4   34567    8707 acx-pci.ko
>   17109    1008       0   18117    46c5 acx-usb.ko
> 
> Comments are welcome and I'll split the patch if needed.

usb.c
=====
#define BOGUS_SAFETY_PADDING 0x40

int
acxusb_s_issue_cmd_timeo(
        acx_device_t *adev,
        unsigned cmd,
        void *buffer,
        unsigned buflen,
        unsigned timeout)
{
#if ACX_DEBUG
        return acx_s_issue_cmd_timeo_debug(adev, cmd, buffer, buflen, timeout, __stringify(cmd));
#else
        return acx_s_issue_cmd_timeo_debug(adev, cmd, buffer, buflen, timeout);
#endif
}

stringify what? We want symbolic command name, not it's numeric value.
stringifying must occur in .h file.


acx_func.h
==========
#if ACX_DEBUG

/* We want to log cmd names */
int acxpci_s_issue_cmd_timeo_debug(acx_device_t *adev, unsigned cmd, void *param, unsigned len, unsigned timeout, const char* cmdstr);
int acxusb_s_issue_cmd_timeo_debug(acx_device_t *adev, unsigned cmd, void *param, unsigned len, unsigned timeout, const char* cmdstr);
static inline int
acx_s_issue_cmd_timeo_debug(acx_device_t *adev, unsigned cmd, void *param, unsigned len, unsigned timeout, const char* cmdstr)
{
        if (IS_PCI(adev))
                return acxpci_s_issue_cmd_timeo_debug(adev, cmd, param, len, timeout, cmdstr);
        return acxusb_s_issue_cmd_timeo_debug(adev, cmd, param, len, timeout, cmdstr);
}
int acx_s_issue_cmd(acx_device_t *adev, unsigned cmd, void *param, unsigned len);

It will recurse: acx_s_issue_cmd_timeo_debug -> acxusb_s_issue_cmd_timeo_debug -> acx_s_issue_cmd_timeo_debug ->....
Why do you need if (IS_PCI(adev)) at all?

Please apply the attached style fixes on top of your patches.

Patch is not applied. Sorry.
--
vda

[-- Attachment #2: acxsm-modularise2.patch --]
[-- Type: text/x-diff, Size: 2161 bytes --]

diff -urpN current_sm.1/acx_func.h current_sm.2/acx_func.h
--- current_sm.1/acx_func.h	Mon Feb 27 12:13:27 2006
+++ current_sm.2/acx_func.h	Mon Feb 27 12:10:32 2006
@@ -444,7 +444,7 @@ int acx_s_interrogate_debug(acx_device_t
 #else
 
 
-/* We can't make this a #define or inline because we need to referece it. */
+/* We can't make this a #define or inline because we need to reference it. */
 int acx_s_issue_cmd(acx_device_t *adev, unsigned cmd, void *param, unsigned len);
 
 int acxpci_s_issue_cmd_timeo(acx_device_t *adev, unsigned cmd, void *param, unsigned len, unsigned timeout);
diff -urpN current_sm.1/common.c current_sm.2/common.c
--- current_sm.1/common.c	Mon Feb 27 12:13:28 2006
+++ current_sm.2/common.c	Mon Feb 27 12:06:33 2006
@@ -331,10 +331,11 @@ acx_log_fn_exit_v(const char *funcname, 
 EXPORT_SYMBOL_GPL(acx_log_fn_exit_v);
 #endif /* ACX_DEBUG > 1 */
 
-int acx_s_issue_cmd(acx_device_t *adev, unsigned cmd, void *param, unsigned len)
+int
+acx_s_issue_cmd(acx_device_t *adev, unsigned cmd, void *param, unsigned len)
 {
-  return adev->ops.issue_cmd_timeo(adev, cmd, param, len,
-				   ACX_CMD_TIMEOUT_DEFAULT);
+	return adev->ops.issue_cmd_timeo(adev, cmd, param, len,
+				ACX_CMD_TIMEOUT_DEFAULT);
 }
 
 EXPORT_SYMBOL_GPL(acx_s_issue_cmd);
@@ -1940,7 +1941,7 @@ acx_s_scan_chan(acx_device_t *adev)
 	FN_EXIT0;
 }
 
- EXPORT_SYMBOL_GPL(acx_s_scan_chan);
+EXPORT_SYMBOL_GPL(acx_s_scan_chan);
 
 void
 acx_s_cmd_start_scan(acx_device_t *adev)
@@ -2059,7 +2060,7 @@ acx111_s_feature_set(acx_device_t *adev,
 /***********************************************************************
 ** acx100_s_init_memory_pools
 */
-int
+static int
 acx100_s_init_memory_pools(acx_device_t *adev, const acx_ie_memmap_t *mmt)
 {
 	acx100_ie_memblocksize_t MemoryBlockSize;
diff -urpN current_sm.1/pci.c current_sm.2/pci.c
--- current_sm.1/pci.c	Mon Feb 27 12:13:28 2006
+++ current_sm.2/pci.c	Mon Feb 27 12:08:30 2006
@@ -3089,7 +3089,11 @@ end:
 	return (tx_t*)txdesc;
 }
 
-void acxpci_l_dealloc_tx(tx_t *tx_opaque){}
+void
+acxpci_l_dealloc_tx(tx_t *tx_opaque)
+{
+}
+
 
 /***********************************************************************
 */

       reply	other threads:[~2006-02-27 10:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200602261710.33923.carlos@cmartin.tk>
2006-02-27 10:20 ` Denis Vlasenko [this message]
2006-02-27 10:44   ` [PATH][RFC] acxsm: Make acx mdoular again Carlos Martín
2006-02-28  1:34     ` John W. Linville
2006-02-28  6:12       ` Denis Vlasenko
2006-03-01 13:58       ` [PATCH] wireless.git: update acxsm to 0.4.7 Denis Vlasenko
2006-03-21 19:10         ` John W. Linville

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=200602271220.14853.vda@ilport.com.ua \
    --to=vda@ilport.com.ua \
    --cc=acx100-devel@lists.sourceforge.net \
    --cc=carlos@cmartin.tk \
    --cc=hch@infradead.org \
    --cc=netdev@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 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).