Re: [PATCH 00/18] use ARRAY_SIZE macro

2017-10-02 Thread Jérémy Lefaure
On Mon, 2 Oct 2017 15:22:24 -0400
bfie...@fieldses.org (J. Bruce Fields) wrote:

> Mainly I'd just like to know which you're asking for.  Do you want me to
> apply this, or to ACK it so someone else can?  If it's sent as a series
> I tend to assume the latter.
> 
> But in this case I'm assuming it's the former, so I'll pick up the nfsd
> one
Could you to apply the NFSD patch ("nfsd: use ARRAY_SIZE") with the
Reviewed-by: Jeff Layton ) tag please ?

This patch is an individual patch and it should not have been sent in a
series (sorry about that).

Thank you,
Jérémy
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 00/18] use ARRAY_SIZE macro

2017-10-01 Thread Jérémy Lefaure
On Mon, 2 Oct 2017 09:01:31 +1100
"Tobin C. Harding"  wrote:

> > In order to reduce the size of the To: and Cc: lines, each patch of the
> > series is sent only to the maintainers and lists concerned by the patch.
> > This cover letter is sent to every list concerned by this series.  
> 
> Why don't you just send individual patches for each subsystem? I'm not a 
> maintainer but I don't see
> how any one person is going to be able to apply this whole series, it is 
> making it hard for
> maintainers if they have to pick patches out from among the series (if indeed 
> any will bother
> doing that).
Yeah, maybe it would have been better to send individual patches.

From my point of view it's a series because the patches are related (I
did a git format-patch from my local branch). But for the maintainers
point of view, they are individual patches.

As each patch in this series is standalone, the maintainers can pick
the patches they want and apply them individually. So yeah, maybe I
should have sent individual patches. But I also wanted to tie all
patches together as it's the same change.

Anyway, I can tell to each maintainer that they can apply the patches
they're concerned about and next time I may send individual patches.

Thank you for your answer,
Jérémy
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 17/18] staging: rtl8723bs: use ARRAY_SIZE

2017-10-01 Thread Jérémy Lefaure
Using the ARRAY_SIZE macro improves the readability of the code. Also,
it is not always useful to use a variable to store this constant
calculated at compile time.

Found with Coccinelle with the following semantic patch:
@r depends on (org || report)@
type T;
T[] E;
position p;
@@
(
 (sizeof(E)@p /sizeof(*E))
|
 (sizeof(E)@p /sizeof(E[...]))
|
 (sizeof(E)@p /sizeof(T))
)

Signed-off-by: Jérémy Lefaure 
---
 drivers/staging/rtl8723bs/core/rtw_mlme_ext.c |  5 +-
 drivers/staging/rtl8723bs/core/rtw_rf.c   |  7 +--
 drivers/staging/rtl8723bs/hal/HalHWImg8723B_BB.c  |  9 ++-
 drivers/staging/rtl8723bs/hal/HalHWImg8723B_MAC.c |  4 +-
 drivers/staging/rtl8723bs/hal/HalHWImg8723B_RF.c  |  7 +--
 drivers/staging/rtl8723bs/hal/hal_com.c   |  4 +-
 drivers/staging/rtl8723bs/hal/hal_com_phycfg.c| 69 +++
 drivers/staging/rtl8723bs/os_dep/ioctl_linux.c| 11 ++--
 8 files changed, 68 insertions(+), 48 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c 
b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
index 6c59fafeb769..d74159673b5e 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
@@ -17,6 +17,7 @@
 #include 
 #include 
 #include 
+#include 
 
 
 static struct mlme_handler mlme_sta_tbl[] = {
@@ -562,7 +563,7 @@ void mgt_dispatcher(struct adapter *padapter, union 
recv_frame *precv_frame)
 
index = GetFrameSubType(pframe) >> 4;
 
-   if (index >= (sizeof(mlme_sta_tbl) / sizeof(struct mlme_handler))) {
+   if (index >= ARRAY_SIZE(mlme_sta_tbl)) {
RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("Currently we do 
not support reserved sub-fr-type =%d\n", index));
return;
}
@@ -2227,7 +2228,7 @@ unsigned int OnAction(struct adapter *padapter, union 
recv_frame *precv_frame)
 
category = frame_body[0];
 
-   for (i = 0; i < sizeof(OnAction_tbl)/sizeof(struct action_handler); 
i++) {
+   for (i = 0; i < ARRAY_SIZE(OnAction_tbl); i++) {
ptable = &OnAction_tbl[i];
 
if (category == ptable->num)
diff --git a/drivers/staging/rtl8723bs/core/rtw_rf.c 
b/drivers/staging/rtl8723bs/core/rtw_rf.c
index b87ea4e388c0..07f5577cc073 100644
--- a/drivers/staging/rtl8723bs/core/rtw_rf.c
+++ b/drivers/staging/rtl8723bs/core/rtw_rf.c
@@ -15,6 +15,7 @@
 #define _RTW_RF_C_
 
 #include 
+#include 
 
 
 struct ch_freq {
@@ -44,20 +45,18 @@ static struct ch_freq ch_freq_map[] = {
{216, 5080},/* Japan, means J16 */
 };
 
-static int ch_freq_map_num = (sizeof(ch_freq_map) / sizeof(struct ch_freq));
-
 u32 rtw_ch2freq(u32 channel)
 {
u8 i;
u32 freq = 0;
 
-   for (i = 0; i < ch_freq_map_num; i++) {
+   for (i = 0; i < ARRAY_SIZE(ch_freq_map); i++) {
if (channel == ch_freq_map[i].channel) {
freq = ch_freq_map[i].frequency;
break;
}
}
-   if (i == ch_freq_map_num)
+   if (i == ARRAY_SIZE(ch_freq_map))
freq = 2412;
 
return freq;
diff --git a/drivers/staging/rtl8723bs/hal/HalHWImg8723B_BB.c 
b/drivers/staging/rtl8723bs/hal/HalHWImg8723B_BB.c
index 51d4219177d3..951585467ab1 100644
--- a/drivers/staging/rtl8723bs/hal/HalHWImg8723B_BB.c
+++ b/drivers/staging/rtl8723bs/hal/HalHWImg8723B_BB.c
@@ -13,7 +13,7 @@
 *
 **/
 
-
+#include 
 #include "odm_precomp.h"
 
 static bool CheckPositive(
@@ -268,7 +268,7 @@ static u32 Array_MP_8723B_AGC_TAB[] = {
 void ODM_ReadAndConfig_MP_8723B_AGC_TAB(PDM_ODM_T pDM_Odm)
 {
u32 i = 0;
-   u32 ArrayLen = sizeof(Array_MP_8723B_AGC_TAB)/sizeof(u32);
+   u32 ArrayLen = ARRAY_SIZE(Array_MP_8723B_AGC_TAB);
u32 *Array = Array_MP_8723B_AGC_TAB;
 
ODM_RT_TRACE(
@@ -537,7 +537,7 @@ static u32 Array_MP_8723B_PHY_REG[] = {
 void ODM_ReadAndConfig_MP_8723B_PHY_REG(PDM_ODM_T pDM_Odm)
 {
u32 i = 0;
-   u32 ArrayLen = sizeof(Array_MP_8723B_PHY_REG)/sizeof(u32);
+   u32 ArrayLen = ARRAY_SIZE(Array_MP_8723B_PHY_REG);
u32 *Array = Array_MP_8723B_PHY_REG;
 
ODM_RT_TRACE(
@@ -617,7 +617,6 @@ static u32 Array_MP_8723B_PHY_REG_PG[] = {
 void ODM_ReadAndConfig_MP_8723B_PHY_REG_PG(PDM_ODM_T pDM_Odm)
 {
u32 i = 0;
-   u32 ArrayLen = sizeof(Array_MP_8723B_PHY_REG_PG)/sizeof(u32);
u32 *Array = Array_MP_8723B_PHY_REG_PG;
 
ODM_RT_TRACE(
@@ -630,7 +629,7 @@ void ODM_ReadAndConfig_MP_8723B_PHY_REG_PG(PDM_ODM_T 
pDM_Odm)
pDM_Odm->PhyRegPgVersion = 1;
pDM_Odm->PhyRegPgValueType = PHY_REG_PG_EXACT_VALUE;
 
-   for (i = 0; i < ArrayLen; i += 6) {
+   for (i = 0; i < ARRAY_SIZE(Array_MP_8723B_PHY_REG_PG); i += 6) {
u32 v1 = Array[i];
u32 v2 = Array[i+1];
u32 v3 = Array[i+2];
di

[PATCH 18/18] staging: rtlwifi: use ARRAY_SIZE

2017-10-01 Thread Jérémy Lefaure
Using the ARRAY_SIZE macro improves the readability of the code. Also,
it is useless to use a variable to store this constant calculated at
compile time.

Found with Coccinelle with the following semantic patch:
@r depends on (org || report)@
type T;
T[] E;
position p;
@@
(
 (sizeof(E)@p /sizeof(*E))
|
 (sizeof(E)@p /sizeof(E[...]))
|
 (sizeof(E)@p /sizeof(T))
)

Signed-off-by: Jérémy Lefaure 
---
 drivers/staging/rtlwifi/phydm/phydm_debug.c|  4 ++--
 drivers/staging/rtlwifi/phydm/rtl8822b/halhwimg8822b_bb.c  | 10 --
 drivers/staging/rtlwifi/phydm/rtl8822b/halhwimg8822b_mac.c |  4 ++--
 drivers/staging/rtlwifi/phydm/rtl8822b/halhwimg8822b_rf.c  | 13 +
 4 files changed, 13 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/rtlwifi/phydm/phydm_debug.c 
b/drivers/staging/rtlwifi/phydm/phydm_debug.c
index a5f90afdae9b..d4dd0fd3d1c7 100644
--- a/drivers/staging/rtlwifi/phydm/phydm_debug.c
+++ b/drivers/staging/rtlwifi/phydm/phydm_debug.c
@@ -29,6 +29,7 @@
 
 #include "mp_precomp.h"
 #include "phydm_precomp.h"
+#include 
 
 bool phydm_api_set_txagc(struct phy_dm_struct *, u32, enum odm_rf_radio_path,
 u8, bool);
@@ -2107,8 +2108,7 @@ void phydm_cmd_parser(struct phy_dm_struct *dm, char 
input[][MAX_ARGV],
 
/* Parsing Cmd ID */
if (input_num) {
-   phydm_ary_size =
-   sizeof(phy_dm_ary) / sizeof(struct phydm_command);
+   phydm_ary_size = ARRAY_SIZE(phy_dm_ary);
for (i = 0; i < phydm_ary_size; i++) {
if (strcmp(phy_dm_ary[i].name, input[0]) == 0) {
id = phy_dm_ary[i].id;
diff --git a/drivers/staging/rtlwifi/phydm/rtl8822b/halhwimg8822b_bb.c 
b/drivers/staging/rtlwifi/phydm/rtl8822b/halhwimg8822b_bb.c
index 4e7946019fcb..29d19f2b300e 100644
--- a/drivers/staging/rtlwifi/phydm/rtl8822b/halhwimg8822b_bb.c
+++ b/drivers/staging/rtlwifi/phydm/rtl8822b/halhwimg8822b_bb.c
@@ -26,6 +26,7 @@
 /*Image2HeaderVersion: 3.2*/
 #include "../mp_precomp.h"
 #include "../phydm_precomp.h"
+#include 
 
 static bool check_positive(struct phy_dm_struct *dm, const u32 condition1,
   const u32 condition2, const u32 condition3,
@@ -1350,7 +1351,6 @@ void odm_read_and_config_mp_8822b_agc_tab(struct 
phy_dm_struct *dm)
u32 i = 0;
u8 c_cond;
bool is_matched = true, is_skipped = false;
-   u32 array_len = sizeof(array_mp_8822b_agc_tab) / sizeof(u32);
u32 *array = array_mp_8822b_agc_tab;
 
u32 v1 = 0, v2 = 0, pre_v1 = 0, pre_v2 = 0;
@@ -1358,7 +1358,7 @@ void odm_read_and_config_mp_8822b_agc_tab(struct 
phy_dm_struct *dm)
ODM_RT_TRACE(dm, ODM_COMP_INIT,
 "===> %s\n", __func__);
 
-   for (; (i + 1) < array_len; i = i + 2) {
+   for (; (i + 1) < ARRAY_SIZE(array_mp_8822b_agc_tab); i = i + 2) {
v1 = array[i];
v2 = array[i + 1];
 
@@ -1843,7 +1843,6 @@ void odm_read_and_config_mp_8822b_phy_reg(struct 
phy_dm_struct *dm)
u32 i = 0;
u8 c_cond;
bool is_matched = true, is_skipped = false;
-   u32 array_len = sizeof(array_mp_8822b_phy_reg) / sizeof(u32);
u32 *array = array_mp_8822b_phy_reg;
 
u32 v1 = 0, v2 = 0, pre_v1 = 0, pre_v2 = 0;
@@ -1851,7 +1850,7 @@ void odm_read_and_config_mp_8822b_phy_reg(struct 
phy_dm_struct *dm)
ODM_RT_TRACE(dm, ODM_COMP_INIT,
 "===> %s\n", __func__);
 
-   for (; (i + 1) < array_len; i = i + 2) {
+   for (; (i + 1) < ARRAY_SIZE(array_mp_8822b_phy_reg); i = i + 2) {
v1 = array[i];
v2 = array[i + 1];
 
@@ -1947,7 +1946,6 @@ static u32 array_mp_8822b_phy_reg_pg[] = {
 void odm_read_and_config_mp_8822b_phy_reg_pg(struct phy_dm_struct *dm)
 {
u32 i = 0;
-   u32 array_len = sizeof(array_mp_8822b_phy_reg_pg) / sizeof(u32);
u32 *array = array_mp_8822b_phy_reg_pg;
 
ODM_RT_TRACE(dm, ODM_COMP_INIT,
@@ -1956,7 +1954,7 @@ void odm_read_and_config_mp_8822b_phy_reg_pg(struct 
phy_dm_struct *dm)
dm->phy_reg_pg_version = 1;
dm->phy_reg_pg_value_type = PHY_REG_PG_EXACT_VALUE;
 
-   for (i = 0; i < array_len; i += 6) {
+   for (i = 0; i < ARRAY_SIZE(array_mp_8822b_phy_reg_pg); i += 6) {
u32 v1 = array[i];
u32 v2 = array[i + 1];
u32 v3 = array[i + 2];
diff --git a/drivers/staging/rtlwifi/phydm/rtl8822b/halhwimg8822b_mac.c 
b/drivers/staging/rtlwifi/phydm/rtl8822b/halhwimg8822b_mac.c
index 1a9daed2e609..70924f002541 100644
--- a/drivers/staging/rtlwifi/phydm/rtl8822b/halhwimg8822b_mac.c
+++ b/drivers/staging/rtlwifi/phydm/rtl8822b/halhwimg8822b_mac.c
@@ -26,6 +26,7 @@
 /*Image2HeaderVersion: 3.2*/
 #include "../mp_precomp.h"
 #include "../phydm_precomp.h"
+#include 
 
 static bool chec

[PATCH 16/18] media: staging: atomisp: use ARRAY_SIZE

2017-10-01 Thread Jérémy Lefaure
Using the ARRAY_SIZE macro improves the readability of the code. Also,
it is useless to use a variable to store this constant calculated at
compile time.

Found with Coccinelle with the following semantic patch:
@r depends on (org || report)@
type T;
T[] E;
position p;
@@
(
 (sizeof(E)@p /sizeof(*E))
|
 (sizeof(E)@p /sizeof(E[...]))
|
 (sizeof(E)@p /sizeof(T))
)

Signed-off-by: Jérémy Lefaure 
---
 .../pci/atomisp2/css2400/camera/pipe/src/pipe_binarydesc.c   | 9 +++--
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git 
a/drivers/staging/media/atomisp/pci/atomisp2/css2400/camera/pipe/src/pipe_binarydesc.c
 
b/drivers/staging/media/atomisp/pci/atomisp2/css2400/camera/pipe/src/pipe_binarydesc.c
index 17d3b7de93ba..98a2a3e9b3e6 100644
--- 
a/drivers/staging/media/atomisp/pci/atomisp2/css2400/camera/pipe/src/pipe_binarydesc.c
+++ 
b/drivers/staging/media/atomisp/pci/atomisp2/css2400/camera/pipe/src/pipe_binarydesc.c
@@ -22,6 +22,7 @@
 #include 
 /* HRT_GDC_N */
 #include "gdc_device.h"
+#include 
 
 /* This module provides a binary descriptions to used to find a binary. Since,
  * every stage is associated with a binary, it implicity helps stage
@@ -147,11 +148,9 @@ enum ia_css_err 
sh_css_bds_factor_get_numerator_denominator(
unsigned int *bds_factor_denominator)
 {
unsigned int i;
-   unsigned int bds_list_size = sizeof(bds_factors_list) /
-   sizeof(struct sh_css_bds_factor);
 
/* Loop over all bds factors until a match is found */
-   for (i = 0; i < bds_list_size; i++) {
+   for (i = 0; i < ARRAY_SIZE(bds_factors_list); i++) {
if (bds_factors_list[i].bds_factor == bds_factor) {
*bds_factor_numerator = bds_factors_list[i].numerator;
*bds_factor_denominator = 
bds_factors_list[i].denominator;
@@ -170,8 +169,6 @@ enum ia_css_err binarydesc_calculate_bds_factor(
unsigned int *bds_factor)
 {
unsigned int i;
-   unsigned int bds_list_size = sizeof(bds_factors_list) /
-   sizeof(struct sh_css_bds_factor);
unsigned int in_w = input_res.width,
in_h = input_res.height,
out_w = output_res.width, out_h = output_res.height;
@@ -186,7 +183,7 @@ enum ia_css_err binarydesc_calculate_bds_factor(
assert(out_w != 0 && out_h != 0);
 
/* Loop over all bds factors until a match is found */
-   for (i = 0; i < bds_list_size; i++) {
+   for (i = 0; i < ARRAY_SIZE(bds_factors_list); i++) {
unsigned num = bds_factors_list[i].numerator;
unsigned den = bds_factors_list[i].denominator;
 
-- 
2.14.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 00/18] use ARRAY_SIZE macro

2017-10-01 Thread Jérémy Lefaure
Hi everyone,
Using ARRAY_SIZE improves the code readability. I used coccinelle (I
made a change to the array_size.cocci file [1]) to find several places
where ARRAY_SIZE could be used instead of other macros or sizeof
division.

I tried to divide the changes into a patch per subsystem (excepted for
staging). If one of the patch should be split into several patches, let
me know.

In order to reduce the size of the To: and Cc: lines, each patch of the
series is sent only to the maintainers and lists concerned by the patch.
This cover letter is sent to every list concerned by this series.

This series is based on linux-next next-20170929. Each patch has been
tested by building the relevant files with W=1.

This series contains the following patches:
[PATCH 01/18] sound: use ARRAY_SIZE
[PATCH 02/18] tracing/filter: use ARRAY_SIZE
[PATCH 03/18] media: use ARRAY_SIZE
[PATCH 04/18] IB/mlx5: Use ARRAY_SIZE
[PATCH 05/18] net: use ARRAY_SIZE
[PATCH 06/18] drm: use ARRAY_SIZE
[PATCH 07/18] scsi: bfa: use ARRAY_SIZE
[PATCH 08/18] ecryptfs: use ARRAY_SIZE
[PATCH 09/18] nfsd: use ARRAY_SIZE
[PATCH 10/18] orangefs: use ARRAY_SIZE
[PATCH 11/18] dm space map metadata: use ARRAY_SIZE
[PATCH 12/18] x86: use ARRAY_SIZE
[PATCH 13/18] tpm: use ARRAY_SIZE
[PATCH 14/18] ipmi: use ARRAY_SIZE
[PATCH 15/18] acpi: use ARRAY_SIZE
[PATCH 16/18] media: staging: atomisp: use ARRAY_SIZE
[PATCH 17/18] staging: rtl8723bs: use ARRAY_SIZE
[PATCH 18/18] staging: rtlwifi: use ARRAY_SIZE


[1]: https://lkml.org/lkml/2017/9/13/689
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 4/6] staging: media: atomisp: fix build errors when PM is disabled

2017-03-20 Thread Jérémy Lefaure
The function atomisp_restore_iumit_reg is unused when PM is disabled.
Adding __maybe_unused to the function definition avoids a warning.

The function atomisp_mrfld_power_down is defined only when PM is
enabled. So in atomisp_pci_probe, it should be called only when PM is
enabled.

Signed-off-by: Jérémy Lefaure 
---
 drivers/staging/media/atomisp/pci/atomisp2/atomisp_v4l2.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_v4l2.c 
b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_v4l2.c
index 20b409789de2..626d2f114d8d 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_v4l2.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_v4l2.c
@@ -264,7 +264,7 @@ static int atomisp_save_iunit_reg(struct atomisp_device 
*isp)
return 0;
 }
 
-static int atomisp_restore_iunit_reg(struct atomisp_device *isp)
+static int __maybe_unused atomisp_restore_iunit_reg(struct atomisp_device *isp)
 {
struct pci_dev *dev = isp->pdev;
 
@@ -1526,7 +1526,7 @@ static int atomisp_pci_probe(struct pci_dev *dev,
atomisp_ospm_dphy_down(isp);
 
/* Address later when we worry about the ...field chips */
-   if (atomisp_mrfld_power_down(isp))
+   if (IS_ENABLED(CONFIG_PM) && atomisp_mrfld_power_down(isp))
dev_err(&dev->dev, "Failed to switch off ISP\n");
pci_dev_put(isp->pci_root);
return err;
-- 
2.12.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 4/6] staging: media: atomisp: fix build when PM is disabled

2017-03-20 Thread Jérémy Lefaure
On Thu, 16 Mar 2017 17:50:10 +
Alan Cox  wrote:

> > +   if (IS_ENABLED(CONFI_PM)) {  
> 
> I think not.
> 
> Please actually test build both ways at the very least.
> 
> Alan
> 

I did test and it did compile both ways. I didn't think about checking
the output of the compilation and I don't have the hardware to test it.
So I think that I will resend only the second part of this patch
(modifying atomisp_v4l2.c) because I think that it could be a good idea
to test the first part.

Thanks,
Jérémy
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 2/6] staging: media: atomisp: add missing dependencies in Kconfig

2017-03-18 Thread Jérémy Lefaure
Two dependencies were missing to build atomisp drivers:

_ MEDIA_CONTROLLER: to use the entity field of v4l2_subdev structure. Since
every atomisp driver needs MEDIA_CONTROLLER has a dependency, let's add it
to INTEL_ATOMISP

_ EFI: to use efivar_entry_get:
drivers/built-in.o: In function `gmin_get_config_var':
(.text+0xe062b): undefined reference to `efivar_entry_get'

Signed-off-by: Jérémy Lefaure 
---
v2:
* rebased on staging-testing
* removed ACPI and VIDEO_V4L2_SUBDEV_API dependencies as I am not sure that
it's the best solution to fix the building issue.

 drivers/staging/media/atomisp/Kconfig| 2 +-
 drivers/staging/media/atomisp/i2c/ov5693/Kconfig | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/media/atomisp/Kconfig 
b/drivers/staging/media/atomisp/Kconfig
index f7d8a841c629..28615aaa2a5d 100644
--- a/drivers/staging/media/atomisp/Kconfig
+++ b/drivers/staging/media/atomisp/Kconfig
@@ -1,6 +1,6 @@
 menuconfig INTEL_ATOMISP
 bool "Enable support to Intel MIPI camera drivers"
-depends on X86
+depends on X86 && EFI && MEDIA_CONTROLLER
 help
   Enable support for the Intel ISP2 camera interfaces and MIPI
   sensor drivers.
diff --git a/drivers/staging/media/atomisp/i2c/ov5693/Kconfig 
b/drivers/staging/media/atomisp/i2c/ov5693/Kconfig
index 3954b8c65fd1..9fb1bffbe9b3 100644
--- a/drivers/staging/media/atomisp/i2c/ov5693/Kconfig
+++ b/drivers/staging/media/atomisp/i2c/ov5693/Kconfig
@@ -1,6 +1,6 @@
 config VIDEO_OV5693
tristate "Omnivision ov5693 sensor support"
-   depends on I2C && VIDEO_V4L2 && MEDIA_CONTROLLER
+   depends on I2C && VIDEO_V4L2
---help---
  This is a Video4Linux2 sensor-level driver for the Micron
  ov5693 5 Mpixel camera.
-- 
2.12.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 3/6] staging: media: atomisp: select REGMAP_I2C needed by ap1302.c

2017-03-18 Thread Jérémy Lefaure
REGMAP_I2C should be enabled to build the driver ap1302 because it uses
regmap functions.

Signed-off-by: Jérémy Lefaure 
---
v2: rebase on staging-testing

 drivers/staging/media/atomisp/i2c/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/media/atomisp/i2c/Kconfig 
b/drivers/staging/media/atomisp/i2c/Kconfig
index 30b0bb94f20d..b80d29d53e65 100644
--- a/drivers/staging/media/atomisp/i2c/Kconfig
+++ b/drivers/staging/media/atomisp/i2c/Kconfig
@@ -62,6 +62,7 @@ config VIDEO_MT9M114
 config VIDEO_AP1302
tristate "AP1302 external ISP support"
depends on I2C && VIDEO_V4L2
+   select REGMAP_I2C
---help---
  This is a Video4Linux2 sensor-level driver for the external
  ISP AP1302.
-- 
2.12.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 1/6] staging: media: atomisp: add missing include in vlv2_plat_clock.c

2017-03-16 Thread Jérémy Lefaure
To use IO functions like writel, readl, ioremap_nocache and iounmap,
linux/io.h should be included.

Signed-off-by: Jérémy Lefaure 
---
 drivers/staging/media/atomisp/platform/clock/vlv2_plat_clock.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/media/atomisp/platform/clock/vlv2_plat_clock.c 
b/drivers/staging/media/atomisp/platform/clock/vlv2_plat_clock.c
index a8ca93d..25e939c 100644
--- a/drivers/staging/media/atomisp/platform/clock/vlv2_plat_clock.c
+++ b/drivers/staging/media/atomisp/platform/clock/vlv2_plat_clock.c
@@ -20,6 +20,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include "../../include/linux/vlv2_plat_clock.h"
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Revert "staging: media: atomisp: fill properly hmm_bo_type_strings when ION is disabled"

2017-03-16 Thread Jérémy Lefaure
This reverts commit fde469701c7efabebf885e785edf367bfb1a8f3f.

Adding a preprocessor condition is not the best solution to fix this
issue. Let's revert this commit before fixing this problem in a more
appropriate way.

Signed-off-by: Jérémy Lefaure 
---
 drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm.c 
b/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm.c
index e78f02f74d0f..a362b492ec8e 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm.c
@@ -49,9 +49,7 @@ const char *hmm_bo_type_strings[HMM_BO_LAST] = {
"p", /* private */
"s", /* shared */
"u", /* user */
-#ifdef CONFIG_ION
"i", /* ion */
-#endif
 };
 
 static ssize_t bo_show(struct device *dev, struct device_attribute *attr,
-- 
2.12.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 5/6] staging: media: atomisp: fill properly hmm_bo_type_strings when ION is disabled

2017-03-16 Thread Jérémy Lefaure
On Thu, 16 Mar 2017 17:51:06 +
Alan Cox  wrote:

> On Wed, 2017-03-15 at 14:09 -0400, Jérémy Lefaure wrote:
> > When CONFIG_ION is disabled, HMM_BO_LAST is 3. In this case, "i"
> > should
> > not be added in hmm_bo_type_strings.  
> 
> No the goal is to remove ifdefs - that's not the way to go with driver
> clean up. Instead the array size should always cover the four strings.
> 
Mmh, ok I understand. So I guess that the fix should have been to
remove the ifdef in hmm_bo.h. At first glance this should be ok even if
HMM_BO_LAST is used for the loop limit in bo_show.

Greg, this patch is already in staging-next. Should I send a patch that
reverts that change (maybe a patch that removes both ifdef if it is
really ok) or will you discard it ? Sorry, I don't know how you manage
this branch.

Thanks,
Jérémy
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 3/6] staging: media: atomisp: select REGMAP_I2C needed by ap1302.c

2017-03-15 Thread Jérémy Lefaure
On Thu, 16 Mar 2017 11:28:28 +0900
Greg Kroah-Hartman  wrote:

> On Wed, Mar 15, 2017 at 02:09:18PM -0400, Jérémy Lefaure wrote:
> > REGMAP_I2C should be enabled to build the driver ap1302 because it uses
> > regmap functions.
> > 
> > Signed-off-by: Jérémy Lefaure 
> > ---
> >  drivers/staging/media/atomisp/i2c/Kconfig | 1 +
> >  1 file changed, 1 insertion(+)  
> 
> This also doesn't apply anymore, I think someone already did this work.
> 
I don't see this change in your tree on staging-testing branch. Is it
possible that this patch doesn't apply because the previous one didn't
apply (the previous one change the context of this one) ? If it is the
reason, should I resend you this change ?

Thanks,
Jérémy
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 1/6] staging: media: atomisp: add missing include in vlv2_plat_clock.c

2017-03-15 Thread Jérémy Lefaure
On Thu, 16 Mar 2017 11:25:37 +0900
Greg Kroah-Hartman  wrote:

> On Wed, Mar 15, 2017 at 02:09:16PM -0400, Jérémy Lefaure wrote:
> > To use IO functions like writel, readl, ioremap_nocache and iounmap,
> > asm/io.h should be included.  
> 
> Ok, but:
> 
> > 
> > Signed-off-by: Jérémy Lefaure 
> > ---
> >  drivers/staging/media/atomisp/platform/clock/vlv2_plat_clock.c | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/drivers/staging/media/atomisp/platform/clock/vlv2_plat_clock.c 
> > b/drivers/staging/media/atomisp/platform/clock/vlv2_plat_clock.c
> > index a8ca93d..25e939c 100644
> > --- a/drivers/staging/media/atomisp/platform/clock/vlv2_plat_clock.c
> > +++ b/drivers/staging/media/atomisp/platform/clock/vlv2_plat_clock.c
> > @@ -20,6 +20,7 @@
> >   */
> >  
> >  #include 
> > +#include   
> 
> linux/io.h is what you included :(
> 
Oh yes, I changed it after the checkpatch warning but I forgot to
change the commit message. I suppose that I should resend only this
patch, not the whole serie ?

Thanks,
Jérémy
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/6] staging: media: atomisp: add missing include in vlv2_plat_clock.c

2017-03-15 Thread Jérémy Lefaure
To use IO functions like writel, readl, ioremap_nocache and iounmap,
asm/io.h should be included.

Signed-off-by: Jérémy Lefaure 
---
 drivers/staging/media/atomisp/platform/clock/vlv2_plat_clock.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/media/atomisp/platform/clock/vlv2_plat_clock.c 
b/drivers/staging/media/atomisp/platform/clock/vlv2_plat_clock.c
index a8ca93d..25e939c 100644
--- a/drivers/staging/media/atomisp/platform/clock/vlv2_plat_clock.c
+++ b/drivers/staging/media/atomisp/platform/clock/vlv2_plat_clock.c
@@ -20,6 +20,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include "../../include/linux/vlv2_plat_clock.h"
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 2/6] staging: media: atomisp: add missing dependencies in Kconfig

2017-03-15 Thread Jérémy Lefaure
Several dependencies were missing to build atomisp drivers:
_ MEDIA_CONTROLLER: to use the entity field of v4l2_subdev structure
_ ACPI: to use acpi_device structure and acpi_device_id structure
_ VIDEO_V4L2_SUBDEV_API: to use pad field of v4l2_subdev_fh structure
_ EFI: to use efivar_entry_get

Signed-off-by: Jérémy Lefaure 
---
 drivers/staging/media/atomisp/Kconfig|  2 +-
 drivers/staging/media/atomisp/i2c/Kconfig| 16 
 drivers/staging/media/atomisp/i2c/imx/Kconfig|  1 +
 drivers/staging/media/atomisp/i2c/ov5693/Kconfig |  2 +-
 drivers/staging/media/atomisp/pci/Kconfig|  2 +-
 5 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/media/atomisp/Kconfig 
b/drivers/staging/media/atomisp/Kconfig
index f7d8a84..3d9edcb 100644
--- a/drivers/staging/media/atomisp/Kconfig
+++ b/drivers/staging/media/atomisp/Kconfig
@@ -1,6 +1,6 @@
 menuconfig INTEL_ATOMISP
 bool "Enable support to Intel MIPI camera drivers"
-depends on X86
+depends on X86 && ACPI && EFI
 help
   Enable support for the Intel ISP2 camera interfaces and MIPI
   sensor drivers.
diff --git a/drivers/staging/media/atomisp/i2c/Kconfig 
b/drivers/staging/media/atomisp/i2c/Kconfig
index 30b0bb9..3b7ffe6 100644
--- a/drivers/staging/media/atomisp/i2c/Kconfig
+++ b/drivers/staging/media/atomisp/i2c/Kconfig
@@ -7,7 +7,7 @@ source "drivers/staging/media/atomisp/i2c/imx/Kconfig"
 
 config VIDEO_OV2722
tristate "OVT ov2722 sensor support"
-   depends on I2C && VIDEO_V4L2
+   depends on I2C && VIDEO_V4L2 && MEDIA_CONTROLLER
---help---
  This is a Video4Linux2 sensor-level driver for the OVT
  OV2722 raw camera.
@@ -18,7 +18,7 @@ config VIDEO_OV2722
 
 config VIDEO_GC2235
tristate "Galaxy gc2235 sensor support"
-   depends on I2C && VIDEO_V4L2
+   depends on I2C && VIDEO_V4L2 && MEDIA_CONTROLLER
---help---
  This is a Video4Linux2 sensor-level driver for the OVT
  GC2235 raw camera.
@@ -29,7 +29,7 @@ config VIDEO_GC2235
 
 config VIDEO_OV8858
tristate "Omnivision ov8858 sensor support"
-   depends on I2C && VIDEO_V4L2 && VIDEO_ATOMISP
+   depends on I2C && VIDEO_V4L2 && VIDEO_ATOMISP && MEDIA_CONTROLLER
---help---
  This is a Video4Linux2 sensor-level driver for the Omnivision
  ov8858 RAW sensor.
@@ -50,7 +50,7 @@ config VIDEO_MSRLIST_HELPER
 
 config VIDEO_MT9M114
tristate "Aptina mt9m114 sensor support"
-   depends on I2C && VIDEO_V4L2
+   depends on I2C && VIDEO_V4L2 && MEDIA_CONTROLLER
---help---
  This is a Video4Linux2 sensor-level driver for the Micron
  mt9m114 1.3 Mpixel camera.
@@ -61,7 +61,7 @@ config VIDEO_MT9M114
 
 config VIDEO_AP1302
tristate "AP1302 external ISP support"
-   depends on I2C && VIDEO_V4L2
+   depends on I2C && VIDEO_V4L2 && MEDIA_CONTROLLER
---help---
  This is a Video4Linux2 sensor-level driver for the external
  ISP AP1302.
@@ -72,14 +72,14 @@ config VIDEO_AP1302
 
 config VIDEO_GC0310
tristate "GC0310 sensor support"
-depends on I2C && VIDEO_V4L2
+depends on I2C && VIDEO_V4L2 && MEDIA_CONTROLLER
 ---help---
  This is a Video4Linux2 sensor-level driver for the Galaxycore
  GC0310 0.3MP sensor.
 
 config VIDEO_OV2680
tristate "Omnivision OV2680 sensor support"
-   depends on I2C && VIDEO_V4L2
+   depends on I2C && VIDEO_V4L2 && MEDIA_CONTROLLER
---help---
  This is a Video4Linux2 sensor-level driver for the Omnivision
  OV2680 raw camera.
@@ -94,7 +94,7 @@ config VIDEO_OV2680
 
 config VIDEO_LM3554
tristate "LM3554 flash light driver"
-   depends on VIDEO_V4L2 && I2C
+   depends on VIDEO_V4L2 && I2C && MEDIA_CONTROLLER
---help---
  This is a Video4Linux2 sub-dev driver for the LM3554
  flash light driver.
diff --git a/drivers/staging/media/atomisp/i2c/imx/Kconfig 
b/drivers/staging/media/atomisp/i2c/imx/Kconfig
index a39eeb3..39966c4 100644
--- a/drivers/staging/media/atomisp/i2c/imx/Kconfig
+++ b/drivers/staging/media/atomisp/i2c/imx/Kconfig
@@ -1,6 +1,7 @@
 config VIDEO_IMX
tristate "sony imx sensor support"
depends on I2C && VIDEO_V4L2 && VIDEO_MSRLIST_HELPER && m
+   depends on MEDIA_CONTROLLER
---help---
  This is a Video4Linux2 sensor-level driver for the Sony
  IMX RAW sensor.
diff --git a/drivers/staging/media/atomisp/i2c/ov5693/Kconfig 
b/drivers/staging/media/atomisp

[PATCH 3/6] staging: media: atomisp: select REGMAP_I2C needed by ap1302.c

2017-03-15 Thread Jérémy Lefaure
REGMAP_I2C should be enabled to build the driver ap1302 because it uses
regmap functions.

Signed-off-by: Jérémy Lefaure 
---
 drivers/staging/media/atomisp/i2c/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/media/atomisp/i2c/Kconfig 
b/drivers/staging/media/atomisp/i2c/Kconfig
index 3b7ffe6..0924d70 100644
--- a/drivers/staging/media/atomisp/i2c/Kconfig
+++ b/drivers/staging/media/atomisp/i2c/Kconfig
@@ -62,6 +62,7 @@ config VIDEO_MT9M114
 config VIDEO_AP1302
tristate "AP1302 external ISP support"
depends on I2C && VIDEO_V4L2 && MEDIA_CONTROLLER
+   select REGMAP_I2C
---help---
  This is a Video4Linux2 sensor-level driver for the external
  ISP AP1302.
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 0/6] staging: media: atomisp: various fixes

2017-03-15 Thread Jérémy Lefaure
Hello,
Here are 6 patches for drivers/staging/media/atomisp. Patches 1 to 5 fix
the build and patch 6 removes duplicate includes.

These patches are base on
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
staging-next.

I am not sure if I should split patch 2 (one patch per missing
dependency) and patch 4 (adding the __maybe_unused in another commit). I
can resend the serie if you think that I should split them.

Thank you !
Jérémy

[PATCH 1/6] staging: media: atomisp: add missing include in
vlv2_plat_clock.c
[PATCH 2/6] staging: media: atomisp: add missing dependencies in Kconfig
[PATCH 3/6] staging: media: atomisp: select REGMAP_I2C needed by
ap1302.c
[PATCH 4/6] staging: media: atomisp: fix build when PM is disabled
[PATCH 5/6] staging: media: atomisp: fill properly hmm_bo_type_strings
when ION is disabled
[PATCH 6/6] staging: media: atomisp: remove duplicate includes
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 5/6] staging: media: atomisp: fill properly hmm_bo_type_strings when ION is disabled

2017-03-15 Thread Jérémy Lefaure
When CONFIG_ION is disabled, HMM_BO_LAST is 3. In this case, "i" should
not be added in hmm_bo_type_strings.

Signed-off-by: Jérémy Lefaure 
---
 drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm.c 
b/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm.c
index a362b49..e78f02f 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm.c
@@ -49,7 +49,9 @@ const char *hmm_bo_type_strings[HMM_BO_LAST] = {
"p", /* private */
"s", /* shared */
"u", /* user */
+#ifdef CONFIG_ION
"i", /* ion */
+#endif
 };
 
 static ssize_t bo_show(struct device *dev, struct device_attribute *attr,
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 4/6] staging: media: atomisp: fix build when PM is disabled

2017-03-15 Thread Jérémy Lefaure
The function atomisp_restore_iumit_reg is unused when PM is disabled.
Adding __maybe_unused to the function definition avoids a warning.

During a reset (atomisp_reset), PM functions atomisp_runtime_suspend,
atomisp_mrfld_power_down, atomisp_mrfld_power_up and
atomisp_runtime_resume should be called only if PM is enabled.

Same thing apply in atomisp_pci_probe: atomis_mrfld_power_down should be
called only if PM is enabled.

Signed-off-by: Jérémy Lefaure 
---
 .../media/atomisp/pci/atomisp2/atomisp_cmd.c   | 30 +-
 .../media/atomisp/pci/atomisp2/atomisp_v4l2.c  |  4 +--
 2 files changed, 20 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c 
b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c
index 1ee99d0..38e4bb3 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c
@@ -358,20 +358,26 @@ int atomisp_reset(struct atomisp_device *isp)
 
dev_dbg(isp->dev, "%s\n", __func__);
atomisp_css_suspend(isp);
-   ret = atomisp_runtime_suspend(isp->dev);
-   if (ret < 0)
-   dev_err(isp->dev, "atomisp_runtime_suspend failed, %d\n", ret);
-   ret = atomisp_mrfld_power_down(isp);
-   if (ret < 0) {
-   dev_err(isp->dev, "can not disable ISP power\n");
-   } else {
-   ret = atomisp_mrfld_power_up(isp);
-   if (ret < 0)
-   dev_err(isp->dev, "can not enable ISP power\n");
-   ret = atomisp_runtime_resume(isp->dev);
+
+   if (IS_ENABLED(CONFI_PM)) {
+   ret = atomisp_runtime_suspend(isp->dev);
if (ret < 0)
-   dev_err(isp->dev, "atomisp_runtime_resume failed, 
%d\n", ret);
+   dev_err(isp->dev, "atomisp_runtime_suspend failed, 
%d\n",
+   ret);
+   ret = atomisp_mrfld_power_down(isp);
+   if (ret < 0) {
+   dev_err(isp->dev, "can not disable ISP power\n");
+   } else {
+   ret = atomisp_mrfld_power_up(isp);
+   if (ret < 0)
+   dev_err(isp->dev, "can not enable ISP power\n");
+   ret = atomisp_runtime_resume(isp->dev);
+   if (ret < 0)
+   dev_err(isp->dev, "atomisp_runtime_resume 
failed, %d\n",
+   ret);
+   }
}
+
ret = atomisp_css_resume(isp);
if (ret)
isp->isp_fatal_error = true;
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_v4l2.c 
b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_v4l2.c
index 755c27c..cd56840 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_v4l2.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_v4l2.c
@@ -264,7 +264,7 @@ static int atomisp_save_iunit_reg(struct atomisp_device 
*isp)
return 0;
 }
 
-static int atomisp_restore_iunit_reg(struct atomisp_device *isp)
+static int __maybe_unused atomisp_restore_iunit_reg(struct atomisp_device *isp)
 {
struct pci_dev *dev = isp->pdev;
 
@@ -1526,7 +1526,7 @@ static int atomisp_pci_probe(struct pci_dev *dev,
atomisp_ospm_dphy_down(isp);
 
/* Address later when we worry about the ...field chips */
-   if (atomisp_mrfld_power_down(isp))
+   if (IS_ENABLED(CONFIG_PM) && atomisp_mrfld_power_down(isp))
dev_err(&dev->dev, "Failed to switch off ISP\n");
pci_dev_put(isp->pci_root);
return err;
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 6/6] staging: media: atomisp: remove duplicate includes

2017-03-15 Thread Jérémy Lefaure
These duplicate includes have been found with scripts/checkincludes.pl
but they have been removed manually to avoid removing false positives.

Signed-off-by: Jérémy Lefaure 
---
 drivers/staging/media/atomisp/i2c/ap1302.c   | 1 -
 drivers/staging/media/atomisp/i2c/mt9m114.c  | 1 -
 .../atomisp/pci/atomisp2/css2400/isp/kernels/vf/vf_1.0/ia_css_vf.host.c  | 1 -
 .../media/atomisp/pci/atomisp2/css2400/runtime/debug/src/ia_css_debug.c  | 1 -
 4 files changed, 4 deletions(-)

diff --git a/drivers/staging/media/atomisp/i2c/ap1302.c 
b/drivers/staging/media/atomisp/i2c/ap1302.c
index 31eae81..bacffbe 100644
--- a/drivers/staging/media/atomisp/i2c/ap1302.c
+++ b/drivers/staging/media/atomisp/i2c/ap1302.c
@@ -23,7 +23,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/drivers/staging/media/atomisp/i2c/mt9m114.c 
b/drivers/staging/media/atomisp/i2c/mt9m114.c
index 4ad08d7..c4f4c88 100644
--- a/drivers/staging/media/atomisp/i2c/mt9m114.c
+++ b/drivers/staging/media/atomisp/i2c/mt9m114.c
@@ -29,7 +29,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git 
a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/vf/vf_1.0/ia_css_vf.host.c
 
b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/vf/vf_1.0/ia_css_vf.host.c
index ab75625..5610833 100644
--- 
a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/vf/vf_1.0/ia_css_vf.host.c
+++ 
b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/vf/vf_1.0/ia_css_vf.host.c
@@ -20,7 +20,6 @@
 #include 
 #define IA_CSS_INCLUDE_CONFIGURATIONS
 #include "ia_css_isp_configs.h"
-#include 
 
 #include "isp.h"
 
diff --git 
a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/debug/src/ia_css_debug.c
 
b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/debug/src/ia_css_debug.c
index 82b3593..7d64318 100644
--- 
a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/debug/src/ia_css_debug.c
+++ 
b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/debug/src/ia_css_debug.c
@@ -67,7 +67,6 @@
 #include "math_support.h" /* CEIL_DIV */
 #if defined(HAS_INPUT_FORMATTER_VERSION_2) || 
defined(USE_INPUT_SYSTEM_VERSION_2401)
 #include "input_system.h"  /* input_formatter_reg_load */
-#include "gp_device.h" /* gp_device_reg_load */
 #endif
 #if defined(USE_INPUT_SYSTEM_VERSION_2) || 
defined(USE_INPUT_SYSTEM_VERSION_2401)
 #include "ia_css_tagger_common.h"
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: greybus: arche-apb-ctrl: fix unused warnings on resume/suspend

2016-12-16 Thread Jérémy Lefaure
When CONFIG_PM_SLEEP is disabled, SIMPLE_DEV_PM_OPS does not use
arche_apb_ctrl_resume and arche_apb_ctrl_suspend functions:

drivers/staging/greybus/arche-apb-ctrl.c:478:12: warning:
‘arche_apb_ctrl_resume’ defined but not used [-Wunused-function]
 static int arche_apb_ctrl_resume(struct device *dev)
^
drivers/staging/greybus/arche-apb-ctrl.c:464:12: warning:
‘arche_apb_ctrl_suspend’ defined but not used [-Wunused-function]
 static int arche_apb_ctrl_suspend(struct device *dev)
^~

Adding __maybe_unused to the declaration of these functions removes the
warnings.

Signed-off-by: Jérémy Lefaure 
---
 drivers/staging/greybus/arche-apb-ctrl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/greybus/arche-apb-ctrl.c 
b/drivers/staging/greybus/arche-apb-ctrl.c
index 3fda0cd6bb42..17fa29061e5b 100644
--- a/drivers/staging/greybus/arche-apb-ctrl.c
+++ b/drivers/staging/greybus/arche-apb-ctrl.c
@@ -461,7 +461,7 @@ static int arche_apb_ctrl_remove(struct platform_device 
*pdev)
return 0;
 }
 
-static int arche_apb_ctrl_suspend(struct device *dev)
+static int __maybe_unused arche_apb_ctrl_suspend(struct device *dev)
 {
/*
 * If timing profile permits, we may shutdown bridge
@@ -475,7 +475,7 @@ static int arche_apb_ctrl_suspend(struct device *dev)
return 0;
 }
 
-static int arche_apb_ctrl_resume(struct device *dev)
+static int __maybe_unused arche_apb_ctrl_resume(struct device *dev)
 {
/*
 * Atleast for ES2 we have to meet the delay requirement between
-- 
2.11.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel