ccp code cleanup:
Declare variables if you need them, do not declare them if you return.
Declare CCSSettingValue *val; outside the foreach loop.
Use prefix instead of postfix increments.
Merged if condition checks.
Declaration and assignment of variables in one line.
Removed redundant brackets.
Added and removed newlines.
Fixed indentation.
Approved by PS Jenkins bot, Sam Spilsbury.