lkml.org 
[lkml]   [2008]   [Jun]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch 11/28] PNP: whitespace/coding style fixes
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.


\
 
 \ /
  Last update: 2008-06-28 22:05    [W:0.124 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site