Return-Path: MIME-Version: 1.0 In-Reply-To: References: <1406664949-25196-1-git-send-email-armansito@chromium.org> Date: Wed, 30 Jul 2014 14:57:07 -0700 Message-ID: Subject: Re: [PATCH] shared/gatt: Use iterator based discovery result structure. From: Arman Uguray To: Marcel Holtmann Cc: Arman Uguray , BlueZ development Content-Type: text/plain; charset=UTF-8 List-ID: Hi Marcel, >> +struct result_ptrs { >> + struct bt_gatt_result *head; >> + struct bt_gatt_result *tail; >> +}; >> + >> +struct discovery_op { >> + struct bt_att *att; >> + uint16_t end_handle; >> + int ref_count; >> + bt_uuid_t uuid; >> + struct result_ptrs result; > > Does this nested struct give you any benefit. Why not just include head and tail pointers directly. > I initially thought that I would reuse the result ptrs but I didn't so it's not that necessary any more. > I was actually thinking that struct bt_gatt_result will keep the tail pointer all by itself. That way it is self-contained. I'd rather have the head and tail pointers inside discovery_op. It's a bit weird for each "link" (i.e. struct bt_gatt_result) to have a tail pointer, which the iterator itself won't ever use later. Cheers, Arman