VirtualBox

Ignore:
Timestamp:
Feb 26, 2007 8:14:08 PM (18 years ago)
Author:
vboxsync
Message:

removed dead code; cosmetics

Location:
trunk/src/VBox/Additions/linux/module
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/linux/module/cmc.c

    r1 r1067  
    1919 */
    2020
    21 #if 0
    22   #ifndef bool /* Linux 2.6.19 C++ nightmare */
    23   #define bool bool_type
    24   #define true true_type
    25   #define false false_type
    26   #define _Bool int
    27   #define bool_cmc_c
    28   #endif
    29   #include <linux/autoconf.h>
    30   #include <linux/version.h>
    31   #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 0)
    32   # undef ALIGN
    33   #endif
    34   #ifndef KBUILD_STR
    35   # if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 16)
    36   #  define KBUILD_STR(s) s
    37   # else
    38   #  define KBUILD_STR(s) #s
    39   # endif
    40   #endif
    41   /* Make (at least) RHEL3U5 happy. */
    42   #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)
    43   // # define EXPORT_SYMTAB
    44   #endif
    45   #include <linux/module.h>
    46   #include <linux/kernel.h>
    47   #include <linux/fs.h>
    48   #include <linux/mm.h>
    49   #include <linux/wait.h>
    50   #include <linux/pci.h>
    51   #include <linux/delay.h>
    52   #include <linux/interrupt.h>
    53   #include <linux/completion.h>
    54   #include <asm/uaccess.h>
    55   #ifdef bool_cmc_c
    56   #undef bool
    57   #undef true
    58   #undef false
    59   #undef _Bool
    60   #undef bool_cmc_c
    61   #endif
    62 #endif
    63 
    6421#include "the-linux-kernel.h"
    65 
    66 // What is this for?
    67 // bird: see comment on the other #undef.
    68 #undef ALIGN
    6922#include "vboxmod.h"
    70 /* #include "waitcompat.h" */
    7123
    7224/**
     
    7527 */
    7628static DECLVBGL(void)
    77 vboxadd_hgcm_callback (
    78     VMMDevHGCMRequestHeader *pHeader,
    79     void *pvData,
    80     uint32_t u32Data
    81     )
     29vboxadd_hgcm_callback (VMMDevHGCMRequestHeader *pHeader, void *pvData, uint32_t u32Data)
    8230{
    8331    VBoxDevice *dev = pvData;
    84 
    8532    wait_event (dev->eventq, pHeader->fu32Flags & VBOX_HGCM_REQ_DONE);
    8633}
    8734
    88 static int vboxadd_hgcm_connect (
    89     VBoxDevice *dev,
    90     VBoxGuestHGCMConnectInfo *info
    91     )
     35static int vboxadd_hgcm_connect (VBoxDevice *dev, VBoxGuestHGCMConnectInfo *info)
    9236{
    93     int rc = VbglHGCMConnect (info, vboxadd_hgcm_callback, dev, 0);
    94     return rc;
     37    return VbglHGCMConnect (info, vboxadd_hgcm_callback, dev, 0);
    9538}
    9639
    97 static int vboxadd_hgcm_disconnect (
    98     VBoxDevice *dev,
    99     VBoxGuestHGCMDisconnectInfo *info
    100     )
     40static int vboxadd_hgcm_disconnect (VBoxDevice *dev, VBoxGuestHGCMDisconnectInfo *info)
    10141{
    102     int rc = VbglHGCMDisconnect (info, vboxadd_hgcm_callback, dev, 0);
    103     return rc;
     42    return VbglHGCMDisconnect (info, vboxadd_hgcm_callback, dev, 0);
    10443}
    10544
    106 static int vboxadd_hgcm_call (
    107     VBoxDevice *dev,
    108     VBoxGuestHGCMCallInfo *info
    109     )
     45static int vboxadd_hgcm_call (VBoxDevice *dev, VBoxGuestHGCMCallInfo *info)
    11046{
    111     int rc = VbglHGCMCall (info, vboxadd_hgcm_callback, dev, 0);
    112     return rc;
     47    return VbglHGCMCall (info, vboxadd_hgcm_callback, dev, 0);
    11348}
    11449
     
    14378vboxadd_cmc_ctl_guest_filter_mask (uint32_t or_mask, uint32_t not_mask)
    14479{
    145         int rc;
    146         VMMDevCtlGuestFilterMask *req;
     80    int rc;
     81    VMMDevCtlGuestFilterMask *req;
    14782
    148         rc = VbglGRAlloc ((VMMDevRequestHeader**) &req, sizeof (*req),
    149                           VMMDevReq_CtlGuestFilterMask);
     83    rc = VbglGRAlloc ((VMMDevRequestHeader**) &req, sizeof (*req),
     84                      VMMDevReq_CtlGuestFilterMask);
    15085
    151         if (VBOX_FAILURE (rc)) {
    152                 elog ("VbglGRAlloc (CtlGuestFilterMask) failed rc=%d\n", rc);
    153                 return -1;
    154         }
     86    if (VBOX_FAILURE (rc))
     87    {
     88        elog ("VbglGRAlloc (CtlGuestFilterMask) failed rc=%d\n", rc);
     89        return -1;
     90    }
    15591
    156         req->u32OrMask = or_mask;
    157         req->u32NotMask = not_mask;
     92    req->u32OrMask = or_mask;
     93    req->u32NotMask = not_mask;
    15894
    159         rc = VbglGRPerform (&req->header);
    160         VbglGRFree (&req->header);
    161         if (VBOX_FAILURE (rc)) {
    162                 elog ("VbglGRPerform (CtlGuestFilterMask) failed rc=%d\n", rc);
    163                 return -1;
    164         }
    165         return 0;
     95    rc = VbglGRPerform (&req->header);
     96    VbglGRFree (&req->header);
     97    if (VBOX_FAILURE (rc))
     98    {
     99        elog ("VbglGRPerform (CtlGuestFilterMask) failed rc=%d\n", rc);
     100        return -1;
     101    }
     102    return 0;
    166103}
    167104
  • trunk/src/VBox/Additions/linux/module/vboxmod.c

    r1 r1067  
    2020 */
    2121
    22 #if 0
    23   #ifndef bool /* Linux 2.6.19 C++ nightmare */
    24   # define bool bool_type
    25   # define true true_type
    26   # define false false_type
    27   # define _Bool int
    28   # define bool_vboxmod_c
    29   #endif
    30   #include <linux/autoconf.h>
    31   #include <linux/version.h>
    32   #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 0)
    33   # undef ALIGN
    34   #endif
    35   #ifndef KBUILD_STR
    36   # if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 16)
    37   #  define KBUILD_STR(s) s
    38   # else
    39   #  define KBUILD_STR(s) #s
    40   # endif
    41   #endif
    42   /* Make (at least) RHEL3U5 happy. */
    43   #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)
    44   // # define EXPORT_SYMTAB
    45   #endif
    46   #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 7)
    47   # if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 29) \
    48       || LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 0)
    49   #  define msecs_to_jiffies(x) (((x) * 1000) / HZ)
    50   # endif
    51   #else
    52   # include <linux/time.h>
    53   # include <linux/jiffies.h>
    54   #endif
    55   #include <linux/module.h>
    56   #include <linux/kernel.h>
    57   #include <linux/fs.h>
    58   #include <linux/mm.h>
    59   #include <linux/pci.h>
    60   #include <linux/wait.h>
    61   #include <linux/delay.h>
    62   #include <linux/interrupt.h>
    63   #include <linux/completion.h>
    64   #include <asm/uaccess.h>
    65   #ifdef bool_vboxmod_c
    66   # undef bool
    67   # undef true
    68   # undef false
    69   # undef _Bool
    70   # undef bool_vboxmod_c
    71   #endif
    72 #endif
    73 
    7422#include "the-linux-kernel.h"
    7523
    7624/* #define IRQ_DEBUG */
    77 // What is this for?
    78 // bird: It used to fix a clash between ALIGN in iprt/cdefs.h and system headers.
    79 //       Since I changed that a while back it should be obsoleted by now. Could
    80 //       you please verify that this is actually the case (i.e. no ALIGN references
    81 //       the code or any (of our) headers involved with it) and remove the #undef?
    82 #undef ALIGN
    8325
    8426#include "vboxmod.h"
     
    9234
    9335/* Runtime assert implementation for Linux ring 0 */
    94 RTDECL(void) AssertMsg1(
    95     const char *pszExpr,
    96     unsigned uLine,
    97     const char *pszFile,
    98     const char *pszFunction
    99     )
     36RTDECL(void) AssertMsg1(const char *pszExpr, unsigned uLine,
     37                        const char *pszFile, const char *pszFunction)
    10038{
    10139    elog ("!!Assertion Failed!!\n"
     
    180118 */
    181119static void
    182 vboxadd_wait_for_event_helper (
    183     VBoxDevice *dev,
    184     long timeout,
    185     uint32_t in_mask,
    186     uint32_t * out_mask
    187     )
     120vboxadd_wait_for_event_helper (VBoxDevice *dev, long timeout,
     121                               uint32_t in_mask, uint32_t * out_mask)
    188122{
    189123    BUG ();
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette