diff options
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/agp/backend.c | 4 | ||||
-rw-r--r-- | drivers/char/agp/hp-agp.c | 9 | ||||
-rw-r--r-- | drivers/char/agp/uninorth-agp.c | 2 | ||||
-rw-r--r-- | drivers/char/epca.c | 2 | ||||
-rw-r--r-- | drivers/char/hw_random/virtio-rng.c | 3 | ||||
-rw-r--r-- | drivers/char/ipmi/ipmi_poweroff.c | 4 | ||||
-rw-r--r-- | drivers/char/misc.c | 2 | ||||
-rw-r--r-- | drivers/char/pcmcia/cm4000_cs.c | 2 | ||||
-rw-r--r-- | drivers/char/tpm/tpm.c | 2 | ||||
-rw-r--r-- | drivers/char/tpm/tpm_bios.c | 4 | ||||
-rw-r--r-- | drivers/char/virtio_console.c | 5 |
11 files changed, 19 insertions, 20 deletions
diff --git a/drivers/char/agp/backend.c b/drivers/char/agp/backend.c index ad87753f6de4..a56ca080e108 100644 --- a/drivers/char/agp/backend.c +++ b/drivers/char/agp/backend.c | |||
@@ -114,9 +114,9 @@ static int agp_find_max(void) | |||
114 | long memory, index, result; | 114 | long memory, index, result; |
115 | 115 | ||
116 | #if PAGE_SHIFT < 20 | 116 | #if PAGE_SHIFT < 20 |
117 | memory = num_physpages >> (20 - PAGE_SHIFT); | 117 | memory = totalram_pages >> (20 - PAGE_SHIFT); |
118 | #else | 118 | #else |
119 | memory = num_physpages << (PAGE_SHIFT - 20); | 119 | memory = totalram_pages << (PAGE_SHIFT - 20); |
120 | #endif | 120 | #endif |
121 | index = 1; | 121 | index = 1; |
122 | 122 | ||
diff --git a/drivers/char/agp/hp-agp.c b/drivers/char/agp/hp-agp.c index 501e293e5ad0..9047b2714653 100644 --- a/drivers/char/agp/hp-agp.c +++ b/drivers/char/agp/hp-agp.c | |||
@@ -476,7 +476,6 @@ zx1_gart_probe (acpi_handle obj, u32 depth, void *context, void **ret) | |||
476 | { | 476 | { |
477 | acpi_handle handle, parent; | 477 | acpi_handle handle, parent; |
478 | acpi_status status; | 478 | acpi_status status; |
479 | struct acpi_buffer buffer; | ||
480 | struct acpi_device_info *info; | 479 | struct acpi_device_info *info; |
481 | u64 lba_hpa, sba_hpa, length; | 480 | u64 lba_hpa, sba_hpa, length; |
482 | int match; | 481 | int match; |
@@ -488,13 +487,11 @@ zx1_gart_probe (acpi_handle obj, u32 depth, void *context, void **ret) | |||
488 | /* Look for an enclosing IOC scope and find its CSR space */ | 487 | /* Look for an enclosing IOC scope and find its CSR space */ |
489 | handle = obj; | 488 | handle = obj; |
490 | do { | 489 | do { |
491 | buffer.length = ACPI_ALLOCATE_LOCAL_BUFFER; | 490 | status = acpi_get_object_info(handle, &info); |
492 | status = acpi_get_object_info(handle, &buffer); | ||
493 | if (ACPI_SUCCESS(status)) { | 491 | if (ACPI_SUCCESS(status)) { |
494 | /* TBD check _CID also */ | 492 | /* TBD check _CID also */ |
495 | info = buffer.pointer; | 493 | info->hardware_id.string[sizeof(info->hardware_id.length)-1] = '\0'; |
496 | info->hardware_id.value[sizeof(info->hardware_id)-1] = '\0'; | 494 | match = (strcmp(info->hardware_id.string, "HWP0001") == 0); |
497 | match = (strcmp(info->hardware_id.value, "HWP0001") == 0); | ||
498 | kfree(info); | 495 | kfree(info); |
499 | if (match) { | 496 | if (match) { |
500 | status = hp_acpi_csr_space(handle, &sba_hpa, &length); | 497 | status = hp_acpi_csr_space(handle, &sba_hpa, &length); |
diff --git a/drivers/char/agp/uninorth-agp.c b/drivers/char/agp/uninorth-agp.c index 20ef1bf5e726..703959eba45a 100644 --- a/drivers/char/agp/uninorth-agp.c +++ b/drivers/char/agp/uninorth-agp.c | |||
@@ -270,7 +270,7 @@ static void uninorth_agp_enable(struct agp_bridge_data *bridge, u32 mode) | |||
270 | 270 | ||
271 | if ((uninorth_rev >= 0x30) && (uninorth_rev <= 0x33)) { | 271 | if ((uninorth_rev >= 0x30) && (uninorth_rev <= 0x33)) { |
272 | /* | 272 | /* |
273 | * We need to to set REQ_DEPTH to 7 for U3 versions 1.0, 2.1, | 273 | * We need to set REQ_DEPTH to 7 for U3 versions 1.0, 2.1, |
274 | * 2.2 and 2.3, Darwin do so. | 274 | * 2.2 and 2.3, Darwin do so. |
275 | */ | 275 | */ |
276 | if ((command >> AGPSTAT_RQ_DEPTH_SHIFT) > 7) | 276 | if ((command >> AGPSTAT_RQ_DEPTH_SHIFT) > 7) |
diff --git a/drivers/char/epca.c b/drivers/char/epca.c index ff647ca1c489..9d589e3144de 100644 --- a/drivers/char/epca.c +++ b/drivers/char/epca.c | |||
@@ -2239,7 +2239,7 @@ static void do_softint(struct work_struct *work) | |||
2239 | struct channel *ch = container_of(work, struct channel, tqueue); | 2239 | struct channel *ch = container_of(work, struct channel, tqueue); |
2240 | /* Called in response to a modem change event */ | 2240 | /* Called in response to a modem change event */ |
2241 | if (ch && ch->magic == EPCA_MAGIC) { | 2241 | if (ch && ch->magic == EPCA_MAGIC) { |
2242 | struct tty_struct *tty = tty_port_tty_get(&ch->port);; | 2242 | struct tty_struct *tty = tty_port_tty_get(&ch->port); |
2243 | 2243 | ||
2244 | if (tty && tty->driver_data) { | 2244 | if (tty && tty->driver_data) { |
2245 | if (test_and_clear_bit(EPCA_EVENT_HANGUP, &ch->event)) { | 2245 | if (test_and_clear_bit(EPCA_EVENT_HANGUP, &ch->event)) { |
diff --git a/drivers/char/hw_random/virtio-rng.c b/drivers/char/hw_random/virtio-rng.c index 32216b623248..962968f05b94 100644 --- a/drivers/char/hw_random/virtio-rng.c +++ b/drivers/char/hw_random/virtio-rng.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/scatterlist.h> | 21 | #include <linux/scatterlist.h> |
22 | #include <linux/spinlock.h> | 22 | #include <linux/spinlock.h> |
23 | #include <linux/virtio.h> | 23 | #include <linux/virtio.h> |
24 | #include <linux/virtio_ids.h> | ||
24 | #include <linux/virtio_rng.h> | 25 | #include <linux/virtio_rng.h> |
25 | 26 | ||
26 | /* The host will fill any buffer we give it with sweet, sweet randomness. We | 27 | /* The host will fill any buffer we give it with sweet, sweet randomness. We |
@@ -51,7 +52,7 @@ static void register_buffer(void) | |||
51 | 52 | ||
52 | sg_init_one(&sg, random_data+data_left, RANDOM_DATA_SIZE-data_left); | 53 | sg_init_one(&sg, random_data+data_left, RANDOM_DATA_SIZE-data_left); |
53 | /* There should always be room for one buffer. */ | 54 | /* There should always be room for one buffer. */ |
54 | if (vq->vq_ops->add_buf(vq, &sg, 0, 1, random_data) != 0) | 55 | if (vq->vq_ops->add_buf(vq, &sg, 0, 1, random_data) < 0) |
55 | BUG(); | 56 | BUG(); |
56 | vq->vq_ops->kick(vq); | 57 | vq->vq_ops->kick(vq); |
57 | } | 58 | } |
diff --git a/drivers/char/ipmi/ipmi_poweroff.c b/drivers/char/ipmi/ipmi_poweroff.c index a261bd735dfb..2e66b5f773dd 100644 --- a/drivers/char/ipmi/ipmi_poweroff.c +++ b/drivers/char/ipmi/ipmi_poweroff.c | |||
@@ -691,7 +691,7 @@ static struct ctl_table_header *ipmi_table_header; | |||
691 | /* | 691 | /* |
692 | * Startup and shutdown functions. | 692 | * Startup and shutdown functions. |
693 | */ | 693 | */ |
694 | static int ipmi_poweroff_init(void) | 694 | static int __init ipmi_poweroff_init(void) |
695 | { | 695 | { |
696 | int rv; | 696 | int rv; |
697 | 697 | ||
@@ -725,7 +725,7 @@ static int ipmi_poweroff_init(void) | |||
725 | } | 725 | } |
726 | 726 | ||
727 | #ifdef MODULE | 727 | #ifdef MODULE |
728 | static __exit void ipmi_poweroff_cleanup(void) | 728 | static void __exit ipmi_poweroff_cleanup(void) |
729 | { | 729 | { |
730 | int rv; | 730 | int rv; |
731 | 731 | ||
diff --git a/drivers/char/misc.c b/drivers/char/misc.c index 1ee27cc23426..07fa612a58d5 100644 --- a/drivers/char/misc.c +++ b/drivers/char/misc.c | |||
@@ -91,7 +91,7 @@ static int misc_seq_show(struct seq_file *seq, void *v) | |||
91 | } | 91 | } |
92 | 92 | ||
93 | 93 | ||
94 | static struct seq_operations misc_seq_ops = { | 94 | static const struct seq_operations misc_seq_ops = { |
95 | .start = misc_seq_start, | 95 | .start = misc_seq_start, |
96 | .next = misc_seq_next, | 96 | .next = misc_seq_next, |
97 | .stop = misc_seq_stop, | 97 | .stop = misc_seq_stop, |
diff --git a/drivers/char/pcmcia/cm4000_cs.c b/drivers/char/pcmcia/cm4000_cs.c index 881934c068c8..c250a31efa53 100644 --- a/drivers/char/pcmcia/cm4000_cs.c +++ b/drivers/char/pcmcia/cm4000_cs.c | |||
@@ -1017,7 +1017,7 @@ static ssize_t cmm_read(struct file *filp, __user char *buf, size_t count, | |||
1017 | } | 1017 | } |
1018 | } | 1018 | } |
1019 | 1019 | ||
1020 | if (dev->proto == 0 && count > dev->rlen - dev->rpos) { | 1020 | if (dev->proto == 0 && count > dev->rlen - dev->rpos && i) { |
1021 | DEBUGP(4, dev, "T=0 and count > buffer\n"); | 1021 | DEBUGP(4, dev, "T=0 and count > buffer\n"); |
1022 | dev->rbuf[i] = dev->rbuf[i - 1]; | 1022 | dev->rbuf[i] = dev->rbuf[i - 1]; |
1023 | dev->rbuf[i - 1] = dev->procbyte; | 1023 | dev->rbuf[i - 1] = dev->procbyte; |
diff --git a/drivers/char/tpm/tpm.c b/drivers/char/tpm/tpm.c index 1f32b520ca26..45d58002b06c 100644 --- a/drivers/char/tpm/tpm.c +++ b/drivers/char/tpm/tpm.c | |||
@@ -696,7 +696,7 @@ int __tpm_pcr_read(struct tpm_chip *chip, int pcr_idx, u8 *res_buf) | |||
696 | 696 | ||
697 | cmd.header.in = pcrread_header; | 697 | cmd.header.in = pcrread_header; |
698 | cmd.params.pcrread_in.pcr_idx = cpu_to_be32(pcr_idx); | 698 | cmd.params.pcrread_in.pcr_idx = cpu_to_be32(pcr_idx); |
699 | BUILD_BUG_ON(cmd.header.in.length > READ_PCR_RESULT_SIZE); | 699 | BUG_ON(cmd.header.in.length > READ_PCR_RESULT_SIZE); |
700 | rc = transmit_cmd(chip, &cmd, cmd.header.in.length, | 700 | rc = transmit_cmd(chip, &cmd, cmd.header.in.length, |
701 | "attempting to read a pcr value"); | 701 | "attempting to read a pcr value"); |
702 | 702 | ||
diff --git a/drivers/char/tpm/tpm_bios.c b/drivers/char/tpm/tpm_bios.c index 0c2f55a38b95..bf2170fb1cdd 100644 --- a/drivers/char/tpm/tpm_bios.c +++ b/drivers/char/tpm/tpm_bios.c | |||
@@ -343,14 +343,14 @@ static int tpm_ascii_bios_measurements_show(struct seq_file *m, void *v) | |||
343 | return 0; | 343 | return 0; |
344 | } | 344 | } |
345 | 345 | ||
346 | static struct seq_operations tpm_ascii_b_measurments_seqops = { | 346 | static const struct seq_operations tpm_ascii_b_measurments_seqops = { |
347 | .start = tpm_bios_measurements_start, | 347 | .start = tpm_bios_measurements_start, |
348 | .next = tpm_bios_measurements_next, | 348 | .next = tpm_bios_measurements_next, |
349 | .stop = tpm_bios_measurements_stop, | 349 | .stop = tpm_bios_measurements_stop, |
350 | .show = tpm_ascii_bios_measurements_show, | 350 | .show = tpm_ascii_bios_measurements_show, |
351 | }; | 351 | }; |
352 | 352 | ||
353 | static struct seq_operations tpm_binary_b_measurments_seqops = { | 353 | static const struct seq_operations tpm_binary_b_measurments_seqops = { |
354 | .start = tpm_bios_measurements_start, | 354 | .start = tpm_bios_measurements_start, |
355 | .next = tpm_bios_measurements_next, | 355 | .next = tpm_bios_measurements_next, |
356 | .stop = tpm_bios_measurements_stop, | 356 | .stop = tpm_bios_measurements_stop, |
diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index c74dacfa6795..0d328b59568d 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c | |||
@@ -31,6 +31,7 @@ | |||
31 | #include <linux/err.h> | 31 | #include <linux/err.h> |
32 | #include <linux/init.h> | 32 | #include <linux/init.h> |
33 | #include <linux/virtio.h> | 33 | #include <linux/virtio.h> |
34 | #include <linux/virtio_ids.h> | ||
34 | #include <linux/virtio_console.h> | 35 | #include <linux/virtio_console.h> |
35 | #include "hvc_console.h" | 36 | #include "hvc_console.h" |
36 | 37 | ||
@@ -65,7 +66,7 @@ static int put_chars(u32 vtermno, const char *buf, int count) | |||
65 | 66 | ||
66 | /* add_buf wants a token to identify this buffer: we hand it any | 67 | /* add_buf wants a token to identify this buffer: we hand it any |
67 | * non-NULL pointer, since there's only ever one buffer. */ | 68 | * non-NULL pointer, since there's only ever one buffer. */ |
68 | if (out_vq->vq_ops->add_buf(out_vq, sg, 1, 0, (void *)1) == 0) { | 69 | if (out_vq->vq_ops->add_buf(out_vq, sg, 1, 0, (void *)1) >= 0) { |
69 | /* Tell Host to go! */ | 70 | /* Tell Host to go! */ |
70 | out_vq->vq_ops->kick(out_vq); | 71 | out_vq->vq_ops->kick(out_vq); |
71 | /* Chill out until it's done with the buffer. */ | 72 | /* Chill out until it's done with the buffer. */ |
@@ -85,7 +86,7 @@ static void add_inbuf(void) | |||
85 | sg_init_one(sg, inbuf, PAGE_SIZE); | 86 | sg_init_one(sg, inbuf, PAGE_SIZE); |
86 | 87 | ||
87 | /* We should always be able to add one buffer to an empty queue. */ | 88 | /* We should always be able to add one buffer to an empty queue. */ |
88 | if (in_vq->vq_ops->add_buf(in_vq, sg, 0, 1, inbuf) != 0) | 89 | if (in_vq->vq_ops->add_buf(in_vq, sg, 0, 1, inbuf) < 0) |
89 | BUG(); | 90 | BUG(); |
90 | in_vq->vq_ops->kick(in_vq); | 91 | in_vq->vq_ops->kick(in_vq); |
91 | } | 92 | } |