Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=852e1f2a2627274102a3c2dc70a6547aeab99cb6
Commit:     852e1f2a2627274102a3c2dc70a6547aeab99cb6
Parent:     b31d8b90dcc6fbe39147863d13b93a8d49d2b341
Author:     Dan Williams <[EMAIL PROTECTED]>
AuthorDate: Mon Dec 10 15:24:47 2007 -0500
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Jan 28 15:06:37 2008 -0800

    libertas: clean up is_command_allowed_in_ps()
    
    Total overkill to have an array when there's only one command in it.
    
    Signed-off-by: Dan Williams <[EMAIL PROTECTED]>
    Signed-off-by: David Woodhouse <[EMAIL PROTECTED]>
    Signed-off-by: John W. Linville <[EMAIL PROTECTED]>
---
 drivers/net/wireless/libertas/cmd.c |   24 +++++++++---------------
 1 files changed, 9 insertions(+), 15 deletions(-)

diff --git a/drivers/net/wireless/libertas/cmd.c 
b/drivers/net/wireless/libertas/cmd.c
index c7c226c..2efba57 100644
--- a/drivers/net/wireless/libertas/cmd.c
+++ b/drivers/net/wireless/libertas/cmd.c
@@ -19,26 +19,20 @@ void lbs_set_cmd_ctrl_node(struct lbs_private *priv,
                    u16 wait_option, void *pdata_buf);
 
 
-static u16 commands_allowed_in_ps[] = {
-       CMD_802_11_RSSI,
-};
-
 /**
- *  @brief This function checks if the commans is allowed
- *  in PS mode not.
+ *  @brief Checks whether a command is allowed in Power Save mode
  *
  *  @param command the command ID
- *  @return       TRUE or FALSE
+ *  @return       1 if allowed, 0 if not allowed
  */
-static u8 is_command_allowed_in_ps(__le16 command)
+static u8 is_command_allowed_in_ps(u16 cmd)
 {
-       int i;
-
-       for (i = 0; i < ARRAY_SIZE(commands_allowed_in_ps); i++) {
-               if (command == cpu_to_le16(commands_allowed_in_ps[i]))
-                       return 1;
+       switch (cmd) {
+       case CMD_802_11_RSSI:
+               return 1;
+       default:
+               break;
        }
-
        return 0;
 }
 
@@ -1715,7 +1709,7 @@ int lbs_execute_next_command(struct lbs_private *priv)
        if (cmdnode) {
                cmdptr = (struct cmd_ds_command *)cmdnode->bufvirtualaddr;
 
-               if (is_command_allowed_in_ps(cmdptr->command)) {
+               if (is_command_allowed_in_ps(le16_to_cpu(cmdptr->command))) {
                        if ((priv->psstate == PS_STATE_SLEEP) ||
                            (priv->psstate == PS_STATE_PRE_SLEEP)) {
                                lbs_deb_host(
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to