* [patch 11/28] PNP: whitespace/coding style fixes
2008-06-17 22:58 [patch 00/28] PNP: convert fixed tables to lists, v3 Bjorn Helgaas
@ 2008-06-17 22:58 ` Bjorn Helgaas
0 siblings, 0 replies; 4+ messages in thread
From: Bjorn Helgaas @ 2008-06-17 22:58 UTC (permalink / raw)
To: Len Brown
Cc: linux-acpi, Rene Herman, linux-kernel, Adam Belay, Adam M Belay,
Li Shaohua, Matthieu Castet, Thomas Renninger, Rene Herman,
Jaroslav Kysela, Andrew Morton, Takashi Iwai, Jiri Slaby
[-- Attachment #1: pnp-interface-style --]
[-- Type: text/plain, Size: 1897 bytes --]
No functional change; just make a couple declarations
consistent with the rest of the file.
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-by: Rene Herman <rene.herman@gmail.com>
Index: work10/drivers/pnp/interface.c
===================================================================
--- work10.orig/drivers/pnp/interface.c 2008-05-09 14:42:25.000000000 -0600
+++ work10/drivers/pnp/interface.c 2008-05-09 14:45:57.000000000 -0600
@@ -216,12 +216,12 @@ static ssize_t pnp_show_options(struct d
struct device_attribute *attr, char *buf)
{
struct pnp_dev *dev = to_pnp_dev(dmdev);
+ pnp_info_buffer_t *buffer;
struct pnp_option *independent = dev->independent;
struct pnp_option *dependent = dev->dependent;
int ret, dep = 1;
- pnp_info_buffer_t *buffer = (pnp_info_buffer_t *)
- pnp_alloc(sizeof(pnp_info_buffer_t));
+ buffer = pnp_alloc(sizeof(pnp_info_buffer_t));
if (!buffer)
return -ENOMEM;
@@ -248,17 +248,18 @@ static ssize_t pnp_show_current_resource
char *buf)
{
struct pnp_dev *dev = to_pnp_dev(dmdev);
+ pnp_info_buffer_t *buffer;
struct pnp_resource *pnp_res;
struct resource *res;
int ret;
- pnp_info_buffer_t *buffer;
if (!dev)
return -EINVAL;
- buffer = (pnp_info_buffer_t *) pnp_alloc(sizeof(pnp_info_buffer_t));
+ buffer = pnp_alloc(sizeof(pnp_info_buffer_t));
if (!buffer)
return -ENOMEM;
+
buffer->len = PAGE_SIZE;
buffer->buffer = buf;
buffer->curr = buffer->buffer;
@@ -295,9 +296,9 @@ static ssize_t pnp_show_current_resource
return ret;
}
-static ssize_t
-pnp_set_current_resources(struct device *dmdev, struct device_attribute *attr,
- const char *ubuf, size_t count)
+static ssize_t pnp_set_current_resources(struct device *dmdev,
+ struct device_attribute *attr,
+ const char *ubuf, size_t count)
{
struct pnp_dev *dev = to_pnp_dev(dmdev);
char *buf = (void *)ubuf;
--
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch 00/28] PNP: convert fixed tables to lists, v4
[not found] <20080627225651.663174474@ldl.fc.hp.com>
@ 2008-06-28 4:36 ` Len Brown
[not found] ` <20080627225800.517972351@ldl.fc.hp.com>
1 sibling, 0 replies; 4+ messages in thread
From: Len Brown @ 2008-06-28 4:36 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: Andi Kleen, linux-acpi, linux-kernel, Adam Belay, Adam M Belay,
Li Shaohua, Matthieu Castet, Thomas Renninger, Rene Herman,
Jaroslav Kysela, Andrew Morton, Takashi Iwai, Jiri Slaby,
David Howells, Bartlomiej Zolnierkiewicz
v4 has replaced v3 in the acpi-test tree.
thanks,
-Len
On Fri, 27 Jun 2008, Bjorn Helgaas wrote:
> This patch series contains all my PNP patches that are not yet in Linus'
> tree, including both the "convert resource table to dynamic list" series
> and the "convert resource options to unified dynamic list" series.
>
> This fixes all checkpatch warnings except a "do not add new typedefs"
> warning. I kept the pnp_irq_mask_t typedef because I don't see a
> better way to declare bitmaps in various places and pass around pointers
> to them.
>
> Len, I told you I was going to send incremental patches, but this is
> a replacement instead.
>
> Changes since v3:
>
> - Move IRQ test from pnpacpi_parse_irq_option() to
> pnpacpi_parse_ext_irq_option() (fixes "comparison is always true"
> warning noticed by David Howells)
> - Use pci_get_legacy_ide_irq(), not ATA_PRIMARY_IRQ()/ATA_SECONDARY_IRQ()
> (thanks to Bartlomiej Zolnierkiewicz)
> - Use snprintf() to make printks atomic
> - Fix checkpatch warnings (line length, "//" comments)
>
> Here are the significant changes since the last posting:
>
> - When replacing pnp_resource_table, the PNPACPI resource encoders
> have to explicitly handle disabled resources; previously any
> unused slots in the table were implicitly disabled. This should
> fix Jiri Slaby's oops on suspend/resume (though he hasn't tested
> this version).
>
> This change is in the patch titled "PNP: replace pnp_resource_table
> with dynamically allocated resources".
>
> - Added a new patch to keep disabled IRQ and DMA resources when parsing
> current config. This fixes a bug in the current (2.6.25) PNPACPI
> code: consider a device with (mem, irq0, irq1, io), where irq0 is
> disabled. If we drop irq0 when parsing the _CRS, we will mistakenly
> put irq1 in the irq0 slot when we encode resources for an _SRS call.
>
> - Added a new patch to avoid interrupts used by an IDE controller in
> compatibility mode. https://bugzilla.novell.com/show_bug.cgi?id=375836
>
> - Added a new PNPACPI patch to support HP vendor-specific descriptors.
> This has long been supported by arch/ia64/kernel/acpi-ext.c, which
> provides an hp_acpi_csr_space() interface, but I think it's better
> and more generic to support it in PNPACPI.
>
> Changes since v2 of "convert resource options to unified dynamic list":
>
> - fixed bisection problem in quirk_ad1815_mpu_resources()
> - fixed checkpatch warning in pnp_show_options()
> (pnp-convert-resource-options-to-single-linked-list-checkpatch-fixes.patch)
> - replaced pnp_independent_option() with literal 0
> - fixed coding style in pnp/manager.c
> - added EXPORT_SYMBOL(pnp_possible_config)
> (pnp-add-pnp_possible_config-can-a-device-could-be-configured-this-way-fix.patch)
>
> Bjorn
> --
> --
> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch 11/28] PNP: whitespace/coding style fixes
[not found] ` <20080627225800.517972351@ldl.fc.hp.com>
@ 2008-06-28 19:56 ` Joe Perches
2008-06-28 20:02 ` Rene Herman
0 siblings, 1 reply; 4+ messages in thread
From: Joe Perches @ 2008-06-28 19:56 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: Len Brown, Andi Kleen, linux-acpi, Rene Herman, linux-kernel,
Adam Belay, Adam M Belay, Li Shaohua, Matthieu Castet,
Thomas Renninger, Rene Herman, Jaroslav Kysela, Andrew Morton,
Takashi Iwai, Jiri Slaby, David Howells,
Bartlomiej Zolnierkiewicz
On Fri, 2008-06-27 at 16:57 -0600, Bjorn Helgaas wrote:
> Index: work10/drivers/pnp/interface.c
> ===================================================================
> --- work10.orig/drivers/pnp/interface.c 2008-05-09 14:42:25.000000000 -0600
> +++ work10/drivers/pnp/interface.c 2008-05-09 14:45:57.000000000 -0600
> @@ -216,12 +216,12 @@ static ssize_t pnp_show_options(struct d
> struct device_attribute *attr, char *buf)
> {
> struct pnp_dev *dev = to_pnp_dev(dmdev);
> + pnp_info_buffer_t *buffer;
> struct pnp_option *independent = dev->independent;
> struct pnp_option *dependent = dev->dependent;
> int ret, dep = 1;
>
> - pnp_info_buffer_t *buffer = (pnp_info_buffer_t *)
> - pnp_alloc(sizeof(pnp_info_buffer_t));
> + buffer = pnp_alloc(sizeof(pnp_info_buffer_t));
> if (!buffer)
> return -ENOMEM;
Wouldn't it be nicer without the unnecessary cast?
pnp_info_buffer_t *buffer = pnp_alloc(sizeof(*buffer));
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch 11/28] PNP: whitespace/coding style fixes
2008-06-28 19:56 ` [patch 11/28] PNP: whitespace/coding style fixes Joe Perches
@ 2008-06-28 20:02 ` Rene Herman
0 siblings, 0 replies; 4+ messages in thread
From: Rene Herman @ 2008-06-28 20:02 UTC (permalink / raw)
To: Joe Perches
Cc: Bjorn Helgaas, Len Brown, Andi Kleen, linux-acpi, Rene Herman,
linux-kernel, Adam Belay, Adam M Belay, Li Shaohua,
Matthieu Castet, Thomas Renninger, Jaroslav Kysela, Andrew Morton,
Takashi Iwai, Jiri Slaby, David Howells,
Bartlomiej Zolnierkiewicz
On 28-06-08 21:56, Joe Perches wrote:
> On Fri, 2008-06-27 at 16:57 -0600, Bjorn Helgaas wrote:
>> Index: work10/drivers/pnp/interface.c
>> ===================================================================
>> --- work10.orig/drivers/pnp/interface.c 2008-05-09 14:42:25.000000000 -0600
>> +++ work10/drivers/pnp/interface.c 2008-05-09 14:45:57.000000000 -0600
>> @@ -216,12 +216,12 @@ static ssize_t pnp_show_options(struct d
>> struct device_attribute *attr, char *buf)
>> {
>> struct pnp_dev *dev = to_pnp_dev(dmdev);
>> + pnp_info_buffer_t *buffer;
>> struct pnp_option *independent = dev->independent;
>> struct pnp_option *dependent = dev->dependent;
>> int ret, dep = 1;
>>
>> - pnp_info_buffer_t *buffer = (pnp_info_buffer_t *)
>> - pnp_alloc(sizeof(pnp_info_buffer_t));
>> + buffer = pnp_alloc(sizeof(pnp_info_buffer_t));
>> if (!buffer)
>> return -ENOMEM;
>
> Wouldn't it be nicer without the unnecessary cast?
>
> pnp_info_buffer_t *buffer = pnp_alloc(sizeof(*buffer));
He deleted the cast (the sizeof(type) versus sizeof(var) thing is mostly
personal preference).
Rene.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-06-28 20:01 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20080627225651.663174474@ldl.fc.hp.com>
2008-06-28 4:36 ` [patch 00/28] PNP: convert fixed tables to lists, v4 Len Brown
[not found] ` <20080627225800.517972351@ldl.fc.hp.com>
2008-06-28 19:56 ` [patch 11/28] PNP: whitespace/coding style fixes Joe Perches
2008-06-28 20:02 ` Rene Herman
2008-06-17 22:58 [patch 00/28] PNP: convert fixed tables to lists, v3 Bjorn Helgaas
2008-06-17 22:58 ` [patch 11/28] PNP: whitespace/coding style fixes Bjorn Helgaas
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).