[Myrinet] _gm_get_globals unused code?

Pete Wyckoff <[email protected]>
Newsgroups gmane.network.myrinet.general
Message-ID <[email protected]>
Why do you bother to copy out the globals from the NIC to a temp array
in the kernel, just to copy again out of the card to user space?
Maybe you meant to copy from the temp buffer to user space instead?
Why bother to copy at all?

		-- Pete

libgm/_gm_get_globals.c:51 in gm-1.5.1_Linux

  {
    void *globals, *globals_copy;
    gm_status_t ret;

    /* The GLOBALS scratch var and cast are required to prevent
       compiler warnings with gcc. */

    globals = (void *) is->lanai.globals;
    globals_copy = gm_malloc (length+8);
    if (!globals_copy)
      return GM_OUT_OF_MEMORY;

    __gm_ntok_bcopy (is, globals, globals_copy, length);
    GM_PRINT (GM_DEBUG_GET_GLOBALS,
              ("_gm_get_globals copying 0x%x bytes to %p\n", length, ptr));
    ret = gm_copyout (ps, globals, (void *) ptr, length);
    gm_free (globals_copy);
    return ret;
  }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.