Aaron Nyholm commented on a discussion on bsps/shared/dev/nor/config-parser.c: 
https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/823#note_136641

 > +  }
 > +
 > +  if (version >= 5) {
 > +    int page_info_dword_offset = 10;
 > +    int page_info_offset = 4 * page_info_dword_offset;
 > +    if (read_config_byte(tdata, tlen, datalen, page_info_offset, &bufbyte)) 
 > {
 > +      return -1;
 > +    }
 > +    bufbyte >>= 4;
 > +    bufbyte &= 0xF;
 > +    local.PageSize = 1U << bufbyte;
 > +  }
 > +
 > +  /* Apply local parse data now that parsing has succeeded */
 > +  *data = local;
 > +  return 0;

I think the format of the data being parsed lends itself to longer functions. 
While I agree that the functions are long, looking at them I'm not sure how to 
break them up without affecting the readability of the code. It's useful to be 
able to track the format in the function and all repeated actions are already 
pulled out into static functions. Happy for any suggestions though :))

-- 
View it on GitLab: 
https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/823#note_136641
You're receiving this email because of your account on gitlab.rtems.org.


_______________________________________________
bugs mailing list
[email protected]
http://lists.rtems.org/mailman/listinfo/bugs

Reply via email to