Unused variable resets, unused SlapReply parameters to some functions.
                         * to do no harm to entries */
                        rs.sr_entry = e;
                        rc = backend_operational( op, &rs );
-                       rs.sr_entry = NULL;
- 
+
                        if ( rc == LDAP_SUCCESS ) {
                                if ( rs.sr_operational_attrs ) {
                                        freeattr = 1;
                                 * to do no harm to entries */
                                rs.sr_entry = e;
                                rc = backend_operational( op, &rs );
-                               rs.sr_entry = NULL;
 
                                if ( rc == LDAP_SUCCESS ) {
                                        if ( rs.sr_operational_attrs ) {
 
 }
 
 static int
-constraint_violation( constraint *c, struct berval *bv, Operation *op, SlapReply *rs)
+constraint_violation( constraint *c, struct berval *bv, Operation *op )
 {
        if ((!c) || (!bv)) return LDAP_SUCCESS;
        
                slap_callback cb;
                SlapReply nrs = { REP_RESULT };
                int i;
-               int found;
+               int found = 0;
                int rc;
                size_t len;
                struct berval filterstr;
                char *ptr;
 
-               found = 0;
-
-               nrs.sr_entry = NULL;
-               nrs.sr_nentries = 0;
-
                cb.sc_next = NULL;
                cb.sc_response = constraint_uri_cb;
                cb.sc_cleanup = NULL;
 
                if (!found)
                        return LDAP_CONSTRAINT_VIOLATION; /* constraint violation */
-                       
        }
 
        return LDAP_SUCCESS;
                        }
 
                        for ( i = 0; b[i].bv_val; i++ ) {
-                               rc = constraint_violation( cp, &b[i], op, rs );
+                               rc = constraint_violation( cp, &b[i], op );
                                if ( rc ) {
                                        goto add_violation;
                                }
                                continue;
 
                        for ( i = 0; b[i].bv_val; i++ ) {
-                               rc = constraint_violation( cp, &b[i], op, rs );
+                               rc = constraint_violation( cp, &b[i], op );
                                if ( rc ) {
                                        goto mod_violation;
                                }
 
 /*
  * response callback that adds memberof values when a group is modified.
  */
-static int
+static void
 memberof_value_modify(
        Operation               *op,
-       SlapReply               *rs,
        struct berval           *ndn,
        AttributeDescription    *ad,
        struct berval           *old_dn,
         * add will fail; better split in two operations, although
         * not optimal in terms of performance.  At least it would
         * move towards self-repairing capabilities. */
-
-       return rs2.sr_err;
 }
 
 static int
                
                                /* the modification is attempted
                                 * with the original identity */
-                               (void)memberof_value_modify( op, rs,
+                               memberof_value_modify( op,
                                        &ma->a_nvals[ i ], mo->mo_ad_member,
                                        NULL, NULL, &op->o_req_dn, &op->o_req_ndn );
                        }
                                a = attrs_find( a->a_next, mo->mo_ad_member ) )
                {
                        for ( i = 0; !BER_BVISNULL( &a->a_nvals[ i ] ); i++ ) {
-                               (void)memberof_value_modify( op, rs,
+                               memberof_value_modify( op,
                                                &a->a_nvals[ i ],
                                                mo->mo_ad_memberof,
                                                NULL, NULL,
        vals = mci->member;
        if ( vals != NULL ) {
                for ( i = 0; !BER_BVISNULL( &vals[ i ] ); i++ ) {
-                       (void)memberof_value_modify( op, rs,
+                       memberof_value_modify( op,
                                        &vals[ i ], mo->mo_ad_memberof,
                                        &op->o_req_dn, &op->o_req_ndn,
                                        NULL, NULL );
                vals = mci->memberof;
                if ( vals != NULL ) {
                        for ( i = 0; !BER_BVISNULL( &vals[ i ] ); i++ ) {
-                               (void)memberof_value_modify( op, rs,
+                               memberof_value_modify( op,
                                                &vals[ i ], mo->mo_ad_member,
                                                &op->o_req_dn, &op->o_req_ndn,
                                                NULL, NULL );
                case LDAP_MOD_DELETE:
                        if ( vals != NULL ) {
                                for ( i = 0; !BER_BVISNULL( &vals[ i ] ); i++ ) {
-                                       memberof_value_modify( op, rs,
+                                       memberof_value_modify( op,
                                                        &vals[ i ], mo->mo_ad_member,
                                                        &op->o_req_dn, &op->o_req_ndn,
                                                        NULL, NULL );
                        op->o_bd->bd_info = (BackendInfo *)on;
                        if ( rc == LDAP_SUCCESS ) {
                                for ( i = 0; !BER_BVISNULL( &vals[ i ] ); i++ ) {
-                                       (void)memberof_value_modify( op, rs,
+                                       memberof_value_modify( op,
                                                        &vals[ i ], mo->mo_ad_member,
                                                        &op->o_req_dn, &op->o_req_ndn,
                                                        NULL, NULL );
                        assert( vals != NULL );
 
                        for ( i = 0; !BER_BVISNULL( &vals[ i ] ); i++ ) {
-                               memberof_value_modify( op, rs,
+                               memberof_value_modify( op,
                                                &vals[ i ], mo->mo_ad_member,
                                                NULL, NULL,
                                                &op->o_req_dn, &op->o_req_ndn );
                                vals = ml->sml_nvalues;
                                if ( vals != NULL ) {
                                        for ( i = 0; !BER_BVISNULL( &vals[ i ] ); i++ ) {
-                                               memberof_value_modify( op, rs,
+                                               memberof_value_modify( op,
                                                                &vals[ i ], mo->mo_ad_memberof,
                                                                &op->o_req_dn, &op->o_req_ndn,
                                                                NULL, NULL );
                                /* delete all ... */
                                if ( vals != NULL ) {
                                        for ( i = 0; !BER_BVISNULL( &vals[ i ] ); i++ ) {
-                                               (void)memberof_value_modify( op, rs,
+                                               memberof_value_modify( op,
                                                                &vals[ i ], mo->mo_ad_memberof,
                                                                &op->o_req_dn, &op->o_req_ndn,
                                                                NULL, NULL );
                                assert( ml->sml_nvalues != NULL );
                                vals = ml->sml_nvalues;
                                for ( i = 0; !BER_BVISNULL( &vals[ i ] ); i++ ) {
-                                       memberof_value_modify( op, rs,
+                                       memberof_value_modify( op,
                                                        &vals[ i ], mo->mo_ad_memberof,
                                                        NULL, NULL,
                                                        &op->o_req_dn, &op->o_req_ndn );
 
                if ( rc == LDAP_SUCCESS ) {
                        for ( i = 0; !BER_BVISNULL( &vals[ i ] ); i++ ) {
-                               (void)memberof_value_modify( op, rs,
+                               memberof_value_modify( op,
                                                &vals[ i ], mo->mo_ad_memberof,
                                                &op->o_req_dn, &op->o_req_ndn,
                                                &newDN, &newNDN );
 
                if ( rc == LDAP_SUCCESS ) {
                        for ( i = 0; !BER_BVISNULL( &vals[ i ] ); i++ ) {
-                               (void)memberof_value_modify( op, rs,
+                               memberof_value_modify( op,
                                                &vals[ i ], mo->mo_ad_member,
                                                &op->o_req_dn, &op->o_req_ndn,
                                                &newDN, &newNDN );
 
 static int
 remove_query_data(
        Operation       *op,
-       SlapReply       *rs,
        struct berval   *query_uuid );
 
 /*
        /* ignore expired queries */
        if ( expiry_time <= slap_get_time()) {
                Operation       op2 = *op;
-               SlapReply       rs2 = { 0 };
 
                memset( &op2.oq_search, 0, sizeof( op2.oq_search ) );
 
-               (void)remove_query_data( &op2, &rs2, &uuid );
+               (void)remove_query_data( &op2, &uuid );
 
                rc = 0;
 
 static int
 remove_query_data(
        Operation       *op,
-       SlapReply       *rs,
        struct berval   *query_uuid )
 {
        struct query_info       *qi, *qnext;
        slap_callback cb = { NULL, remove_func, NULL, NULL };
        int deleted = 0;
 
-       sreply.sr_entry = NULL;
-       sreply.sr_nentries = 0;
        op->ors_filterstr.bv_len = snprintf(filter_str, sizeof(filter_str),
                "(%s=%s)", ad_queryId->ad_cname.bv_val, query_uuid->bv_val);
        filter.f_ava = &ava;
 static void
 remove_query_and_data(
        Operation       *op,
-       SlapReply       *rs,
        cache_manager   *cm,
        struct berval   *uuid )
 {
                Debug( pcache_debug,
                        "Removing query UUID %s\n",
                        uuid->bv_val, 0, 0 );
-               return_val = remove_query_data( op, rs, uuid );
+               return_val = remove_query_data( op, uuid );
                Debug( pcache_debug,
                        "QUERY REMOVED, SIZE=%d\n",
                        return_val, 0, 0);
                        for ( i = 0; !BER_BVISNULL( &vals[ i ] ); i++ ) {
                                struct berval   val = vals[ i ];
 
-                               remove_query_and_data( op, &rs, cm, &val );
+                               remove_query_and_data( op, cm, &val );
 
                                if ( !BER_BVISNULL( &val ) && val.bv_val != vals[ i ].bv_val ) {
                                        ch_free( val.bv_val );
        struct berval   *queryid )
 {
        Operation       op2 = *op;
-       SlapReply       rs2 = { 0 };
 
        op2.o_bd = &cm->db;
 
        /* remove the selected query */
-       remove_query_and_data( &op2, &rs2, cm, queryid );
+       remove_query_and_data( &op2, cm, queryid );
 
        return LDAP_SUCCESS;
 }
                for ( i = 0; !BER_BVISNULL( &vals[ i ] ); i++ ) {
                        struct berval   val = vals[ i ];
 
-                       remove_query_and_data( op, &rs, cm, &val );
+                       remove_query_and_data( op, cm, &val );
 
                        if ( !BER_BVISNULL( &val ) && val.bv_val != vals[ i ].bv_val ) {
                                ch_free( val.bv_val );
 static int
 cache_entries(
        Operation       *op,
-       SlapReply       *rs,
        struct berval *query_uuid )
 {
        struct search_info *si = op->o_callback->sc_private;
                e->e_private = NULL;
                while ( cm->cur_entries > (cm->max_entries) ) {
                        BER_BVZERO( &crp_uuid );
-                       remove_query_and_data( op_tmp, rs, cm, &crp_uuid );
+                       remove_query_and_data( op_tmp, cm, &crp_uuid );
                }
 
                return_val = merge_entry(op_tmp, e, 0, query_uuid);
                        if ( qc != NULL ) {
                                switch ( si->caching_reason ) {
                                case PC_POSITIVE:
-                                       cache_entries( op, rs, &qc->q_uuid );
+                                       cache_entries( op, &qc->q_uuid );
                                        if ( si->pbi )
                                                si->pbi->bi_cq = qc;
                                        break;
                                if ( BER_BVISNULL( &query->q_uuid ))
                                        return_val = 0;
                                else
-                                       return_val = remove_query_data(op, &rs, &query->q_uuid);
+                                       return_val = remove_query_data(op, &query->q_uuid);
                                Debug( pcache_debug, "STALE QUERY REMOVED, SIZE=%d\n",
                                                        return_val, 0, 0 );
                                ldap_pvt_thread_mutex_lock(&cm->cache_mutex);
 
 }
 
 static rwm_op_cb *
-rwm_callback_get( Operation *op, SlapReply *rs )
+rwm_callback_get( Operation *op )
 {
        rwm_op_cb       *roc;
 
        char                    *olddn = op->o_req_dn.bv_val;
        int                     isupdate;
 
-       rwm_op_cb               *roc = rwm_callback_get( op, rs );
+       rwm_op_cb               *roc = rwm_callback_get( op );
 
        rc = rwm_op_dn_massage( op, rs, "addDN", &roc->ros );
        if ( rc != LDAP_SUCCESS ) {
        slap_overinst           *on = (slap_overinst *) op->o_bd->bd_info;
        int                     rc;
 
-       rwm_op_cb               *roc = rwm_callback_get( op, rs );
+       rwm_op_cb               *roc = rwm_callback_get( op );
 
        rc = rwm_op_dn_massage( op, rs, "bindDN", &roc->ros );
        if ( rc != LDAP_SUCCESS ) {
        int                     rc;
        struct berval           mapped_vals[2] = { BER_BVNULL, BER_BVNULL };
 
-       rwm_op_cb               *roc = rwm_callback_get( op, rs );
+       rwm_op_cb               *roc = rwm_callback_get( op );
 
        rc = rwm_op_dn_massage( op, rs, "compareDN", &roc->ros );
        if ( rc != LDAP_SUCCESS ) {
        slap_overinst           *on = (slap_overinst *) op->o_bd->bd_info;
        int                     rc;
 
-       rwm_op_cb               *roc = rwm_callback_get( op, rs );
+       rwm_op_cb               *roc = rwm_callback_get( op );
 
        rc = rwm_op_dn_massage( op, rs, "deleteDN", &roc->ros );
        if ( rc != LDAP_SUCCESS ) {
        Modifications           **mlp;
        int                     rc;
 
-       rwm_op_cb               *roc = rwm_callback_get( op, rs );
+       rwm_op_cb               *roc = rwm_callback_get( op );
 
        rc = rwm_op_dn_massage( op, rs, "modifyDN", &roc->ros );
        if ( rc != LDAP_SUCCESS ) {
        int                     rc;
        dncookie                dc;
 
-       rwm_op_cb               *roc = rwm_callback_get( op, rs );
+       rwm_op_cb               *roc = rwm_callback_get( op );
 
        if ( op->orr_newSup ) {
                struct berval   nnewSup = BER_BVNULL;
 
        char                    *text = NULL;
 
-       rwm_op_cb               *roc = rwm_callback_get( op, rs );
+       rwm_op_cb               *roc = rwm_callback_get( op );
 
        rc = rewrite_session_var_set( rwmap->rwm_rw, op->o_conn,
                "searchFilter", op->ors_filterstr.bv_val );
                ber_dupbv_x( &op->o_req_ndn, &op->o_ndn, op->o_tmpmemctx );
        }
 
-       roc = rwm_callback_get( op, rs );
+       roc = rwm_callback_get( op );
 
        rc = rwm_op_dn_massage( op, rs, "extendedDN", &roc->ros );
        if ( rc != LDAP_SUCCESS ) {
                }
        }
 
-       roc = rwm_callback_get( op, rs );
+       roc = rwm_callback_get( op );
 
        rc = rwm_op_dn_massage( op, rs, "extendedDN", &roc->ros );
        if ( rc != LDAP_SUCCESS ) {
 
 }
 
 static void
-syncprov_checkpoint( Operation *op, SlapReply *rs, slap_overinst *on )
+syncprov_checkpoint( Operation *op, slap_overinst *on )
 {
        syncprov_info_t *si = (syncprov_info_t *)on->on_bi.bi_private;
        Modifications mod;
 
                if ( do_check ) {
                        ldap_pvt_thread_rdwr_rlock( &si->si_csn_rwlock );
-                       syncprov_checkpoint( op, rs, on );
+                       syncprov_checkpoint( op, on );
                        ldap_pvt_thread_rdwr_runlock( &si->si_csn_rwlock );
                }
 
                Connection conn = {0};
                OperationBuffer opbuf;
                Operation *op;
-               SlapReply rs = {REP_RESULT};
                void *thrctx;
 
                thrctx = ldap_pvt_thread_pool_context();
                op->o_bd = be;
                op->o_dn = be->be_rootdn;
                op->o_ndn = be->be_rootndn;
-               syncprov_checkpoint( op, &rs, on );
+               syncprov_checkpoint( op, on );
        }
 
 #ifdef SLAP_CONFIG_DELETE