On Tue, May 22, 2007 at 12:25:43PM +0100, Marcelo Coelho wrote:
So, if you want to pass it into a function you have to define the function with the parameter as being a pointer (and a good practice would be also pass the size of the array).
On Tue, May 22, 2007 at 07:15:14AM -0400, Corey Osgood wrote:
unsigned long row_offsets[DIMM_SOCKETS * 2 - 1]; spd_set_dram_size(ctrl, row_offsets);
static void spd_set_dram_size(const struct mem_controller *ctrl, unsigned long row_offsets)
To clarify, change the prototype and function to:
static void spd_set_dram_size(const struct mem_controller *ctrl, unsigned long *row_offsets)
If this static function is in the same file as row_offsets[] and the array is in file scope then you could just skip the parameter completely. This makes sense because you'll need to use another global entity (the DIMM_SOCKETS define) in the function anyway. The alternative clean way would be to pass DIMM_SOCKETS*2-1 to spd_set_dram_size() too, but in this case it could probably be OK to just skip both those parameters. Not sure without seeing complete code.
//Peter