Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sbin/iscsid simplify code by removing a useless "#define STA...



details:   https://anonhg.NetBSD.org/src/rev/7fe6155603bb
branches:  trunk
changeset: 771420:7fe6155603bb
user:      agc <agc%NetBSD.org@localhost>
date:      Sun Nov 20 01:23:57 2011 +0000

description:
simplify code by removing a useless "#define STATIC static" in both debug
and normal usage, and all of its uses.

diffstat:

 sbin/iscsid/iscsid_discover.c |   8 ++++----
 sbin/iscsid/iscsid_driverif.c |  10 +++++-----
 sbin/iscsid/iscsid_globals.h  |   6 +-----
 sbin/iscsid/iscsid_lists.c    |   8 ++++----
 sbin/iscsid/iscsid_main.c     |  12 ++++++------
 sbin/iscsid/iscsid_targets.c  |  22 +++++++++++-----------
 6 files changed, 31 insertions(+), 35 deletions(-)

diffs (283 lines):

diff -r 47469dd202b5 -r 7fe6155603bb sbin/iscsid/iscsid_discover.c
--- a/sbin/iscsid/iscsid_discover.c     Sun Nov 20 01:14:17 2011 +0000
+++ b/sbin/iscsid/iscsid_discover.c     Sun Nov 20 01:23:57 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: iscsid_discover.c,v 1.2 2011/10/29 16:54:49 christos Exp $     */
+/*     $NetBSD: iscsid_discover.c,v 1.3 2011/11/20 01:23:57 agc Exp $  */
 
 /*-
  * Copyright (c) 2005,2006,2011 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
  * Returns:     status
  */
 
-STATIC void
+static void
 xlate_ip(uint8_t *dest, size_t size, void *data)
 {
        uint16_t *wdt = (uint16_t *) data;
@@ -98,7 +98,7 @@
  * Returns:     status
  */
 
-STATIC uint32_t
+static uint32_t
 get_isns_target_info(isns_t * isns, uint8_t * TargetName)
 {
        int retval;
@@ -678,7 +678,7 @@
  *    Returns:    Pointer to isns structure, NULL if allocation failed.
  */
 
-STATIC isns_t *
+static isns_t *
 create_isns(iscsid_add_isns_server_req_t * req)
 {
        isns_t *isns;
diff -r 47469dd202b5 -r 7fe6155603bb sbin/iscsid/iscsid_driverif.c
--- a/sbin/iscsid/iscsid_driverif.c     Sun Nov 20 01:14:17 2011 +0000
+++ b/sbin/iscsid/iscsid_driverif.c     Sun Nov 20 01:23:57 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: iscsid_driverif.c,v 1.2 2011/10/29 16:54:49 christos Exp $     */
+/*     $NetBSD: iscsid_driverif.c,v 1.3 2011/11/20 01:23:57 agc Exp $  */
 
 /*-
  * Copyright (c) 2005,2006,2011 The NetBSD Foundation, Inc.
@@ -100,7 +100,7 @@
  *       TRUE on success, FALSE on error.
  */
 
-STATIC int
+static int
 bind_socket(int sock, uint8_t * addr)
 {
        struct sockaddr_in serverAddress;
@@ -134,7 +134,7 @@
  *    Returns:    The pointer to the first free portal (or NULL if none found)
  */
 
-STATIC portal_t *
+static portal_t *
 find_free_portal(portal_group_t * group)
 {
        portal_t *curr, *m;
@@ -176,7 +176,7 @@
  *    NOTE: Session list must be locked on entry.
  */
 
-STATIC connection_t *
+static connection_t *
 make_connection(session_t * sess, iscsid_login_req_t * req,
                                iscsid_response_t * res, uint32_t * stid)
 {
@@ -501,7 +501,7 @@
  *          cid         Connection ID
  */
 
-STATIC void
+static void
 event_recover_connection(uint32_t sid, uint32_t cid)
 {
        int sock, ret;
diff -r 47469dd202b5 -r 7fe6155603bb sbin/iscsid/iscsid_globals.h
--- a/sbin/iscsid/iscsid_globals.h      Sun Nov 20 01:14:17 2011 +0000
+++ b/sbin/iscsid/iscsid_globals.h      Sun Nov 20 01:23:57 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: iscsid_globals.h,v 1.3 2011/11/17 16:20:47 joerg Exp $ */
+/*     $NetBSD: iscsid_globals.h,v 1.4 2011/11/20 01:23:57 agc Exp $   */
 
 /*-
  * Copyright (c) 2005,2006,2011 The NetBSD Foundation, Inc.
@@ -386,15 +386,11 @@
 #define DEBOUT(x) printf x
 #define DEB(lev,x) {if (debug_level >= lev) printf x ;}
 
-#define STATIC static
-
 #else
 
 #define DEBOUT(x)
 #define DEB(lev,x)
 
-#define STATIC static
-
 #endif
 
 /* Session list protection shortcuts */
diff -r 47469dd202b5 -r 7fe6155603bb sbin/iscsid/iscsid_lists.c
--- a/sbin/iscsid/iscsid_lists.c        Sun Nov 20 01:14:17 2011 +0000
+++ b/sbin/iscsid/iscsid_lists.c        Sun Nov 20 01:23:57 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: iscsid_lists.c,v 1.2 2011/10/29 16:54:49 christos Exp $        */
+/*     $NetBSD: iscsid_lists.c,v 1.3 2011/11/20 01:23:57 agc Exp $     */
 
 /*-
  * Copyright (c) 2005,2006,2011 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #include "iscsid_globals.h"
 
 /* counter for initiator ID */
-STATIC uint32_t initiator_id = 0;
+static uint32_t initiator_id = 0;
 
 /* -------------------------------------------------------------------------- */
 
@@ -47,7 +47,7 @@
  * Parameter:  The session pointer.
  */
 
-STATIC void
+static void
 verify_session(session_t * sess)
 {
        generic_entry_t *curr, *next;
@@ -683,7 +683,7 @@
  *    Returns:    The pointer to the portal (or NULL if not found)
  */
 
-STATIC initiator_t *
+static initiator_t *
 find_initiator_by_addr(uint8_t * addr)
 {
        generic_entry_t *curr;
diff -r 47469dd202b5 -r 7fe6155603bb sbin/iscsid/iscsid_main.c
--- a/sbin/iscsid/iscsid_main.c Sun Nov 20 01:14:17 2011 +0000
+++ b/sbin/iscsid/iscsid_main.c Sun Nov 20 01:23:57 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: iscsid_main.c,v 1.2 2011/10/29 16:54:49 christos Exp $ */
+/*     $NetBSD: iscsid_main.c,v 1.3 2011/11/20 01:23:57 agc Exp $      */
 
 /*-
  * Copyright (c) 2005,2006,2011 The NetBSD Foundation, Inc.
@@ -63,8 +63,8 @@
    (which it normally shouldn't, assuming we don't have thousands
    of list entries).
 */
-STATIC uint8_t req_buf[REQ_BUFFER_SIZE];       /* default buffer for requests */
-STATIC uint8_t rsp_buf[RSP_BUFFER_SIZE];       /* default buffer for responses */
+static uint8_t req_buf[REQ_BUFFER_SIZE];       /* default buffer for requests */
+static uint8_t rsp_buf[RSP_BUFFER_SIZE];       /* default buffer for responses */
 
 /* -------------------------------------------------------------------------- */
 
@@ -76,7 +76,7 @@
  *    Returns 0 on success, else an error code.
  */
 
-STATIC int
+static int
 create_node_name(void)
 {
        iscsi_set_node_name_parameters_t snp;
@@ -117,7 +117,7 @@
  *    Returns:    <0 on error
  */
 
-STATIC int
+static int
 init_daemon(void)
 {
        int sock, i;
@@ -232,7 +232,7 @@
  *                      for static buffer.
  */
 
-STATIC void
+static void
 process_message(iscsid_request_t *req, iscsid_response_t **prsp, int *prsp_temp)
 {
        iscsid_response_t *rsp;
diff -r 47469dd202b5 -r 7fe6155603bb sbin/iscsid/iscsid_targets.c
--- a/sbin/iscsid/iscsid_targets.c      Sun Nov 20 01:14:17 2011 +0000
+++ b/sbin/iscsid/iscsid_targets.c      Sun Nov 20 01:23:57 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: iscsid_targets.c,v 1.2 2011/10/29 16:54:49 christos Exp $      */
+/*     $NetBSD: iscsid_targets.c,v 1.3 2011/11/20 01:23:57 agc Exp $   */
 
 /*-
  * Copyright (c) 2005,2006,2011 The NetBSD Foundation, Inc.
@@ -34,10 +34,10 @@
 #include <ctype.h>
 
 /* counter for portal and target ID */
-STATIC uint32_t portarget_id = 0;
+static uint32_t portarget_id = 0;
 
 /* counter for send_targets ID */
-STATIC uint32_t send_target_id = 0;
+static uint32_t send_target_id = 0;
 
 
 /*
@@ -55,7 +55,7 @@
  *    Returns:    pointer to created portal
  */
 
-STATIC portal_t *
+static portal_t *
 create_portal(target_t *target, iscsi_portal_address_t *addr,
                          iscsi_portal_types_t dtype, uint32_t did)
 {
@@ -167,7 +167,7 @@
  *    Returns:    Pointer to target structure, NULL if allocation failed.
  */
 
-STATIC target_t *
+static target_t *
 create_target(uint8_t * name)
 {
        target_t *target;
@@ -204,7 +204,7 @@
  *       target   the pointer to the target
  */
 
-STATIC void
+static void
 delete_target(target_t * target)
 {
        portal_group_t *cgroup;
@@ -239,7 +239,7 @@
  *    Returns:    Pointer to structure, NULL if allocation failed.
  */
 
-STATIC target_t *
+static target_t *
 create_send_target(uint8_t * name, iscsi_portal_address_t * addr)
 {
        send_target_t *target;
@@ -271,7 +271,7 @@
  *       send_target   the pointer to the send_target
  */
 
-STATIC void
+static void
 delete_send_target(send_target_t * send_target)
 {
        generic_entry_t *curr;
@@ -736,7 +736,7 @@
  *    Returns:    0 on error, 1 if OK.
  */
 
-STATIC int
+static int
 cl_get_address(iscsi_portal_address_t * portal, char *str)
 {
        char *sp, *sp2;
@@ -802,7 +802,7 @@
  */
 
 
-STATIC uint32_t
+static uint32_t
 refresh_send_target(uint32_t id)
 {
        uint8_t *response_buffer = NULL;
@@ -922,7 +922,7 @@
  */
 
 
-STATIC void
+static void
 cleanup_orphans(iscsi_portal_types_t type)
 {
        generic_entry_t *curr;



Home | Main Index | Thread Index | Old Index