Module Name: src Committed By: agc Date: Sun Nov 20 01:23:57 UTC 2011
Modified Files: src/sbin/iscsid: iscsid_discover.c iscsid_driverif.c iscsid_globals.h iscsid_lists.c iscsid_main.c iscsid_targets.c Log Message: simplify code by removing a useless "#define STATIC static" in both debug and normal usage, and all of its uses. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sbin/iscsid/iscsid_discover.c \ src/sbin/iscsid/iscsid_driverif.c src/sbin/iscsid/iscsid_lists.c \ src/sbin/iscsid/iscsid_main.c src/sbin/iscsid/iscsid_targets.c cvs rdiff -u -r1.3 -r1.4 src/sbin/iscsid/iscsid_globals.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sbin/iscsid/iscsid_discover.c diff -u src/sbin/iscsid/iscsid_discover.c:1.2 src/sbin/iscsid/iscsid_discover.c:1.3 --- src/sbin/iscsid/iscsid_discover.c:1.2 Sat Oct 29 16:54:49 2011 +++ src/sbin/iscsid/iscsid_discover.c Sun Nov 20 01:23:57 2011 @@ -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 @@ ISNS_HANDLE isns_handle = ISNS_INVALID_H * 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 @@ xlate_ip(uint8_t *dest, size_t size, voi * Returns: status */ -STATIC uint32_t +static uint32_t get_isns_target_info(isns_t * isns, uint8_t * TargetName) { int retval; @@ -678,7 +678,7 @@ update_isns_server_info(isns_t * isns) * 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; Index: src/sbin/iscsid/iscsid_driverif.c diff -u src/sbin/iscsid/iscsid_driverif.c:1.2 src/sbin/iscsid/iscsid_driverif.c:1.3 --- src/sbin/iscsid/iscsid_driverif.c:1.2 Sat Oct 29 16:54:49 2011 +++ src/sbin/iscsid/iscsid_driverif.c Sun Nov 20 01:23:57 2011 @@ -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 @@ set_node_name(iscsid_set_node_name_req_t * 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 @@ bind_socket(int sock, uint8_t * addr) * 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 @@ find_free_portal(portal_group_t * group) * 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 @@ make_connection(session_t * sess, iscsid * cid Connection ID */ -STATIC void +static void event_recover_connection(uint32_t sid, uint32_t cid) { int sock, ret; Index: src/sbin/iscsid/iscsid_lists.c diff -u src/sbin/iscsid/iscsid_lists.c:1.2 src/sbin/iscsid/iscsid_lists.c:1.3 --- src/sbin/iscsid/iscsid_lists.c:1.2 Sat Oct 29 16:54:49 2011 +++ src/sbin/iscsid/iscsid_lists.c Sun Nov 20 01:23:57 2011 @@ -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 @@ STATIC uint32_t initiator_id = 0; * Parameter: The session pointer. */ -STATIC void +static void verify_session(session_t * sess) { generic_entry_t *curr, *next; @@ -683,7 +683,7 @@ get_connection_info(iscsid_get_connectio * 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; Index: src/sbin/iscsid/iscsid_main.c diff -u src/sbin/iscsid/iscsid_main.c:1.2 src/sbin/iscsid/iscsid_main.c:1.3 --- src/sbin/iscsid/iscsid_main.c:1.2 Sat Oct 29 16:54:49 2011 +++ src/sbin/iscsid/iscsid_main.c Sun Nov 20 01:23:57 2011 @@ -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 @@ int debug_level = ISCSI_DEBUG; /* How mu (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 @@ STATIC uint8_t rsp_buf[RSP_BUFFER_SIZE]; * 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 @@ create_node_name(void) * Returns: <0 on error */ -STATIC int +static int init_daemon(void) { int sock, i; @@ -232,7 +232,7 @@ make_rsp(size_t len, iscsid_response_t * * for static buffer. */ -STATIC void +static void process_message(iscsid_request_t *req, iscsid_response_t **prsp, int *prsp_temp) { iscsid_response_t *rsp; Index: src/sbin/iscsid/iscsid_targets.c diff -u src/sbin/iscsid/iscsid_targets.c:1.2 src/sbin/iscsid/iscsid_targets.c:1.3 --- src/sbin/iscsid/iscsid_targets.c:1.2 Sat Oct 29 16:54:49 2011 +++ src/sbin/iscsid/iscsid_targets.c Sun Nov 20 01:23:57 2011 @@ -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 @@ STATIC uint32_t send_target_id = 0; * 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 @@ delete_portal(portal_t * portal, boolean * 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 @@ create_target(uint8_t * name) * target the pointer to the target */ -STATIC void +static void delete_target(target_t * target) { portal_group_t *cgroup; @@ -239,7 +239,7 @@ delete_target(target_t * target) * 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 @@ create_send_target(uint8_t * name, iscsi * 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 @@ remove_target(iscsid_list_id_t * par) * 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 @@ cl_get_address(iscsi_portal_address_t * */ -STATIC uint32_t +static uint32_t refresh_send_target(uint32_t id) { uint8_t *response_buffer = NULL; @@ -922,7 +922,7 @@ refresh_send_target(uint32_t id) */ -STATIC void +static void cleanup_orphans(iscsi_portal_types_t type) { generic_entry_t *curr; Index: src/sbin/iscsid/iscsid_globals.h diff -u src/sbin/iscsid/iscsid_globals.h:1.3 src/sbin/iscsid/iscsid_globals.h:1.4 --- src/sbin/iscsid/iscsid_globals.h:1.3 Thu Nov 17 16:20:47 2011 +++ src/sbin/iscsid/iscsid_globals.h Sun Nov 20 01:23:57 2011 @@ -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 @@ int debug_level; /* How much info to #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 */