Skip to content

Commit 7079060

Browse files
author
Linus Torvalds
committed
Merge master.kernel.org:/pub/scm/linux/kernel/git/davej/agpgart
2 parents 3f00d3e + 0a1cc0b commit 7079060

File tree

16 files changed

+53
-42
lines changed

16 files changed

+53
-42
lines changed

drivers/char/agp/ali-agp.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,7 @@ static struct pci_device_id agp_ali_pci_table[] = {
389389
MODULE_DEVICE_TABLE(pci, agp_ali_pci_table);
390390

391391
static struct pci_driver agp_ali_pci_driver = {
392+
.owner = THIS_MODULE,
392393
.name = "agpgart-ali",
393394
.id_table = agp_ali_pci_table,
394395
.probe = agp_ali_probe,

drivers/char/agp/amd-k7-agp.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,19 +94,16 @@ static int amd_create_gatt_pages(int nr_tables)
9494
int retval = 0;
9595
int i;
9696

97-
tables = kmalloc((nr_tables + 1) * sizeof(struct amd_page_map *),
98-
GFP_KERNEL);
97+
tables = kzalloc((nr_tables + 1) * sizeof(struct amd_page_map *),GFP_KERNEL);
9998
if (tables == NULL)
10099
return -ENOMEM;
101100

102-
memset (tables, 0, sizeof(struct amd_page_map *) * (nr_tables + 1));
103101
for (i = 0; i < nr_tables; i++) {
104-
entry = kmalloc(sizeof(struct amd_page_map), GFP_KERNEL);
102+
entry = kzalloc(sizeof(struct amd_page_map), GFP_KERNEL);
105103
if (entry == NULL) {
106104
retval = -ENOMEM;
107105
break;
108106
}
109-
memset (entry, 0, sizeof(struct amd_page_map));
110107
tables[i] = entry;
111108
retval = amd_create_page_map(entry);
112109
if (retval != 0)
@@ -518,6 +515,7 @@ static struct pci_device_id agp_amdk7_pci_table[] = {
518515
MODULE_DEVICE_TABLE(pci, agp_amdk7_pci_table);
519516

520517
static struct pci_driver agp_amdk7_pci_driver = {
518+
.owner = THIS_MODULE,
521519
.name = "agpgart-amdk7",
522520
.id_table = agp_amdk7_pci_table,
523521
.probe = agp_amdk7_probe,

drivers/char/agp/amd64-agp.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -703,6 +703,7 @@ static struct pci_device_id agp_amd64_pci_table[] = {
703703
MODULE_DEVICE_TABLE(pci, agp_amd64_pci_table);
704704

705705
static struct pci_driver agp_amd64_pci_driver = {
706+
.owner = THIS_MODULE,
706707
.name = "agpgart-amd64",
707708
.id_table = agp_amd64_pci_table,
708709
.probe = agp_amd64_probe,

drivers/char/agp/ati-agp.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,14 +118,12 @@ static int ati_create_gatt_pages(int nr_tables)
118118
int retval = 0;
119119
int i;
120120

121-
tables = kmalloc((nr_tables + 1) * sizeof(ati_page_map *),
122-
GFP_KERNEL);
121+
tables = kzalloc((nr_tables + 1) * sizeof(ati_page_map *),GFP_KERNEL);
123122
if (tables == NULL)
124123
return -ENOMEM;
125124

126-
memset(tables, 0, sizeof(ati_page_map *) * (nr_tables + 1));
127125
for (i = 0; i < nr_tables; i++) {
128-
entry = kmalloc(sizeof(ati_page_map), GFP_KERNEL);
126+
entry = kzalloc(sizeof(ati_page_map), GFP_KERNEL);
129127
if (entry == NULL) {
130128
while (i>0) {
131129
kfree (tables[i-1]);
@@ -136,7 +134,6 @@ static int ati_create_gatt_pages(int nr_tables)
136134
retval = -ENOMEM;
137135
break;
138136
}
139-
memset(entry, 0, sizeof(ati_page_map));
140137
tables[i] = entry;
141138
retval = ati_create_page_map(entry);
142139
if (retval != 0) break;
@@ -524,6 +521,7 @@ static struct pci_device_id agp_ati_pci_table[] = {
524521
MODULE_DEVICE_TABLE(pci, agp_ati_pci_table);
525522

526523
static struct pci_driver agp_ati_pci_driver = {
524+
.owner = THIS_MODULE,
527525
.name = "agpgart-ati",
528526
.id_table = agp_ati_pci_table,
529527
.probe = agp_ati_probe,

drivers/char/agp/backend.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,12 +222,12 @@ static void agp_backend_cleanup(struct agp_bridge_data *bridge)
222222

223223
struct agp_bridge_data *agp_alloc_bridge(void)
224224
{
225-
struct agp_bridge_data *bridge = kmalloc(sizeof(*bridge), GFP_KERNEL);
226-
225+
struct agp_bridge_data *bridge;
226+
227+
bridge = kzalloc(sizeof(*bridge), GFP_KERNEL);
227228
if (!bridge)
228229
return NULL;
229230

230-
memset(bridge, 0, sizeof(*bridge));
231231
atomic_set(&bridge->agp_in_use, 0);
232232
atomic_set(&bridge->current_memory_agp, 0);
233233

drivers/char/agp/efficeon-agp.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ static int efficeon_create_gatt_table(struct agp_bridge_data *bridge)
219219

220220
efficeon_private.l1_table[index] = page;
221221

222-
value = virt_to_gart(page) | pati | present | index;
222+
value = virt_to_gart((unsigned long *)page) | pati | present | index;
223223

224224
pci_write_config_dword(agp_bridge->dev,
225225
EFFICEON_ATTPAGE, value);
@@ -429,6 +429,7 @@ static struct pci_device_id agp_efficeon_pci_table[] = {
429429
MODULE_DEVICE_TABLE(pci, agp_efficeon_pci_table);
430430

431431
static struct pci_driver agp_efficeon_pci_driver = {
432+
.owner = THIS_MODULE,
432433
.name = "agpgart-efficeon",
433434
.id_table = agp_efficeon_pci_table,
434435
.probe = agp_efficeon_probe,

drivers/char/agp/frontend.c

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -189,13 +189,12 @@ static int agp_create_segment(struct agp_client *client, struct agp_region *regi
189189
struct agp_segment *user_seg;
190190
size_t i;
191191

192-
seg = kmalloc((sizeof(struct agp_segment_priv) * region->seg_count), GFP_KERNEL);
192+
seg = kzalloc((sizeof(struct agp_segment_priv) * region->seg_count), GFP_KERNEL);
193193
if (seg == NULL) {
194194
kfree(region->seg_list);
195195
region->seg_list = NULL;
196196
return -ENOMEM;
197197
}
198-
memset(seg, 0, (sizeof(struct agp_segment_priv) * region->seg_count));
199198
user_seg = region->seg_list;
200199

201200
for (i = 0; i < region->seg_count; i++) {
@@ -332,14 +331,11 @@ static struct agp_controller *agp_create_controller(pid_t id)
332331
{
333332
struct agp_controller *controller;
334333

335-
controller = kmalloc(sizeof(struct agp_controller), GFP_KERNEL);
336-
334+
controller = kzalloc(sizeof(struct agp_controller), GFP_KERNEL);
337335
if (controller == NULL)
338336
return NULL;
339337

340-
memset(controller, 0, sizeof(struct agp_controller));
341338
controller->pid = id;
342-
343339
return controller;
344340
}
345341

@@ -540,12 +536,10 @@ static struct agp_client *agp_create_client(pid_t id)
540536
{
541537
struct agp_client *new_client;
542538

543-
new_client = kmalloc(sizeof(struct agp_client), GFP_KERNEL);
544-
539+
new_client = kzalloc(sizeof(struct agp_client), GFP_KERNEL);
545540
if (new_client == NULL)
546541
return NULL;
547542

548-
memset(new_client, 0, sizeof(struct agp_client));
549543
new_client->pid = id;
550544
agp_insert_client(new_client);
551545
return new_client;
@@ -709,11 +703,10 @@ static int agp_open(struct inode *inode, struct file *file)
709703
if (minor != AGPGART_MINOR)
710704
goto err_out;
711705

712-
priv = kmalloc(sizeof(struct agp_file_private), GFP_KERNEL);
706+
priv = kzalloc(sizeof(struct agp_file_private), GFP_KERNEL);
713707
if (priv == NULL)
714708
goto err_out_nomem;
715709

716-
memset(priv, 0, sizeof(struct agp_file_private));
717710
set_bit(AGP_FF_ALLOW_CLIENT, &priv->access_flags);
718711
priv->my_pid = current->pid;
719712

drivers/char/agp/generic.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,10 @@ struct agp_memory *agp_create_memory(int scratch_pages)
105105
{
106106
struct agp_memory *new;
107107

108-
new = kmalloc(sizeof(struct agp_memory), GFP_KERNEL);
109-
108+
new = kzalloc(sizeof(struct agp_memory), GFP_KERNEL);
110109
if (new == NULL)
111110
return NULL;
112111

113-
memset(new, 0, sizeof(struct agp_memory));
114112
new->key = agp_get_key();
115113

116114
if (new->key < 0) {
@@ -414,7 +412,8 @@ static void agp_v2_parse_one(u32 *requested_mode, u32 *bridge_agpstat, u32 *vga_
414412
u32 tmp;
415413

416414
if (*requested_mode & AGP2_RESERVED_MASK) {
417-
printk(KERN_INFO PFX "reserved bits set in mode 0x%x. Fixed.\n", *requested_mode);
415+
printk(KERN_INFO PFX "reserved bits set (%x) in mode 0x%x. Fixed.\n",
416+
*requested_mode & AGP2_RESERVED_MASK, *requested_mode);
418417
*requested_mode &= ~AGP2_RESERVED_MASK;
419418
}
420419

@@ -492,7 +491,8 @@ static void agp_v3_parse_one(u32 *requested_mode, u32 *bridge_agpstat, u32 *vga_
492491
u32 tmp;
493492

494493
if (*requested_mode & AGP3_RESERVED_MASK) {
495-
printk(KERN_INFO PFX "reserved bits set in mode 0x%x. Fixed.\n", *requested_mode);
494+
printk(KERN_INFO PFX "reserved bits set (%x) in mode 0x%x. Fixed.\n",
495+
*requested_mode & AGP3_RESERVED_MASK, *requested_mode);
496496
*requested_mode &= ~AGP3_RESERVED_MASK;
497497
}
498498

drivers/char/agp/i460-agp.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -227,10 +227,9 @@ static int i460_configure (void)
227227
*/
228228
if (I460_IO_PAGE_SHIFT > PAGE_SHIFT) {
229229
size = current_size->num_entries * sizeof(i460.lp_desc[0]);
230-
i460.lp_desc = kmalloc(size, GFP_KERNEL);
230+
i460.lp_desc = kzalloc(size, GFP_KERNEL);
231231
if (!i460.lp_desc)
232232
return -ENOMEM;
233-
memset(i460.lp_desc, 0, size);
234233
}
235234
return 0;
236235
}
@@ -366,13 +365,12 @@ static int i460_alloc_large_page (struct lp_desc *lp)
366365
}
367366

368367
map_size = ((I460_KPAGES_PER_IOPAGE + BITS_PER_LONG - 1) & -BITS_PER_LONG)/8;
369-
lp->alloced_map = kmalloc(map_size, GFP_KERNEL);
368+
lp->alloced_map = kzalloc(map_size, GFP_KERNEL);
370369
if (!lp->alloced_map) {
371370
free_pages((unsigned long) lpage, order);
372371
printk(KERN_ERR PFX "Out of memory, we're in trouble...\n");
373372
return -ENOMEM;
374373
}
375-
memset(lp->alloced_map, 0, map_size);
376374

377375
lp->paddr = virt_to_gart(lpage);
378376
lp->refcount = 0;
@@ -619,6 +617,7 @@ static struct pci_device_id agp_intel_i460_pci_table[] = {
619617
MODULE_DEVICE_TABLE(pci, agp_intel_i460_pci_table);
620618

621619
static struct pci_driver agp_intel_i460_pci_driver = {
620+
.owner = THIS_MODULE,
622621
.name = "agpgart-intel-i460",
623622
.id_table = agp_intel_i460_pci_table,
624623
.probe = agp_intel_i460_probe,

drivers/char/agp/intel-agp.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1824,6 +1824,7 @@ static struct pci_device_id agp_intel_pci_table[] = {
18241824
MODULE_DEVICE_TABLE(pci, agp_intel_pci_table);
18251825

18261826
static struct pci_driver agp_intel_pci_driver = {
1827+
.owner = THIS_MODULE,
18271828
.name = "agpgart-intel",
18281829
.id_table = agp_intel_pci_table,
18291830
.probe = agp_intel_probe,

0 commit comments

Comments
 (0)