Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 57ca86d4 authored by Stephen Rothwell's avatar Stephen Rothwell Committed by Linus Torvalds
Browse files

[PATCH] ppc64 iSeries: iSeries_VpdInfo.c cleanups



Clean up iSeries_VpdInfo.c:
	- white space and comment fixes
	- make a function static
	- the functions here are only called from iSeries_pci.c, so
	  CONFIG_PCI will be set (so remove check)
	- only build when CONFIG_PCI is set
	- remove unneeded includes and cast

Signed-off-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent e7eb22d2
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -16,13 +16,12 @@ obj-y += vdso32/ vdso64/

obj-$(CONFIG_PPC_OF) +=	of_device.o

pci-obj-$(CONFIG_PPC_ISERIES)	+= iSeries_pci.o
pci-obj-$(CONFIG_PPC_ISERIES)	+= iSeries_pci.o iSeries_VpdInfo.o
pci-obj-$(CONFIG_PPC_MULTIPLATFORM)	+= pci_dn.o pci_direct_iommu.o

obj-$(CONFIG_PCI)	+= pci.o pci_iommu.o iomap.o $(pci-obj-y)

obj-$(CONFIG_PPC_ISERIES) += iSeries_irq.o \
			     iSeries_VpdInfo.o XmPciLpEvent.o \
obj-$(CONFIG_PPC_ISERIES) += iSeries_irq.o XmPciLpEvent.o \
			     HvCall.o HvLpConfig.o LparData.o \
			     iSeries_setup.o ItLpQueue.o hvCall.o \
			     mf.o HvLpEvent.o iSeries_proc.o iSeries_htab.o \
+41 −43
Original line number Diff line number Diff line
/************************************************************************/
/* File iSeries_vpdInfo.c created by Allan Trautman on Fri Feb  2 2001. */
/************************************************************************/
/* This code gets the card location of the hardware                     */
/* Copyright (C) 20yy  <Allan H Trautman> <IBM Corp>                    */
/*                                                                      */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License, or    */
/* (at your option) any later version.                                  */
/*                                                                      */
/* This program is distributed in the hope that it will be useful,      */ 
/* but WITHOUT ANY WARRANTY; without even the implied warranty of       */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        */
/* GNU General Public License for more details.                         */
/*                                                                      */
/* You should have received a copy of the GNU General Public License    */ 
/* along with this program; if not, write to the:                       */
/* Free Software Foundation, Inc.,                                      */ 
/* 59 Temple Place, Suite 330,                                          */ 
/* Boston, MA  02111-1307  USA                                          */
/************************************************************************/
/* Change Activity:                                                     */
/*   Created, Feb 2, 2001                                               */
/*   Ported to ppc64, August 20, 2001                                   */
/* End Change Activity                                                  */
/************************************************************************/
#include <linux/config.h>
/*
 * File iSeries_vpdInfo.c created by Allan Trautman on Fri Feb  2 2001.
 *
 * This code gets the card location of the hardware
 * Copyright (C) 2001  <Allan H Trautman> <IBM Corp>
 * Copyright (C) 2005  Stephen Rothwel, IBM Corp
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the:
 * Free Software Foundation, Inc.,
 * 59 Temple Place, Suite 330,
 * Boston, MA  02111-1307  USA
 *
 * Change Activity:
 *   Created, Feb 2, 2001
 *   Ported to ppc64, August 20, 2001
 * End Change Activity
 */
#include <linux/init.h>
#include <linux/module.h>
#include <linux/pci.h>
@@ -34,14 +34,13 @@

#include <asm/iSeries/HvCallPci.h>
#include <asm/iSeries/HvTypes.h>
#include <asm/iSeries/mf.h>
#include <asm/iSeries/iSeries_pci.h>
#include "pci.h"

/*
 * Size of Bus VPD data
 */
#define BUS_VPDSIZE      1024

/*
 * Bus Vpd Tags
 */
@@ -49,6 +48,7 @@
#define  VpdEndOfAreaTag   0x79
#define  VpdIdStringTag    0x82
#define  VpdVendorAreaTag  0x84

/*
 * Mfg Area Tags
 */
@@ -111,28 +111,26 @@ int iSeries_Device_Information(struct pci_dev *PciDev, char *buffer,
			PciDev->vendor);
	len += sprintf(buffer + len, "Frame%3d, Card %4s  ",
			DevNode->FrameId, DevNode->CardLocation);
#ifdef CONFIG_PCI
	if (pci_class_name(PciDev->class >> 8) == 0)
		len += sprintf(buffer + len, "0x%04X  ",
				(int)(PciDev->class >> 8));
	else
		len += sprintf(buffer + len, "%s",
				pci_class_name(PciDev->class >> 8));
#endif
	return len;
}

/*
 * Parse the Slot Area
 */
void iSeries_Parse_SlotArea(SlotMap *MapPtr, int MapLen,
static void iSeries_Parse_SlotArea(SlotMap *MapPtr, int MapLen,
		struct iSeries_Device_Node *DevNode)
{
	int SlotMapLen = MapLen;
	SlotMap *SlotMapPtr = MapPtr;

	/*
	 * Parse Slot label until we find the one requrested
	 * Parse Slot label until we find the one requested
	 */
	while (SlotMapLen > 0) {
		if (SlotMapPtr->AgentId == DevNode->AgentId ) {
@@ -248,7 +246,7 @@ static void iSeries_Parse_Vpd(u8 *VpdData, int VpdDataLen,
void iSeries_Get_Location_Code(struct iSeries_Device_Node *DevNode)
{
	int BusVpdLen = 0;
	u8 *BusVpdPtr = (u8 *)kmalloc(BUS_VPDSIZE, GFP_KERNEL);
	u8 *BusVpdPtr = kmalloc(BUS_VPDSIZE, GFP_KERNEL);

	if (BusVpdPtr == NULL) {
		printk("PCI: Bus VPD Buffer allocation failure.\n");