Thread (10 messages) 10 messages, 4 authors, 2012-08-15

Re: [PATCH BlueZ 1/3] att: Add prepare write support

From: Anderson Lizardo <hidden>
Date: 2012-07-30 10:35:23

Hi Sergio,

On Sat, Jul 28, 2012 at 9:47 PM, Sergio Correia [off-list ref] wrote:
quoted
+uint16_t enc_prep_write_req(uint16_t handle, uint16_t offset,
+                       const uint8_t *value, int vlen, uint8_t *pdu, int len)
+{
+       const uint16_t min_len = sizeof(pdu[0]) + sizeof(handle) +
+                                                               sizeof(offset);
+
+       if (pdu == NULL)
+               return 0;
+
+       if (len < min_len)
+               return 0;
maybe it would be better to check the above conditions in a single if statement?
I think Eder is following the same style from the other similar
functions in the same file. I would suggest leaving these patches as
is and instead sending a separate patch changing this in all
functions, as a refactoring patch.

My two cents,
-- 
Anderson Lizardo
Instituto Nokia de Tecnologia - INdT
Manaus - Brazil
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help