diff mbox

[1/7] media: davinci: vpif: remove unwanted header includes

Message ID 1368709102-2854-2-git-send-email-prabhakar.csengg@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Lad, Prabhakar May 16, 2013, 12:58 p.m. UTC
From: Lad, Prabhakar <prabhakar.csengg@gmail.com>

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
---
 drivers/media/platform/davinci/vpif.c |    7 -------
 1 files changed, 0 insertions(+), 7 deletions(-)

Comments

Laurent Pinchart May 16, 2013, 1:02 p.m. UTC | #1
Hi Prabhakar,

Thank you for the patch.

On Thursday 16 May 2013 18:28:16 Lad Prabhakar wrote:
> From: Lad, Prabhakar <prabhakar.csengg@gmail.com>
> 
> Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
> ---
>  drivers/media/platform/davinci/vpif.c |    7 -------
>  1 files changed, 0 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/media/platform/davinci/vpif.c
> b/drivers/media/platform/davinci/vpif.c index ea82a8b..d354d50 100644
> --- a/drivers/media/platform/davinci/vpif.c
> +++ b/drivers/media/platform/davinci/vpif.c
> @@ -17,18 +17,11 @@
>   * GNU General Public License for more details.
>   */
> 
> -#include <linux/init.h>
>  #include <linux/module.h>
>  #include <linux/platform_device.h>
> -#include <linux/spinlock.h>
> -#include <linux/kernel.h>
> -#include <linux/io.h>
> -#include <linux/err.h>
>  #include <linux/pm_runtime.h>
>  #include <linux/v4l2-dv-timings.h>

I think you should keep most of those includes. For instance this file uses 
spinlock functions, so linux/spinlock.h should be included. It might work fine 
now due to nested includes, but if someone reorganizes the kernel headers 
internal includes then the driver might break. As a general rule of good 
practice you should include headers for all the APIs you use.

> 
> -#include <mach/hardware.h>
> -
>  #include "vpif.h"
> 
>  MODULE_DESCRIPTION("TI DaVinci Video Port Interface driver");
Lad, Prabhakar May 17, 2013, 5:10 a.m. UTC | #2
Hi Laurent,

Thanks for the review.

On Thu, May 16, 2013 at 6:32 PM, Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
> Hi Prabhakar,
>
> Thank you for the patch.
>
> On Thursday 16 May 2013 18:28:16 Lad Prabhakar wrote:
>> From: Lad, Prabhakar <prabhakar.csengg@gmail.com>
>>
>> Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
>> ---
>>  drivers/media/platform/davinci/vpif.c |    7 -------
>>  1 files changed, 0 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/media/platform/davinci/vpif.c
>> b/drivers/media/platform/davinci/vpif.c index ea82a8b..d354d50 100644
>> --- a/drivers/media/platform/davinci/vpif.c
>> +++ b/drivers/media/platform/davinci/vpif.c
>> @@ -17,18 +17,11 @@
>>   * GNU General Public License for more details.
>>   */
>>
>> -#include <linux/init.h>
>>  #include <linux/module.h>
>>  #include <linux/platform_device.h>
>> -#include <linux/spinlock.h>
>> -#include <linux/kernel.h>
>> -#include <linux/io.h>
>> -#include <linux/err.h>
>>  #include <linux/pm_runtime.h>
>>  #include <linux/v4l2-dv-timings.h>
>
> I think you should keep most of those includes. For instance this file uses
> spinlock functions, so linux/spinlock.h should be included. It might work fine
> now due to nested includes, but if someone reorganizes the kernel headers
> internal includes then the driver might break. As a general rule of good
> practice you should include headers for all the APIs you use.
>
OK, do you want me too drop the similar patches from this series ?

Regards,
--Prabhakar Lad
Laurent Pinchart May 17, 2013, 9:58 a.m. UTC | #3
Hi Prabhakar,

On Friday 17 May 2013 10:40:24 Prabhakar Lad wrote:
> On Thu, May 16, 2013 at 6:32 PM, Laurent Pinchart wrote:
> > On Thursday 16 May 2013 18:28:16 Lad Prabhakar wrote:
> >> From: Lad, Prabhakar <prabhakar.csengg@gmail.com>
> >> 
> >> Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
> >> ---
> >> 
> >>  drivers/media/platform/davinci/vpif.c |    7 -------
> >>  1 files changed, 0 insertions(+), 7 deletions(-)
> >> 
> >> diff --git a/drivers/media/platform/davinci/vpif.c
> >> b/drivers/media/platform/davinci/vpif.c index ea82a8b..d354d50 100644
> >> --- a/drivers/media/platform/davinci/vpif.c
> >> +++ b/drivers/media/platform/davinci/vpif.c
> >> @@ -17,18 +17,11 @@
> >>   * GNU General Public License for more details.
> >>   */
> >> 
> >> -#include <linux/init.h>
> >>  #include <linux/module.h>
> >>  #include <linux/platform_device.h>
> >> -#include <linux/spinlock.h>
> >> -#include <linux/kernel.h>
> >> -#include <linux/io.h>
> >> -#include <linux/err.h>
> >>  #include <linux/pm_runtime.h>
> >>  #include <linux/v4l2-dv-timings.h>
> > 
> > I think you should keep most of those includes. For instance this file
> > uses spinlock functions, so linux/spinlock.h should be included. It might
> > work fine now due to nested includes, but if someone reorganizes the
> > kernel headers internal includes then the driver might break. As a general
> > rule of good practice you should include headers for all the APIs you use.
> 
> OK, do you want me too drop the similar patches from this series ?

Please at least go through them and make sure to keep the includes for APIs 
used in the file. If there's unneeded includes you can of course remove them, 
and if it turns out that all includes are useful please drop the patch.
diff mbox

Patch

diff --git a/drivers/media/platform/davinci/vpif.c b/drivers/media/platform/davinci/vpif.c
index ea82a8b..d354d50 100644
--- a/drivers/media/platform/davinci/vpif.c
+++ b/drivers/media/platform/davinci/vpif.c
@@ -17,18 +17,11 @@ 
  * GNU General Public License for more details.
  */
 
-#include <linux/init.h>
 #include <linux/module.h>
 #include <linux/platform_device.h>
-#include <linux/spinlock.h>
-#include <linux/kernel.h>
-#include <linux/io.h>
-#include <linux/err.h>
 #include <linux/pm_runtime.h>
 #include <linux/v4l2-dv-timings.h>
 
-#include <mach/hardware.h>
-
 #include "vpif.h"
 
 MODULE_DESCRIPTION("TI DaVinci Video Port Interface driver");