Re: [PATCH] driver core/platform: remove unused implicit padding in platform_object

2014-06-02 Thread Dan Carpenter
On Sun, Jun 01, 2014 at 10:00:16AM +0200, Yann Droneaud wrote:
> Hi Dan,
> 
> Le samedi 31 mai 2014 à 15:05 +0300, Dan Carpenter a écrit :
> > On Sat, May 31, 2014 at 10:01:39AM +0200, Yann Droneaud wrote:
> > > Le vendredi 30 mai 2014 à 23:10 +0300, Dan Carpenter a écrit :
> > > > This changelog doesn't match the patch.
> > > > 
> > > 
> > > Hum, let me guess  I've failed to set the proper subject prefix
> > > to add v6 suffic to PATCH: 
> > > I've changed the patch title since v5 (from Emil Goode)... so it's like
> > > a new one.
> > > 
> > > Is it really necessary to resend the patch ?
> > 
> > Oh.  Sorry, I didn't understand what you were trying to say...  You're
> > right.
> > 
> 
> Sorry about that.
> 
> If it's unclear, I should modify the commit message.

It's clear.  Sorry that was my bad.

regards,
dan carpenter

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] driver core/platform: remove unused implicit padding in platform_object

2014-06-02 Thread Dan Carpenter
On Sun, Jun 01, 2014 at 10:00:16AM +0200, Yann Droneaud wrote:
 Hi Dan,
 
 Le samedi 31 mai 2014 à 15:05 +0300, Dan Carpenter a écrit :
  On Sat, May 31, 2014 at 10:01:39AM +0200, Yann Droneaud wrote:
   Le vendredi 30 mai 2014 à 23:10 +0300, Dan Carpenter a écrit :
This changelog doesn't match the patch.

   
   Hum, let me guess  I've failed to set the proper subject prefix
   to add v6 suffic to PATCH: 
   I've changed the patch title since v5 (from Emil Goode)... so it's like
   a new one.
   
   Is it really necessary to resend the patch ?
  
  Oh.  Sorry, I didn't understand what you were trying to say...  You're
  right.
  
 
 Sorry about that.
 
 If it's unclear, I should modify the commit message.

It's clear.  Sorry that was my bad.

regards,
dan carpenter

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] driver core/platform: remove unused implicit padding in platform_object

2014-06-01 Thread Greg Kroah-Hartman
On Sun, Jun 01, 2014 at 10:00:16AM +0200, Yann Droneaud wrote:
> Hi Dan,
> 
> Le samedi 31 mai 2014 à 15:05 +0300, Dan Carpenter a écrit :
> > On Sat, May 31, 2014 at 10:01:39AM +0200, Yann Droneaud wrote:
> > > Le vendredi 30 mai 2014 à 23:10 +0300, Dan Carpenter a écrit :
> > > > This changelog doesn't match the patch.
> > > > 
> > > 
> > > Hum, let me guess  I've failed to set the proper subject prefix
> > > to add v6 suffic to PATCH: 
> > > I've changed the patch title since v5 (from Emil Goode)... so it's like
> > > a new one.
> > > 
> > > Is it really necessary to resend the patch ?
> > 
> > Oh.  Sorry, I didn't understand what you were trying to say...  You're
> > right.
> > 
> 
> Sorry about that.
> 
> If it's unclear, I should modify the commit message.

Nah, it looks good, I'll queue it up this week, thanks.

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] driver core/platform: remove unused implicit padding in platform_object

2014-06-01 Thread Uwe Kleine-König
Hello Yann,

On Fri, May 30, 2014 at 10:02:47PM +0200, Yann Droneaud wrote:
> Up to 7 bytes are wasted at the end of struct platform_object
> in the form of padding after name field: unfortunately this
> padding is not used when allocating the memory to hold the
> name.
> 
> This patch converts name array from name[1] to C99 flexible
> array name[] (equivalent to name[0]) so that no padding is
> required by the presence of this field. Memory allocation
> is updated to take care of allocating an additional byte for
> the NUL terminating character.
> 
> Built on Fedora 20, using GCC 4.8, for ARM, i386, SPARC64 and
> x86_64 architectures, the data structure layout can be reported
> with following command:
> 
>   $ pahole drivers/base/platform.o \
>--recursive \
>--class_name device,pdev_archdata,platform_device,platform_object
> 
> Please find below some comparisons of structure layout for arm,
> i386, sparc64 and x86_64 architecture before and after the patch.
> 
>   --- obj-arm/drivers/base/platform.o.pahole.v3.15-rc7-79-gfe45736f4134   
> 2014-05-30 10:32:06.290960701 +0200
>   +++ obj-arm/drivers/base/platform.o.pahole.v3.15-rc7-80-g2cdb06858d71   
> 2014-05-30 11:26:20.851988347 +0200
>   @@ -81,10 +81,9 @@
>  /* XXX last struct has 4 bytes of padding */
> 
>   /* --- cacheline 6 boundary (384 bytes) was 8 bytes ago --- */
>   -   char   name[1];  /*   392 1 */
>   +   char   name[0];  /*   392 0 */
> 
>   -   /* size: 400, cachelines: 7, members: 2 */
>   -   /* padding: 7 */
>   +   /* size: 392, cachelines: 7, members: 2 */
>   /* paddings: 1, sum paddings: 4 */
>   -   /* last cacheline: 16 bytes */
>   +   /* last cacheline: 8 bytes */
>};
> 
>   --- obj-i386/drivers/base/platform.o.pahole.v3.15-rc7-79-gfe45736f4134 
> 2014-05-30 10:32:06.305960691 +0200
>   +++ obj-i386/drivers/base/platform.o.pahole.v3.15-rc7-80-g2cdb06858d71 
> 2014-05-30 11:26:20.875988332 +0200
>   @@ -73,9 +73,8 @@
>struct platform_object {
>   struct platform_device pdev; /* 0   396 */
>   /* --- cacheline 6 boundary (384 bytes) was 12 bytes ago --- */
>   -   char   name[1];  /*   396 1 */
>   +   char   name[0];  /*   396 0 */
> 
>   -   /* size: 400, cachelines: 7, members: 2 */
>   -   /* padding: 3 */
>   -   /* last cacheline: 16 bytes */
>   +   /* size: 396, cachelines: 7, members: 2 */
>   +   /* last cacheline: 12 bytes */
>};
> 
>   --- obj-sparc64/drivers/base/platform.o.pahole.v3.15-rc7-79-gfe45736f4134 
> 2014-05-30 10:32:06.406960625 +0200
>   +++ obj-sparc64/drivers/base/platform.o.pahole.v3.15-rc7-80-g2cdb06858d71 
> 2014-05-30 11:26:20.971988269 +0200
>   @@ -94,9 +94,8 @@
>struct platform_object {
>   struct platform_device pdev; /* 0  2208 */
>   /* --- cacheline 34 boundary (2176 bytes) was 32 bytes ago --- */
>   -   char   name[1];  /*  2208 1 */
>   +   char   name[0];  /*  2208 0 */
> 
>   -   /* size: 2216, cachelines: 35, members: 2 */
>   -   /* padding: 7 */
>   -   /* last cacheline: 40 bytes */
>   +   /* size: 2208, cachelines: 35, members: 2 */
>   +   /* last cacheline: 32 bytes */
>};
> 
>   --- obj-x86_64/drivers/base/platform.o.pahole.v3.15-rc7-79-gfe45736f4134 
> 2014-05-30 10:32:06.432960608 +0200
>   +++ obj-x86_64/drivers/base/platform.o.pahole.v3.15-rc7-80-g2cdb06858d71 
> 2014-05-30 11:26:21.000988250 +0200
>   @@ -84,9 +84,8 @@
>struct platform_object {
>   struct platform_device pdev; /* 0   720 */
>   /* --- cacheline 11 boundary (704 bytes) was 16 bytes ago --- */
>   -   char   name[1];  /*   720 1 */
>   +   char   name[0];  /*   720 0 */
> 
>   -   /* size: 728, cachelines: 12, members: 2 */
>   -   /* padding: 7 */
>   -   /* last cacheline: 24 bytes */
>   +   /* size: 720, cachelines: 12, members: 2 */
>   +   /* last cacheline: 16 bytes */
>};
> 
> Changes from v5 [1]:
> - dropped dma_mask allocation changes and only kept padding
>   removal changes (name array length set to 0).
> 
> Changes from v4 [2]:
> [by Emil Goode :]
> - Split v4 of the patch into two separate patches.
> - Generated new object file size and data structure layout info.
> - Updated the changelog message.
> 
> Changes from v3 [3]:
> - fixed commit message so that git am doesn't fail.
> 
> Changes from v2 [4]:
> - move 'dma_mask' to platform_object so that it's always
>   allocated and won't leak on release; remove all previously
>   added support functions.
> - use C99 flexible array member for 'name' to remove padding
>   at the end of platform_object.
> 
> Changes from v1 [5]:
> - remove unneeded kfree() from error path
> - add reference to 

Re: [PATCH] driver core/platform: remove unused implicit padding in platform_object

2014-06-01 Thread Yann Droneaud
Hi Dan,

Le samedi 31 mai 2014 à 15:05 +0300, Dan Carpenter a écrit :
> On Sat, May 31, 2014 at 10:01:39AM +0200, Yann Droneaud wrote:
> > Le vendredi 30 mai 2014 à 23:10 +0300, Dan Carpenter a écrit :
> > > This changelog doesn't match the patch.
> > > 
> > 
> > Hum, let me guess  I've failed to set the proper subject prefix
> > to add v6 suffic to PATCH: 
> > I've changed the patch title since v5 (from Emil Goode)... so it's like
> > a new one.
> > 
> > Is it really necessary to resend the patch ?
> 
> Oh.  Sorry, I didn't understand what you were trying to say...  You're
> right.
> 

Sorry about that.

If it's unclear, I should modify the commit message.

> For some reason I just looked at the patch first and then I started
> reading the changelog and got to the bit about GCC on ARM and said
> thought have been describing a different change without reading the
> rest.  This was my bad.  I should have read more carefully.
> 
> Very thourough patch description.  :)
> 

Thank you.

Regards.

-- 
Yann Droneaud
OPTEYA


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] driver core/platform: remove unused implicit padding in platform_object

2014-06-01 Thread Yann Droneaud
Hi Dan,

Le samedi 31 mai 2014 à 15:05 +0300, Dan Carpenter a écrit :
 On Sat, May 31, 2014 at 10:01:39AM +0200, Yann Droneaud wrote:
  Le vendredi 30 mai 2014 à 23:10 +0300, Dan Carpenter a écrit :
   This changelog doesn't match the patch.
   
  
  Hum, let me guess  I've failed to set the proper subject prefix
  to add v6 suffic to PATCH: 
  I've changed the patch title since v5 (from Emil Goode)... so it's like
  a new one.
  
  Is it really necessary to resend the patch ?
 
 Oh.  Sorry, I didn't understand what you were trying to say...  You're
 right.
 

Sorry about that.

If it's unclear, I should modify the commit message.

 For some reason I just looked at the patch first and then I started
 reading the changelog and got to the bit about GCC on ARM and said
 thought have been describing a different change without reading the
 rest.  This was my bad.  I should have read more carefully.
 
 Very thourough patch description.  :)
 

Thank you.

Regards.

-- 
Yann Droneaud
OPTEYA


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] driver core/platform: remove unused implicit padding in platform_object

2014-06-01 Thread Uwe Kleine-König
Hello Yann,

On Fri, May 30, 2014 at 10:02:47PM +0200, Yann Droneaud wrote:
 Up to 7 bytes are wasted at the end of struct platform_object
 in the form of padding after name field: unfortunately this
 padding is not used when allocating the memory to hold the
 name.
 
 This patch converts name array from name[1] to C99 flexible
 array name[] (equivalent to name[0]) so that no padding is
 required by the presence of this field. Memory allocation
 is updated to take care of allocating an additional byte for
 the NUL terminating character.
 
 Built on Fedora 20, using GCC 4.8, for ARM, i386, SPARC64 and
 x86_64 architectures, the data structure layout can be reported
 with following command:
 
   $ pahole drivers/base/platform.o \
--recursive \
--class_name device,pdev_archdata,platform_device,platform_object
 
 Please find below some comparisons of structure layout for arm,
 i386, sparc64 and x86_64 architecture before and after the patch.
 
   --- obj-arm/drivers/base/platform.o.pahole.v3.15-rc7-79-gfe45736f4134   
 2014-05-30 10:32:06.290960701 +0200
   +++ obj-arm/drivers/base/platform.o.pahole.v3.15-rc7-80-g2cdb06858d71   
 2014-05-30 11:26:20.851988347 +0200
   @@ -81,10 +81,9 @@
  /* XXX last struct has 4 bytes of padding */
 
   /* --- cacheline 6 boundary (384 bytes) was 8 bytes ago --- */
   -   char   name[1];  /*   392 1 */
   +   char   name[0];  /*   392 0 */
 
   -   /* size: 400, cachelines: 7, members: 2 */
   -   /* padding: 7 */
   +   /* size: 392, cachelines: 7, members: 2 */
   /* paddings: 1, sum paddings: 4 */
   -   /* last cacheline: 16 bytes */
   +   /* last cacheline: 8 bytes */
};
 
   --- obj-i386/drivers/base/platform.o.pahole.v3.15-rc7-79-gfe45736f4134 
 2014-05-30 10:32:06.305960691 +0200
   +++ obj-i386/drivers/base/platform.o.pahole.v3.15-rc7-80-g2cdb06858d71 
 2014-05-30 11:26:20.875988332 +0200
   @@ -73,9 +73,8 @@
struct platform_object {
   struct platform_device pdev; /* 0   396 */
   /* --- cacheline 6 boundary (384 bytes) was 12 bytes ago --- */
   -   char   name[1];  /*   396 1 */
   +   char   name[0];  /*   396 0 */
 
   -   /* size: 400, cachelines: 7, members: 2 */
   -   /* padding: 3 */
   -   /* last cacheline: 16 bytes */
   +   /* size: 396, cachelines: 7, members: 2 */
   +   /* last cacheline: 12 bytes */
};
 
   --- obj-sparc64/drivers/base/platform.o.pahole.v3.15-rc7-79-gfe45736f4134 
 2014-05-30 10:32:06.406960625 +0200
   +++ obj-sparc64/drivers/base/platform.o.pahole.v3.15-rc7-80-g2cdb06858d71 
 2014-05-30 11:26:20.971988269 +0200
   @@ -94,9 +94,8 @@
struct platform_object {
   struct platform_device pdev; /* 0  2208 */
   /* --- cacheline 34 boundary (2176 bytes) was 32 bytes ago --- */
   -   char   name[1];  /*  2208 1 */
   +   char   name[0];  /*  2208 0 */
 
   -   /* size: 2216, cachelines: 35, members: 2 */
   -   /* padding: 7 */
   -   /* last cacheline: 40 bytes */
   +   /* size: 2208, cachelines: 35, members: 2 */
   +   /* last cacheline: 32 bytes */
};
 
   --- obj-x86_64/drivers/base/platform.o.pahole.v3.15-rc7-79-gfe45736f4134 
 2014-05-30 10:32:06.432960608 +0200
   +++ obj-x86_64/drivers/base/platform.o.pahole.v3.15-rc7-80-g2cdb06858d71 
 2014-05-30 11:26:21.000988250 +0200
   @@ -84,9 +84,8 @@
struct platform_object {
   struct platform_device pdev; /* 0   720 */
   /* --- cacheline 11 boundary (704 bytes) was 16 bytes ago --- */
   -   char   name[1];  /*   720 1 */
   +   char   name[0];  /*   720 0 */
 
   -   /* size: 728, cachelines: 12, members: 2 */
   -   /* padding: 7 */
   -   /* last cacheline: 24 bytes */
   +   /* size: 720, cachelines: 12, members: 2 */
   +   /* last cacheline: 16 bytes */
};
 
 Changes from v5 [1]:
 - dropped dma_mask allocation changes and only kept padding
   removal changes (name array length set to 0).
 
 Changes from v4 [2]:
 [by Emil Goode emilgo...@gmail.com:]
 - Split v4 of the patch into two separate patches.
 - Generated new object file size and data structure layout info.
 - Updated the changelog message.
 
 Changes from v3 [3]:
 - fixed commit message so that git am doesn't fail.
 
 Changes from v2 [4]:
 - move 'dma_mask' to platform_object so that it's always
   allocated and won't leak on release; remove all previously
   added support functions.
 - use C99 flexible array member for 'name' to remove padding
   at the end of platform_object.
 
 Changes from v1 [5]:
 - remove unneeded kfree() from error path
 - add reference to author/commit adding allocation of dmamask
 
 Changes from v0 [6]:
 - small rewrite to squeeze the 

Re: [PATCH] driver core/platform: remove unused implicit padding in platform_object

2014-06-01 Thread Greg Kroah-Hartman
On Sun, Jun 01, 2014 at 10:00:16AM +0200, Yann Droneaud wrote:
 Hi Dan,
 
 Le samedi 31 mai 2014 à 15:05 +0300, Dan Carpenter a écrit :
  On Sat, May 31, 2014 at 10:01:39AM +0200, Yann Droneaud wrote:
   Le vendredi 30 mai 2014 à 23:10 +0300, Dan Carpenter a écrit :
This changelog doesn't match the patch.

   
   Hum, let me guess  I've failed to set the proper subject prefix
   to add v6 suffic to PATCH: 
   I've changed the patch title since v5 (from Emil Goode)... so it's like
   a new one.
   
   Is it really necessary to resend the patch ?
  
  Oh.  Sorry, I didn't understand what you were trying to say...  You're
  right.
  
 
 Sorry about that.
 
 If it's unclear, I should modify the commit message.

Nah, it looks good, I'll queue it up this week, thanks.

greg k-h
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] driver core/platform: remove unused implicit padding in platform_object

2014-05-31 Thread Dan Carpenter
On Sat, May 31, 2014 at 10:01:39AM +0200, Yann Droneaud wrote:
> Hi Dan,
> 
> Le vendredi 30 mai 2014 à 23:10 +0300, Dan Carpenter a écrit :
> > This changelog doesn't match the patch.
> > 
> 
> Hum, let me guess  I've failed to set the proper subject prefix
> to add v6 suffic to PATCH: 
> I've changed the patch title since v5 (from Emil Goode)... so it's like
> a new one.
> 
> Is it really necessary to resend the patch ?

Oh.  Sorry, I didn't understand what you were trying to say...  You're
right.

For some reason I just looked at the patch first and then I started
reading the changelog and got to the bit about GCC on ARM and said
thought have been describing a different change without reading the
rest.  This was my bad.  I should have read more carefully.

Very thourough patch description.  :)

regards,
dan carpenter

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] driver core/platform: remove unused implicit padding in platform_object

2014-05-31 Thread Yann Droneaud
Hi Dan,

Le vendredi 30 mai 2014 à 23:10 +0300, Dan Carpenter a écrit :
> This changelog doesn't match the patch.
> 

Hum, let me guess  I've failed to set the proper subject prefix
to add v6 suffic to PATCH: 
I've changed the patch title since v5 (from Emil Goode)... so it's like
a new one.

Is it really necessary to resend the patch ?

Regards.

-- 
Yann Droneaud
OPTEYA


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] driver core/platform: remove unused implicit padding in platform_object

2014-05-31 Thread Yann Droneaud
Hi Dan,

Le vendredi 30 mai 2014 à 23:10 +0300, Dan Carpenter a écrit :
 This changelog doesn't match the patch.
 

Hum, let me guess  I've failed to set the proper subject prefix
to add v6 suffic to PATCH: 
I've changed the patch title since v5 (from Emil Goode)... so it's like
a new one.

Is it really necessary to resend the patch ?

Regards.

-- 
Yann Droneaud
OPTEYA


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] driver core/platform: remove unused implicit padding in platform_object

2014-05-31 Thread Dan Carpenter
On Sat, May 31, 2014 at 10:01:39AM +0200, Yann Droneaud wrote:
 Hi Dan,
 
 Le vendredi 30 mai 2014 à 23:10 +0300, Dan Carpenter a écrit :
  This changelog doesn't match the patch.
  
 
 Hum, let me guess  I've failed to set the proper subject prefix
 to add v6 suffic to PATCH: 
 I've changed the patch title since v5 (from Emil Goode)... so it's like
 a new one.
 
 Is it really necessary to resend the patch ?

Oh.  Sorry, I didn't understand what you were trying to say...  You're
right.

For some reason I just looked at the patch first and then I started
reading the changelog and got to the bit about GCC on ARM and said
thought have been describing a different change without reading the
rest.  This was my bad.  I should have read more carefully.

Very thourough patch description.  :)

regards,
dan carpenter

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] driver core/platform: remove unused implicit padding in platform_object

2014-05-30 Thread Yann Droneaud
Up to 7 bytes are wasted at the end of struct platform_object
in the form of padding after name field: unfortunately this
padding is not used when allocating the memory to hold the
name.

This patch converts name array from name[1] to C99 flexible
array name[] (equivalent to name[0]) so that no padding is
required by the presence of this field. Memory allocation
is updated to take care of allocating an additional byte for
the NUL terminating character.

Built on Fedora 20, using GCC 4.8, for ARM, i386, SPARC64 and
x86_64 architectures, the data structure layout can be reported
with following command:

  $ pahole drivers/base/platform.o \
   --recursive \
   --class_name device,pdev_archdata,platform_device,platform_object

Please find below some comparisons of structure layout for arm,
i386, sparc64 and x86_64 architecture before and after the patch.

  --- obj-arm/drivers/base/platform.o.pahole.v3.15-rc7-79-gfe45736f4134 
2014-05-30 10:32:06.290960701 +0200
  +++ obj-arm/drivers/base/platform.o.pahole.v3.15-rc7-80-g2cdb06858d71 
2014-05-30 11:26:20.851988347 +0200
  @@ -81,10 +81,9 @@
 /* XXX last struct has 4 bytes of padding */

/* --- cacheline 6 boundary (384 bytes) was 8 bytes ago --- */
  - char   name[1];  /*   392 1 */
  + char   name[0];  /*   392 0 */

  - /* size: 400, cachelines: 7, members: 2 */
  - /* padding: 7 */
  + /* size: 392, cachelines: 7, members: 2 */
/* paddings: 1, sum paddings: 4 */
  - /* last cacheline: 16 bytes */
  + /* last cacheline: 8 bytes */
   };

  --- obj-i386/drivers/base/platform.o.pahole.v3.15-rc7-79-gfe45736f4134 
2014-05-30 10:32:06.305960691 +0200
  +++ obj-i386/drivers/base/platform.o.pahole.v3.15-rc7-80-g2cdb06858d71 
2014-05-30 11:26:20.875988332 +0200
  @@ -73,9 +73,8 @@
   struct platform_object {
struct platform_device pdev; /* 0   396 */
/* --- cacheline 6 boundary (384 bytes) was 12 bytes ago --- */
  - char   name[1];  /*   396 1 */
  + char   name[0];  /*   396 0 */

  - /* size: 400, cachelines: 7, members: 2 */
  - /* padding: 3 */
  - /* last cacheline: 16 bytes */
  + /* size: 396, cachelines: 7, members: 2 */
  + /* last cacheline: 12 bytes */
   };

  --- obj-sparc64/drivers/base/platform.o.pahole.v3.15-rc7-79-gfe45736f4134 
2014-05-30 10:32:06.406960625 +0200
  +++ obj-sparc64/drivers/base/platform.o.pahole.v3.15-rc7-80-g2cdb06858d71 
2014-05-30 11:26:20.971988269 +0200
  @@ -94,9 +94,8 @@
   struct platform_object {
struct platform_device pdev; /* 0  2208 */
/* --- cacheline 34 boundary (2176 bytes) was 32 bytes ago --- */
  - char   name[1];  /*  2208 1 */
  + char   name[0];  /*  2208 0 */

  - /* size: 2216, cachelines: 35, members: 2 */
  - /* padding: 7 */
  - /* last cacheline: 40 bytes */
  + /* size: 2208, cachelines: 35, members: 2 */
  + /* last cacheline: 32 bytes */
   };

  --- obj-x86_64/drivers/base/platform.o.pahole.v3.15-rc7-79-gfe45736f4134 
2014-05-30 10:32:06.432960608 +0200
  +++ obj-x86_64/drivers/base/platform.o.pahole.v3.15-rc7-80-g2cdb06858d71 
2014-05-30 11:26:21.000988250 +0200
  @@ -84,9 +84,8 @@
   struct platform_object {
struct platform_device pdev; /* 0   720 */
/* --- cacheline 11 boundary (704 bytes) was 16 bytes ago --- */
  - char   name[1];  /*   720 1 */
  + char   name[0];  /*   720 0 */

  - /* size: 728, cachelines: 12, members: 2 */
  - /* padding: 7 */
  - /* last cacheline: 24 bytes */
  + /* size: 720, cachelines: 12, members: 2 */
  + /* last cacheline: 16 bytes */
   };

Changes from v5 [1]:
- dropped dma_mask allocation changes and only kept padding
  removal changes (name array length set to 0).

Changes from v4 [2]:
[by Emil Goode :]
- Split v4 of the patch into two separate patches.
- Generated new object file size and data structure layout info.
- Updated the changelog message.

Changes from v3 [3]:
- fixed commit message so that git am doesn't fail.

Changes from v2 [4]:
- move 'dma_mask' to platform_object so that it's always
  allocated and won't leak on release; remove all previously
  added support functions.
- use C99 flexible array member for 'name' to remove padding
  at the end of platform_object.

Changes from v1 [5]:
- remove unneeded kfree() from error path
- add reference to author/commit adding allocation of dmamask

Changes from v0 [6]:
- small rewrite to squeeze the patch to a bare minimal

[1] 
http://lkml.kernel.org/r/1401122483-31603-2-git-send-email-emilgo...@gmail.com


Re: [PATCH] driver core/platform: remove unused implicit padding in platform_object

2014-05-30 Thread Dan Carpenter
This changelog doesn't match the patch.

regards,
dan carpenter


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] driver core/platform: remove unused implicit padding in platform_object

2014-05-30 Thread Dan Carpenter
This changelog doesn't match the patch.

regards,
dan carpenter


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] driver core/platform: remove unused implicit padding in platform_object

2014-05-30 Thread Yann Droneaud
Up to 7 bytes are wasted at the end of struct platform_object
in the form of padding after name field: unfortunately this
padding is not used when allocating the memory to hold the
name.

This patch converts name array from name[1] to C99 flexible
array name[] (equivalent to name[0]) so that no padding is
required by the presence of this field. Memory allocation
is updated to take care of allocating an additional byte for
the NUL terminating character.

Built on Fedora 20, using GCC 4.8, for ARM, i386, SPARC64 and
x86_64 architectures, the data structure layout can be reported
with following command:

  $ pahole drivers/base/platform.o \
   --recursive \
   --class_name device,pdev_archdata,platform_device,platform_object

Please find below some comparisons of structure layout for arm,
i386, sparc64 and x86_64 architecture before and after the patch.

  --- obj-arm/drivers/base/platform.o.pahole.v3.15-rc7-79-gfe45736f4134 
2014-05-30 10:32:06.290960701 +0200
  +++ obj-arm/drivers/base/platform.o.pahole.v3.15-rc7-80-g2cdb06858d71 
2014-05-30 11:26:20.851988347 +0200
  @@ -81,10 +81,9 @@
 /* XXX last struct has 4 bytes of padding */

/* --- cacheline 6 boundary (384 bytes) was 8 bytes ago --- */
  - char   name[1];  /*   392 1 */
  + char   name[0];  /*   392 0 */

  - /* size: 400, cachelines: 7, members: 2 */
  - /* padding: 7 */
  + /* size: 392, cachelines: 7, members: 2 */
/* paddings: 1, sum paddings: 4 */
  - /* last cacheline: 16 bytes */
  + /* last cacheline: 8 bytes */
   };

  --- obj-i386/drivers/base/platform.o.pahole.v3.15-rc7-79-gfe45736f4134 
2014-05-30 10:32:06.305960691 +0200
  +++ obj-i386/drivers/base/platform.o.pahole.v3.15-rc7-80-g2cdb06858d71 
2014-05-30 11:26:20.875988332 +0200
  @@ -73,9 +73,8 @@
   struct platform_object {
struct platform_device pdev; /* 0   396 */
/* --- cacheline 6 boundary (384 bytes) was 12 bytes ago --- */
  - char   name[1];  /*   396 1 */
  + char   name[0];  /*   396 0 */

  - /* size: 400, cachelines: 7, members: 2 */
  - /* padding: 3 */
  - /* last cacheline: 16 bytes */
  + /* size: 396, cachelines: 7, members: 2 */
  + /* last cacheline: 12 bytes */
   };

  --- obj-sparc64/drivers/base/platform.o.pahole.v3.15-rc7-79-gfe45736f4134 
2014-05-30 10:32:06.406960625 +0200
  +++ obj-sparc64/drivers/base/platform.o.pahole.v3.15-rc7-80-g2cdb06858d71 
2014-05-30 11:26:20.971988269 +0200
  @@ -94,9 +94,8 @@
   struct platform_object {
struct platform_device pdev; /* 0  2208 */
/* --- cacheline 34 boundary (2176 bytes) was 32 bytes ago --- */
  - char   name[1];  /*  2208 1 */
  + char   name[0];  /*  2208 0 */

  - /* size: 2216, cachelines: 35, members: 2 */
  - /* padding: 7 */
  - /* last cacheline: 40 bytes */
  + /* size: 2208, cachelines: 35, members: 2 */
  + /* last cacheline: 32 bytes */
   };

  --- obj-x86_64/drivers/base/platform.o.pahole.v3.15-rc7-79-gfe45736f4134 
2014-05-30 10:32:06.432960608 +0200
  +++ obj-x86_64/drivers/base/platform.o.pahole.v3.15-rc7-80-g2cdb06858d71 
2014-05-30 11:26:21.000988250 +0200
  @@ -84,9 +84,8 @@
   struct platform_object {
struct platform_device pdev; /* 0   720 */
/* --- cacheline 11 boundary (704 bytes) was 16 bytes ago --- */
  - char   name[1];  /*   720 1 */
  + char   name[0];  /*   720 0 */

  - /* size: 728, cachelines: 12, members: 2 */
  - /* padding: 7 */
  - /* last cacheline: 24 bytes */
  + /* size: 720, cachelines: 12, members: 2 */
  + /* last cacheline: 16 bytes */
   };

Changes from v5 [1]:
- dropped dma_mask allocation changes and only kept padding
  removal changes (name array length set to 0).

Changes from v4 [2]:
[by Emil Goode emilgo...@gmail.com:]
- Split v4 of the patch into two separate patches.
- Generated new object file size and data structure layout info.
- Updated the changelog message.

Changes from v3 [3]:
- fixed commit message so that git am doesn't fail.

Changes from v2 [4]:
- move 'dma_mask' to platform_object so that it's always
  allocated and won't leak on release; remove all previously
  added support functions.
- use C99 flexible array member for 'name' to remove padding
  at the end of platform_object.

Changes from v1 [5]:
- remove unneeded kfree() from error path
- add reference to author/commit adding allocation of dmamask

Changes from v0 [6]:
- small rewrite to squeeze the patch to a bare minimal

[1] 
http://lkml.kernel.org/r/1401122483-31603-2-git-send-email-emilgo...@gmail.com