Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 19740
b: refs/heads/master
c: cb6fc18
h: refs/heads/master
v: v3
  • Loading branch information
Helge Deller authored and Kyle McMartin committed Jan 23, 2006
1 parent 2cc1be3 commit 5b77618
Show file tree
Hide file tree
Showing 18 changed files with 74 additions and 83 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a1c744439591b1d4350f0926615d501e7cfbb708
refs/heads/master: cb6fc18e9ca615f03d18e60c49855b434ca2e51e
3 changes: 1 addition & 2 deletions trunk/arch/parisc/kernel/drivers.c
Original file line number Diff line number Diff line change
Expand Up @@ -408,11 +408,10 @@ static void setup_bus_id(struct parisc_device *padev)

struct parisc_device * create_tree_node(char id, struct device *parent)
{
struct parisc_device *dev = kmalloc(sizeof(*dev), GFP_KERNEL);
struct parisc_device *dev = kzalloc(sizeof(*dev), GFP_KERNEL);
if (!dev)
return NULL;

memset(dev, 0, sizeof(*dev));
dev->hw_path = id;
dev->id.hw_type = HPHW_FAULTY;

Expand Down
11 changes: 5 additions & 6 deletions trunk/arch/parisc/kernel/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,17 @@
* this makes the boot time much longer than necessary.
* 20ms seems to work for all the HP PCI implementations to date.
*
* XXX: turn into a #defined constant in <asm/pci.h> ?
* #define pci_post_reset_delay 50
*/
int pci_post_reset_delay = 50;

struct pci_port_ops *pci_port;
struct pci_bios_ops *pci_bios;
struct pci_port_ops *pci_port __read_mostly;
struct pci_bios_ops *pci_bios __read_mostly;

int pci_hba_count = 0;
static int pci_hba_count __read_mostly;

/* parisc_pci_hba used by pci_port->in/out() ops to lookup bus data. */
#define PCI_HBA_MAX 32
struct pci_hba_data *parisc_pci_hba[PCI_HBA_MAX];
struct pci_hba_data *parisc_pci_hba[PCI_HBA_MAX] __read_mostly;


/********************************************************************
Expand Down
35 changes: 18 additions & 17 deletions trunk/arch/parisc/kernel/perf.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,20 +68,20 @@ struct rdr_tbl_ent {
};

static int perf_processor_interface __read_mostly = UNKNOWN_INTF;
static int perf_enabled __read_mostly = 0;
static int perf_enabled __read_mostly;
static spinlock_t perf_lock;
struct parisc_device *cpu_device __read_mostly = NULL;
struct parisc_device *cpu_device __read_mostly;

/* RDRs to write for PCX-W */
static int perf_rdrs_W[] =
static const int perf_rdrs_W[] =
{ 0, 1, 4, 5, 6, 15, 16, 17, 18, 20, 21, 22, 23, 24, 25, -1 };

/* RDRs to write for PCX-U */
static int perf_rdrs_U[] =
static const int perf_rdrs_U[] =
{ 0, 1, 4, 5, 6, 7, 16, 17, 18, 20, 21, 22, 23, 24, 25, -1 };

/* RDR register descriptions for PCX-W */
static struct rdr_tbl_ent perf_rdr_tbl_W[] = {
static const struct rdr_tbl_ent perf_rdr_tbl_W[] = {
{ 19, 1, 8 }, /* RDR 0 */
{ 16, 1, 16 }, /* RDR 1 */
{ 72, 2, 0 }, /* RDR 2 */
Expand Down Expand Up @@ -117,7 +117,7 @@ static struct rdr_tbl_ent perf_rdr_tbl_W[] = {
};

/* RDR register descriptions for PCX-U */
static struct rdr_tbl_ent perf_rdr_tbl_U[] = {
static const struct rdr_tbl_ent perf_rdr_tbl_U[] = {
{ 19, 1, 8 }, /* RDR 0 */
{ 32, 1, 16 }, /* RDR 1 */
{ 20, 1, 0 }, /* RDR 2 */
Expand Down Expand Up @@ -156,7 +156,7 @@ static struct rdr_tbl_ent perf_rdr_tbl_U[] = {
* A non-zero write_control in the above tables is a byte offset into
* this array.
*/
static uint64_t perf_bitmasks[] = {
static const uint64_t perf_bitmasks[] = {
0x0000000000000000ul, /* first dbl word must be zero */
0xfdffe00000000000ul, /* RDR0 bitmask */
0x003f000000000000ul, /* RDR1 bitmask */
Expand All @@ -173,7 +173,7 @@ static uint64_t perf_bitmasks[] = {
* Write control bitmasks for Pa-8700 processor given
* somethings have changed slightly.
*/
static uint64_t perf_bitmasks_piranha[] = {
static const uint64_t perf_bitmasks_piranha[] = {
0x0000000000000000ul, /* first dbl word must be zero */
0xfdffe00000000000ul, /* RDR0 bitmask */
0x003f000000000000ul, /* RDR1 bitmask */
Expand All @@ -186,7 +186,7 @@ static uint64_t perf_bitmasks_piranha[] = {
0xfffc000000000000ul
};

static uint64_t *bitmask_array; /* array of bitmasks to use */
static const uint64_t *bitmask_array; /* array of bitmasks to use */

/******************************************************************************
* Function Prototypes
Expand All @@ -200,7 +200,7 @@ static ssize_t perf_write(struct file *file, const char __user *buf, size_t coun
static long perf_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
static void perf_start_counters(void);
static int perf_stop_counters(uint32_t *raddr);
static struct rdr_tbl_ent * perf_rdr_get_entry(uint32_t rdr_num);
static const struct rdr_tbl_ent * perf_rdr_get_entry(uint32_t rdr_num);
static int perf_rdr_read_ubuf(uint32_t rdr_num, uint64_t *buffer);
static int perf_rdr_clear(uint32_t rdr_num);
static int perf_write_image(uint64_t *memaddr);
Expand Down Expand Up @@ -655,7 +655,7 @@ static int perf_stop_counters(uint32_t *raddr)
* Retrieve a pointer to the description of what this
* RDR contains.
*/
static struct rdr_tbl_ent * perf_rdr_get_entry(uint32_t rdr_num)
static const struct rdr_tbl_ent * perf_rdr_get_entry(uint32_t rdr_num)
{
if (perf_processor_interface == ONYX_INTF) {
return &perf_rdr_tbl_U[rdr_num];
Expand All @@ -673,7 +673,7 @@ static int perf_rdr_read_ubuf(uint32_t rdr_num, uint64_t *buffer)
{
uint64_t data, data_mask = 0;
uint32_t width, xbits, i;
struct rdr_tbl_ent *tentry;
const struct rdr_tbl_ent *tentry;

tentry = perf_rdr_get_entry(rdr_num);
if ((width = tentry->width) == 0)
Expand Down Expand Up @@ -721,7 +721,7 @@ static int perf_rdr_read_ubuf(uint32_t rdr_num, uint64_t *buffer)
*/
static int perf_rdr_clear(uint32_t rdr_num)
{
struct rdr_tbl_ent *tentry;
const struct rdr_tbl_ent *tentry;
int32_t i;

tentry = perf_rdr_get_entry(rdr_num);
Expand Down Expand Up @@ -753,10 +753,11 @@ static int perf_write_image(uint64_t *memaddr)
uint64_t buffer[MAX_RDR_WORDS];
uint64_t *bptr;
uint32_t dwords;
uint32_t *intrigue_rdr;
uint64_t *intrigue_bitmask, tmp64;
const uint32_t *intrigue_rdr;
const uint64_t *intrigue_bitmask;
uint64_t tmp64;
void __iomem *runway;
struct rdr_tbl_ent *tentry;
const struct rdr_tbl_ent *tentry;
int i;

/* Clear out counters */
Expand Down Expand Up @@ -830,7 +831,7 @@ static int perf_write_image(uint64_t *memaddr)
*/
static void perf_rdr_write(uint32_t rdr_num, uint64_t *buffer)
{
struct rdr_tbl_ent *tentry;
const struct rdr_tbl_ent *tentry;
int32_t i;

printk("perf_rdr_write\n");
Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/parisc/kernel/perf_images.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

#define PCXU_IMAGE_SIZE 584

static uint32_t onyx_images[][PCXU_IMAGE_SIZE/sizeof(uint32_t)] = {
static uint32_t onyx_images[][PCXU_IMAGE_SIZE/sizeof(uint32_t)] __read_mostly = {
/*
* CPI:
*
Expand Down Expand Up @@ -2093,7 +2093,7 @@ static uint32_t onyx_images[][PCXU_IMAGE_SIZE/sizeof(uint32_t)] = {
};
#define PCXW_IMAGE_SIZE 576

static uint32_t cuda_images[][PCXW_IMAGE_SIZE/sizeof(uint32_t)] = {
static uint32_t cuda_images[][PCXW_IMAGE_SIZE/sizeof(uint32_t)] __read_mostly = {
/*
* CPI: FROM CPI.IDF (Image 0)
*
Expand Down
3 changes: 1 addition & 2 deletions trunk/arch/parisc/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,9 @@ void show_stack(struct task_struct *task, unsigned long *s)

HERE:
asm volatile ("copy %%r30, %0" : "=r"(sp));
r = (struct pt_regs *)kmalloc(sizeof(struct pt_regs), GFP_KERNEL);
r = kzalloc(sizeof(struct pt_regs), GFP_KERNEL);
if (!r)
return;
memset(r, 0, sizeof(struct pt_regs));
r->iaoq[0] = (unsigned long)&&HERE;
r->gr[2] = (unsigned long)__builtin_return_address(0);
r->gr[30] = sp;
Expand Down
7 changes: 3 additions & 4 deletions trunk/drivers/parisc/ccio-dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -1423,7 +1423,7 @@ static void __init ccio_init_resources(struct ioc *ioc)
struct resource *res = ioc->mmio_region;
char *name = kmalloc(14, GFP_KERNEL);

sprintf(name, "GSC Bus [%d/]", ioc->hw_path);
snprintf(name, 14, "GSC Bus [%d/]", ioc->hw_path);

ccio_init_resource(res, name, &ioc->ioc_regs->io_io_low);
ccio_init_resource(res + 1, name, &ioc->ioc_regs->io_io_low_hv);
Expand Down Expand Up @@ -1557,12 +1557,11 @@ static int ccio_probe(struct parisc_device *dev)
int i;
struct ioc *ioc, **ioc_p = &ioc_list;

ioc = kmalloc(sizeof(struct ioc), GFP_KERNEL);
ioc = kzalloc(sizeof(struct ioc), GFP_KERNEL);
if (ioc == NULL) {
printk(KERN_ERR MODULE_NAME ": memory allocation failure\n");
return 1;
}
memset(ioc, 0, sizeof(struct ioc));

ioc->name = dev->id.hversion == U2_IOA_RUNWAY ? "U2" : "UTurn";

Expand All @@ -1578,7 +1577,7 @@ static int ccio_probe(struct parisc_device *dev)
ccio_ioc_init(ioc);
ccio_init_resources(ioc);
hppa_dma_ops = &ccio_ops;
dev->dev.platform_data = kmalloc(sizeof(struct pci_hba_data), GFP_KERNEL);
dev->dev.platform_data = kzalloc(sizeof(struct pci_hba_data), GFP_KERNEL);

/* if this fails, no I/O cards will work, so may as well bug */
BUG_ON(dev->dev.platform_data == NULL);
Expand Down
4 changes: 1 addition & 3 deletions trunk/drivers/parisc/dino.c
Original file line number Diff line number Diff line change
Expand Up @@ -989,14 +989,12 @@ static int __init dino_probe(struct parisc_device *dev)
*/
}

dino_dev = kmalloc(sizeof(struct dino_device), GFP_KERNEL);
dino_dev = kzalloc(sizeof(struct dino_device), GFP_KERNEL);
if (!dino_dev) {
printk("dino_init_chip - couldn't alloc dino_device\n");
return 1;
}

memset(dino_dev, 0, sizeof(struct dino_device));

dino_dev->hba.dev = dev;
dino_dev->hba.base_addr = ioremap(hpa, 4096);
dino_dev->hba.lmmio_space_offset = 0; /* CPU addrs == bus addrs */
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/parisc/hppb.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,11 @@ static int hppb_probe(struct parisc_device *dev)
}

if(card->hpa) {
card->next = kmalloc(sizeof(struct hppb_card), GFP_KERNEL);
card->next = kzalloc(sizeof(struct hppb_card), GFP_KERNEL);
if(!card->next) {
printk(KERN_ERR "HP-PB: Unable to allocate memory.\n");
return 1;
}
memset(card->next, '\0', sizeof(struct hppb_card));
card = card->next;
}
printk(KERN_INFO "Found GeckoBoa at 0x%lx\n", dev->hpa.start);
Expand Down
8 changes: 2 additions & 6 deletions trunk/drivers/parisc/iosapic.c
Original file line number Diff line number Diff line change
Expand Up @@ -873,28 +873,24 @@ void *iosapic_register(unsigned long hpa)
return NULL;
}

isi = (struct iosapic_info *)kmalloc(sizeof(struct iosapic_info), GFP_KERNEL);
isi = (struct iosapic_info *)kzalloc(sizeof(struct iosapic_info), GFP_KERNEL);
if (!isi) {
BUG();
return NULL;
}

memset(isi, 0, sizeof(struct iosapic_info));

isi->addr = ioremap(hpa, 4096);
isi->isi_hpa = hpa;
isi->isi_version = iosapic_rd_version(isi);
isi->isi_num_vectors = IOSAPIC_IRDT_MAX_ENTRY(isi->isi_version) + 1;

vip = isi->isi_vector = (struct vector_info *)
kmalloc(sizeof(struct vector_info) * isi->isi_num_vectors, GFP_KERNEL);
kzalloc(sizeof(struct vector_info) * isi->isi_num_vectors, GFP_KERNEL);
if (vip == NULL) {
kfree(isi);
return NULL;
}

memset(vip, 0, sizeof(struct vector_info) * isi->isi_num_vectors);

for (cnt=0; cnt < isi->isi_num_vectors; cnt++, vip++) {
vip->irqline = (unsigned char) cnt;
vip->iosapic = isi;
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/parisc/lasi.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ lasi_init_chip(struct parisc_device *dev)
struct gsc_irq gsc_irq;
int ret;

lasi = kmalloc(sizeof(*lasi), GFP_KERNEL);
lasi = kzalloc(sizeof(*lasi), GFP_KERNEL);
if (!lasi)
return -ENOMEM;

Expand Down
6 changes: 2 additions & 4 deletions trunk/drivers/parisc/lba_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -1565,7 +1565,7 @@ lba_driver_probe(struct parisc_device *dev)
} else if (IS_MERCURY(dev) || IS_QUICKSILVER(dev)) {
func_class &= 0xff;
version = kmalloc(6, GFP_KERNEL);
sprintf(version,"TR%d.%d",(func_class >> 4),(func_class & 0xf));
snprintf(version, 6, "TR%d.%d",(func_class >> 4),(func_class & 0xf));
/* We could use one printk for both Elroy and Mercury,
* but for the mask for func_class.
*/
Expand All @@ -1586,14 +1586,12 @@ lba_driver_probe(struct parisc_device *dev)
** have an IRT entry will get NULL back from iosapic code.
*/

lba_dev = kmalloc(sizeof(struct lba_device), GFP_KERNEL);
lba_dev = kzalloc(sizeof(struct lba_device), GFP_KERNEL);
if (!lba_dev) {
printk(KERN_ERR "lba_init_chip - couldn't alloc lba_device\n");
return(1);
}

memset(lba_dev, 0, sizeof(struct lba_device));


/* ---------- First : initialize data we already have --------- */

Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/parisc/sba_iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -2064,14 +2064,13 @@ sba_driver_callback(struct parisc_device *dev)
printk(KERN_INFO "%s found %s at 0x%lx\n",
MODULE_NAME, version, dev->hpa.start);

sba_dev = kmalloc(sizeof(struct sba_device), GFP_KERNEL);
sba_dev = kzalloc(sizeof(struct sba_device), GFP_KERNEL);
if (!sba_dev) {
printk(KERN_ERR MODULE_NAME " - couldn't alloc sba_device\n");
return -ENOMEM;
}

parisc_set_drvdata(dev, sba_dev);
memset(sba_dev, 0, sizeof(struct sba_device));

for(i=0; i<MAX_IOC; i++)
spin_lock_init(&(sba_dev->ioc[i].res_lock));
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/parisc/wax.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ wax_init_chip(struct parisc_device *dev)
struct gsc_irq gsc_irq;
int ret;

wax = kmalloc(sizeof(*wax), GFP_KERNEL);
wax = kzalloc(sizeof(*wax), GFP_KERNEL);
if (!wax)
return -ENOMEM;

Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/parport/parport_gsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ struct parport *__devinit parport_gsc_probe_port (unsigned long base,
struct parport tmp;
struct parport *p = &tmp;

priv = kmalloc (sizeof (struct parport_gsc_private), GFP_KERNEL);
priv = kzalloc (sizeof (struct parport_gsc_private), GFP_KERNEL);
if (!priv) {
printk (KERN_DEBUG "parport (0x%lx): no memory!\n", base);
return NULL;
Expand Down
Loading

0 comments on commit 5b77618

Please sign in to comment.