{"comment":{"url":"https://api.github.com/repos/omnium21/arm-trusted-firmware/comments/10961476","html_url":"https://github.com/omnium21/arm-trusted-firmware/commit/6fd7d30da3dd5420b5045239e9610b363525c2b8#commitcomment-10961476","id":10961476,"user":{"login":"danh-arm","id":5684642,"avatar_url":"https://avatars.githubusercontent.com/u/5684642?v=3","gravatar_id":"","url":"https://api.github.com/users/danh-arm","html_url":"https://github.com/danh-arm","followers_url":"https://api.github.com/users/danh-arm/followers","following_url":"https://api.github.com/users/danh-arm/following{/other_user}","gists_url":"https://api.github.com/users/danh-arm/gists{/gist_id}","starred_url":"https://api.github.com/users/danh-arm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danh-arm/subscriptions","organizations_url":"https://api.github.com/users/danh-arm/orgs","repos_url":"https://api.github.com/users/danh-arm/repos","events_url":"https://api.github.com/users/danh-arm/events{/privacy}","received_events_url":"https://api.github.com/users/danh-arm/received_events","type":"User","site_admin":false},"position":63,"line":63,"path":"drivers/arm/sp804/sp804.c","commit_id":"6fd7d30da3dd5420b5045239e9610b363525c2b8","created_at":"2015-04-29T11:27:47Z","updated_at":"2015-04-29T11:27:47Z","body":"So this function expects the multiplier and divider to be provided in ops but will fill in the get_timer_value field itself. This isn't a very clear API contract. I think you should either:\r\n\r\n1.  Declare sp804_get_timer_value in the header and let the caller pass in a completely filled in timer_ops_t. This will allow you to make the argument const and the caller to initialize the timer_ops_t as a const global, avoiding the need to have any uninitialized global data. Or,\r\n\r\n2.  Just pass the divider and multiplier into this function and instantiate the global timer_ops_t in this file instead of in the caller.\r\n\r\nI prefer 1.\r\n "}}