From mboxrd@z Thu Jan 1 00:00:00 1970 From: Timur Tabi Date: Wed, 26 May 2010 13:12:09 -0500 Subject: [U-Boot] [PATCH] powerpc: add support for the Freescale P1022DS reference board In-Reply-To: <20100521070719.5B27BCCF026@gemini.denx.de> References: <1274392909-16422-1-git-send-email-timur@freescale.com> <20100520223324.50594CCF026@gemini.denx.de> <20100521070719.5B27BCCF026@gemini.denx.de> Message-ID: <4BFD6479.9040408@freescale.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Wolfgang Denk wrote: >>> > > Hm... looks as if you were repeating the same code 3 times. Please make >>> > > this a function. >> > >> > The code isn't really the same. I would need to pass a lot of >> > parameters to this function: the hose, the devdisr mask, the slot >> > name, the slot number, the bus number, and so on. > Actually it is not that many arguments. It is. Here's the prototype I came up with; static int configure_pci(enum srds_prtcl pci, const char *name, const char *target, int endpoint, int first_free_busno, phys_addr_t mem_addr, enum law_size mem_size, phys_addr_t io_addr, enum law_size io_size, struct fsl_pci_info *pci_info, struct pci_controller *hose); Are you sure you would really rather see this as its own function? -- Timur Tabi Linux kernel developer at Freescale