[PATCH v2] net: korina: fix return value

2020-12-14 Thread Vincent Stehlé
The ndo_start_xmit() method must not attempt to free the skb to transmit
when returning NETDEV_TX_BUSY. Therefore, make sure the
korina_send_packet() function returns NETDEV_TX_OK when it frees a packet.

Fixes: ef11291bcd5f ("Add support the Korina (IDT RC32434) Ethernet MAC")
Suggested-by: Jakub Kicinski 
Signed-off-by: Vincent Stehlé 
Cc: David S. Miller 
Cc: Florian Fainelli 
---


Changes since v1:
- Keep freeing the packet but return NETDEV_TX_OK, as suggested by Jakub


 drivers/net/ethernet/korina.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/korina.c b/drivers/net/ethernet/korina.c
index bf48f0ded9c7d..925161959b9ba 100644
--- a/drivers/net/ethernet/korina.c
+++ b/drivers/net/ethernet/korina.c
@@ -219,7 +219,7 @@ static int korina_send_packet(struct sk_buff *skb, struct 
net_device *dev)
dev_kfree_skb_any(skb);
spin_unlock_irqrestore(>lock, flags);
 
-   return NETDEV_TX_BUSY;
+   return NETDEV_TX_OK;
}
}
 
-- 
2.29.2



Re: [PATCH] net: korina: remove busy skb free

2020-12-14 Thread Vincent Stehlé
On Mon, Dec 14, 2020 at 01:08:32PM -0800, Jakub Kicinski wrote:
> On Mon, 14 Dec 2020 11:03:12 +0100 Julian Wiedmann wrote:
> > > diff --git a/drivers/net/ethernet/korina.c b/drivers/net/ethernet/korina.c
> > > index bf48f0ded9c7d..9d84191de6824 100644
> > > --- a/drivers/net/ethernet/korina.c
> > > +++ b/drivers/net/ethernet/korina.c
> > > @@ -216,7 +216,6 @@ static int korina_send_packet(struct sk_buff *skb, 
> > > struct net_device *dev)
> > >   netif_stop_queue(dev);
> > >   else {
> > >   dev->stats.tx_dropped++;
> > > - dev_kfree_skb_any(skb);
> > >   spin_unlock_irqrestore(>lock, flags);
> > >  
> > >   return NETDEV_TX_BUSY;
> > >   
> > 
> > As this skb is returned to the stack (and not dropped), the tx_dropped
> > statistics increment looks bogus too.
> 
> Since this is clearly an ugly use after free, and nobody complained we
> can assume that the driver correctly stops its TX queue ahead of time.
> So perhaps we can change the return value to NETDEV_TX_OK instead.

Hi Jakub,

Thanks for the review.

Ok, if this is the preferred fix I will respin the patch this way.

Best regards,
Vincent.


Re: [PATCH] net: korina: remove busy skb free

2020-12-14 Thread Vincent Stehlé
On Mon, Dec 14, 2020 at 11:03:12AM +0100, Julian Wiedmann wrote:
> On 13.12.20 18:20, Vincent Stehlé wrote:
...
> > @@ -216,7 +216,6 @@ static int korina_send_packet(struct sk_buff *skb, 
> > struct net_device *dev)
> > netif_stop_queue(dev);
> > else {
> > dev->stats.tx_dropped++;
> > -   dev_kfree_skb_any(skb);
> > spin_unlock_irqrestore(>lock, flags);
> >  
> > return NETDEV_TX_BUSY;
> > 
> 
> As this skb is returned to the stack (and not dropped), the tx_dropped
> statistics increment looks bogus too.

Hi Julian,

Thanks for the review.
I will respin the patch to remove the statistics increment as well.

Best regards,
Vincent.


[PATCH] powerpc/ps3: use dma_mapping_error()

2020-12-13 Thread Vincent Stehlé
The DMA address returned by dma_map_single() should be checked with
dma_mapping_error(). Fix the ps3stor_setup() function accordingly.

Fixes: 80071802cb9c ("[POWERPC] PS3: Storage Driver Core")
Signed-off-by: Vincent Stehlé 
Cc: Geoff Levand 
Cc: Geert Uytterhoeven 
---
 drivers/ps3/ps3stor_lib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ps3/ps3stor_lib.c b/drivers/ps3/ps3stor_lib.c
index 333ba83006e48..a12a1ad9b5fe3 100644
--- a/drivers/ps3/ps3stor_lib.c
+++ b/drivers/ps3/ps3stor_lib.c
@@ -189,7 +189,7 @@ int ps3stor_setup(struct ps3_storage_device *dev, 
irq_handler_t handler)
dev->bounce_lpar = ps3_mm_phys_to_lpar(__pa(dev->bounce_buf));
dev->bounce_dma = dma_map_single(>sbd.core, dev->bounce_buf,
 dev->bounce_size, DMA_BIDIRECTIONAL);
-   if (!dev->bounce_dma) {
+   if (dma_mapping_error(>sbd.core, dev->bounce_dma)) {
dev_err(>sbd.core, "%s:%u: map DMA region failed\n",
__func__, __LINE__);
error = -ENODEV;
-- 
2.29.2



[PATCH] net: korina: remove busy skb free

2020-12-13 Thread Vincent Stehlé
The ndo_start_xmit() method must not attempt to free the skb to transmit
when returning NETDEV_TX_BUSY. Fix the korina_send_packet() function
accordingly.

Fixes: ef11291bcd5f ("Add support the Korina (IDT RC32434) Ethernet MAC")
Signed-off-by: Vincent Stehlé 
Cc: David S. Miller 
Cc: Jakub Kicinski 
Cc: Florian Fainelli 
---
 drivers/net/ethernet/korina.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/net/ethernet/korina.c b/drivers/net/ethernet/korina.c
index bf48f0ded9c7d..9d84191de6824 100644
--- a/drivers/net/ethernet/korina.c
+++ b/drivers/net/ethernet/korina.c
@@ -216,7 +216,6 @@ static int korina_send_packet(struct sk_buff *skb, struct 
net_device *dev)
netif_stop_queue(dev);
else {
dev->stats.tx_dropped++;
-   dev_kfree_skb_any(skb);
spin_unlock_irqrestore(>lock, flags);
 
return NETDEV_TX_BUSY;
-- 
2.29.2



[PATCH] net: ethernet: mtk-star-emac: return ok when xmit drops

2020-11-12 Thread Vincent Stehlé
The ndo_start_xmit() method must return NETDEV_TX_OK if the DMA mapping
fails, after freeing the socket buffer.
Fix the mtk_star_netdev_start_xmit() function accordingly.

Fixes: 8c7bd5a454ff ("net: ethernet: mtk-star-emac: new driver")
Signed-off-by: Vincent Stehlé 
Cc: David S. Miller 
Cc: Bartosz Golaszewski 
---
 drivers/net/ethernet/mediatek/mtk_star_emac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mediatek/mtk_star_emac.c 
b/drivers/net/ethernet/mediatek/mtk_star_emac.c
index 13250553263b5..e56a26f797f28 100644
--- a/drivers/net/ethernet/mediatek/mtk_star_emac.c
+++ b/drivers/net/ethernet/mediatek/mtk_star_emac.c
@@ -1053,7 +1053,7 @@ static int mtk_star_netdev_start_xmit(struct sk_buff *skb,
 err_drop_packet:
dev_kfree_skb(skb);
ndev->stats.tx_dropped++;
-   return NETDEV_TX_BUSY;
+   return NETDEV_TX_OK;
 }
 
 /* Returns the number of bytes sent or a negative number on the first
-- 
2.28.0



[PATCH] staging: android: vsoc: fix copy_from_user overrun

2019-04-14 Thread Vincent Stehlé
The `np->permission' structure is smaller than the `np' structure but
sizeof(*np) worth of data is copied in there. Fix the size passed to
copy_from_user() to avoid overrun.

Fixes: 3d2ec9dcd5539d42 ("staging: Android: Add 'vsoc' driver for cuttlefish.")
Signed-off-by: Vincent Stehlé 
Cc: Greg Kroah-Hartman 
---
 drivers/staging/android/vsoc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/android/vsoc.c b/drivers/staging/android/vsoc.c
index 8a75bd27c4133..00a1ec7b91549 100644
--- a/drivers/staging/android/vsoc.c
+++ b/drivers/staging/android/vsoc.c
@@ -259,7 +259,8 @@ do_create_fd_scoped_permission(struct vsoc_device_region 
*region_p,
atomic_t *owner_ptr = NULL;
struct vsoc_device_region *managed_region_p;
 
-   if (copy_from_user(>permission, >perm, sizeof(*np)) ||
+   if (copy_from_user(>permission,
+  >perm, sizeof(np->permission)) ||
copy_from_user(_fd,
   >managed_region_fd, sizeof(managed_fd))) {
return -EFAULT;
-- 
2.20.1



[PATCH] iio: adc: ads124: avoid buffer overflow

2019-03-31 Thread Vincent Stehlé
When initializing the priv->data array starting from index 1, there is one
less element to consider than when initializing the full array.

Fixes: e717f8c6dfec8f76 ("iio: adc: Add the TI ads124s08 ADC code")
Signed-off-by: Vincent Stehlé 
Cc: Dan Murphy 
Cc: Jonathan Cameron 
---
 drivers/iio/adc/ti-ads124s08.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/adc/ti-ads124s08.c b/drivers/iio/adc/ti-ads124s08.c
index 53f17e4f2f230..552c2be8d87ad 100644
--- a/drivers/iio/adc/ti-ads124s08.c
+++ b/drivers/iio/adc/ti-ads124s08.c
@@ -202,7 +202,7 @@ static int ads124s_read(struct iio_dev *indio_dev, unsigned 
int chan)
};
 
priv->data[0] = ADS124S08_CMD_RDATA;
-   memset(>data[1], ADS124S08_CMD_NOP, sizeof(priv->data));
+   memset(>data[1], ADS124S08_CMD_NOP, sizeof(priv->data) - 1);
 
ret = spi_sync_transfer(priv->spi, t, ARRAY_SIZE(t));
if (ret < 0)
-- 
2.20.1



[PATCH] cpufreq: scpi: fix use after free

2019-03-27 Thread Vincent Stehlé
Free the priv structure only after we are done using it.

Fixes: 1690d8bb91e370ab ("cpufreq: scpi/scmi: Fix freeing of dynamic OPPs")
Signed-off-by: Vincent Stehlé 
Cc: Sudeep Holla 
Cc: "Rafael J. Wysocki" 
Cc: Viresh Kumar 
---
 drivers/cpufreq/scpi-cpufreq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/cpufreq/scpi-cpufreq.c b/drivers/cpufreq/scpi-cpufreq.c
index 3f49427766b88..2b51e0718c9f6 100644
--- a/drivers/cpufreq/scpi-cpufreq.c
+++ b/drivers/cpufreq/scpi-cpufreq.c
@@ -189,8 +189,8 @@ static int scpi_cpufreq_exit(struct cpufreq_policy *policy)
 
clk_put(priv->clk);
dev_pm_opp_free_cpufreq_table(priv->cpu_dev, >freq_table);
-   kfree(priv);
dev_pm_opp_remove_all_dynamic(priv->cpu_dev);
+   kfree(priv);
 
return 0;
 }
-- 
2.20.1



Re: [PATCH v4 19/22] vfio-pci: Register an iommu fault handler

2019-02-25 Thread Vincent Stehlé
Hi Eric,

On Mon, Feb 18, 2019 at 02:55:00PM +0100, Eric Auger wrote:
> This patch registers a fault handler which records faults in
> a circular buffer and then signals an eventfd. This buffer is
> exposed within the fault region.
> 
> Signed-off-by: Eric Auger 
> ---
>  drivers/vfio/pci/vfio_pci.c | 49 +
>  drivers/vfio/pci/vfio_pci_private.h |  1 +
>  2 files changed, 50 insertions(+)
> 
> diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c
> index aaf63e5ca2b6..019c9fd380a5 100644
> --- a/drivers/vfio/pci/vfio_pci.c
> +++ b/drivers/vfio/pci/vfio_pci.c
(..)
>  static int vfio_pci_init_fault_region(struct vfio_pci_device *vdev)
>  {
>   struct vfio_region_fault_prod *header;
> @@ -276,6 +317,13 @@ static int vfio_pci_init_fault_region(struct 
> vfio_pci_device *vdev)
>   header = (struct vfio_region_fault_prod *)vdev->fault_pages;
>   header->version = -1;
>   header->offset = PAGE_SIZE;
> +
> + ret = iommu_register_device_fault_handler(>pdev->dev,
> + vfio_pci_iommu_dev_fault_handler,
> + vdev);
> + if (ret)
> + goto out;
> +
>   return 0;
>  out:
>   kfree(vdev->fault_pages);

This patch calls iommu_register_device_fault_handler from
vfio_pci_init_fault_region, leading to the following call stack:

iommu_register_device_fault_handler
vfio_pci_init_fault_region
vfio_pci_enable
vfio_pci_open
vfio_group_get_device_fd

> @@ -1420,6 +1468,7 @@ static void vfio_pci_remove(struct pci_dev *pdev)
>   vfio_iommu_group_put(pdev->dev.iommu_group, >dev);
>   kfree(vdev->region);
>   kfree(vdev->fault_pages);
> + iommu_unregister_device_fault_handler(>dev);
>   mutex_destroy(>ioeventfds_lock);
>   kfree(vdev);

And then this patch calls iommu_unregister_device_fault_handler from
vfio_pci_remove, and not from vfio_pci_release.

I think this means a device cannot be used twice in a row without unloading the
module.

Here is an example sequence:

1. modprobe vfio-pci
2. Userspace uses VFIO, calls ioctl(VFIO_GROUP_GET_DEVICE_FD)
2.1. iommu_register_device_fault_handler is called
3. Userspace exits
3.1. vfio_pci_release is called,
 but iommu_unregister_device_fault_handler is not called
4. Userspace uses VFIO agin, calls ioctl(VFIO_GROUP_GET_DEVICE_FD) again
4.1. iommu_register_device_fault_handler is called again,
 notices a fault handler is already there,
 returns -EBUSY

Unloading the vfio-pci module will call vfio_pci_remove.

Maybe iommu_unregister_device_fault_handler should be called from
vfio_pci_release instead of vfio_pci_remove?

Best regards,
Vincent.


[PATCH] regulator: isl9305: fix array size

2017-04-09 Thread Vincent Stehlé
ISL9305_MAX_REGULATOR is the last index used to access the init_data[]
array, so we need to add one to this last index to obtain the necessary
array size.

This fixes the following smatch error:

  drivers/regulator/isl9305.c:160 isl9305_i2c_probe() error: buffer overflow 
'pdata->init_data' 3 <= 3

Fixes: dec38b5ce6a9edb4 ("regulator: isl9305: Add Intersil ISL9305/H driver")
Signed-off-by: Vincent Stehlé <vincent.ste...@laposte.net>
Cc: Mark Brown <broo...@kernel.org>
---
 include/linux/platform_data/isl9305.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/platform_data/isl9305.h 
b/include/linux/platform_data/isl9305.h
index 1419133fa69e..4ac1a070af0a 100644
--- a/include/linux/platform_data/isl9305.h
+++ b/include/linux/platform_data/isl9305.h
@@ -24,7 +24,7 @@
 struct regulator_init_data;
 
 struct isl9305_pdata {
-   struct regulator_init_data *init_data[ISL9305_MAX_REGULATOR];
+   struct regulator_init_data *init_data[ISL9305_MAX_REGULATOR + 1];
 };
 
 #endif
-- 
2.11.0



[PATCH] regulator: isl9305: fix array size

2017-04-09 Thread Vincent Stehlé
ISL9305_MAX_REGULATOR is the last index used to access the init_data[]
array, so we need to add one to this last index to obtain the necessary
array size.

This fixes the following smatch error:

  drivers/regulator/isl9305.c:160 isl9305_i2c_probe() error: buffer overflow 
'pdata->init_data' 3 <= 3

Fixes: dec38b5ce6a9edb4 ("regulator: isl9305: Add Intersil ISL9305/H driver")
Signed-off-by: Vincent Stehlé 
Cc: Mark Brown 
---
 include/linux/platform_data/isl9305.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/platform_data/isl9305.h 
b/include/linux/platform_data/isl9305.h
index 1419133fa69e..4ac1a070af0a 100644
--- a/include/linux/platform_data/isl9305.h
+++ b/include/linux/platform_data/isl9305.h
@@ -24,7 +24,7 @@
 struct regulator_init_data;
 
 struct isl9305_pdata {
-   struct regulator_init_data *init_data[ISL9305_MAX_REGULATOR];
+   struct regulator_init_data *init_data[ISL9305_MAX_REGULATOR + 1];
 };
 
 #endif
-- 
2.11.0



[PATCH] net: thunderx: avoid dereferencing xcv when NULL

2017-01-30 Thread Vincent Stehlé
This fixes the following smatch and coccinelle warnings:

  drivers/net/ethernet/cavium/thunder/thunder_xcv.c:119 xcv_setup_link() error: 
we previously assumed 'xcv' could be null (see line 118) [smatch]
  drivers/net/ethernet/cavium/thunder/thunder_xcv.c:119:16-20: ERROR: xcv is 
NULL but dereferenced. [coccinelle]

Fixes: 6465859aba1e66a5 ("net: thunderx: Add RGMII interface type support")
Signed-off-by: Vincent Stehlé <vincent.ste...@laposte.net>
Cc: Sunil Goutham <sgout...@cavium.com>
---
 drivers/net/ethernet/cavium/thunder/thunder_xcv.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/cavium/thunder/thunder_xcv.c 
b/drivers/net/ethernet/cavium/thunder/thunder_xcv.c
index 67befedef709..578c7f8f11bf 100644
--- a/drivers/net/ethernet/cavium/thunder/thunder_xcv.c
+++ b/drivers/net/ethernet/cavium/thunder/thunder_xcv.c
@@ -116,8 +116,7 @@ void xcv_setup_link(bool link_up, int link_speed)
int speed = 2;
 
if (!xcv) {
-   dev_err(>pdev->dev,
-   "XCV init not done, probe may have failed\n");
+   pr_err("XCV init not done, probe may have failed\n");
return;
}
 
-- 
2.11.0



[PATCH] net: thunderx: avoid dereferencing xcv when NULL

2017-01-30 Thread Vincent Stehlé
This fixes the following smatch and coccinelle warnings:

  drivers/net/ethernet/cavium/thunder/thunder_xcv.c:119 xcv_setup_link() error: 
we previously assumed 'xcv' could be null (see line 118) [smatch]
  drivers/net/ethernet/cavium/thunder/thunder_xcv.c:119:16-20: ERROR: xcv is 
NULL but dereferenced. [coccinelle]

Fixes: 6465859aba1e66a5 ("net: thunderx: Add RGMII interface type support")
Signed-off-by: Vincent Stehlé 
Cc: Sunil Goutham 
---
 drivers/net/ethernet/cavium/thunder/thunder_xcv.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/cavium/thunder/thunder_xcv.c 
b/drivers/net/ethernet/cavium/thunder/thunder_xcv.c
index 67befedef709..578c7f8f11bf 100644
--- a/drivers/net/ethernet/cavium/thunder/thunder_xcv.c
+++ b/drivers/net/ethernet/cavium/thunder/thunder_xcv.c
@@ -116,8 +116,7 @@ void xcv_setup_link(bool link_up, int link_speed)
int speed = 2;
 
if (!xcv) {
-   dev_err(>pdev->dev,
-   "XCV init not done, probe may have failed\n");
+   pr_err("XCV init not done, probe may have failed\n");
return;
}
 
-- 
2.11.0



Re: [PATCH next 1/2] media: mtk-mdp: fix video_device_release argument

2016-10-28 Thread Vincent Stehlé
On Thu, Oct 27, 2016 at 10:23:24PM +0200, Vincent Stehlé wrote:
> video_device_release() takes a pointer to struct video_device as argument.
> Fix two call sites where the address of the pointer is passed instead.

Sorry, I messed up: please ignore that "fix". The 0day robot made me
realize this is indeed not a proper fix.

The issue remains, though: we cannot call video_device_release() on the
vdev structure member, as this will in turn call kfree(). Most probably,
vdev needs to be dynamically allocated, or the call to
video_device_release() dropped completely.

Sorry for the bad patch.

Best regards,

Vincent.


Re: [PATCH next 1/2] media: mtk-mdp: fix video_device_release argument

2016-10-28 Thread Vincent Stehlé
On Thu, Oct 27, 2016 at 10:23:24PM +0200, Vincent Stehlé wrote:
> video_device_release() takes a pointer to struct video_device as argument.
> Fix two call sites where the address of the pointer is passed instead.

Sorry, I messed up: please ignore that "fix". The 0day robot made me
realize this is indeed not a proper fix.

The issue remains, though: we cannot call video_device_release() on the
vdev structure member, as this will in turn call kfree(). Most probably,
vdev needs to be dynamically allocated, or the call to
video_device_release() dropped completely.

Sorry for the bad patch.

Best regards,

Vincent.


[PATCH next 1/2] media: mtk-mdp: fix video_device_release argument

2016-10-27 Thread Vincent Stehlé
video_device_release() takes a pointer to struct video_device as argument.
Fix two call sites where the address of the pointer is passed instead.

Fixes: c8eb2d7e8202fd9c ("[media] media: Add Mediatek MDP Driver")
Signed-off-by: Vincent Stehlé <vincent.ste...@laposte.net>
Cc: Minghsiu Tsai <minghsiu.t...@mediatek.com>
Cc: Hans Verkuil <hans.verk...@cisco.com>
Cc: Mauro Carvalho Chehab <mche...@s-opensource.com>
---
 drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c 
b/drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c
index 9a747e7..4a9e3e9d 100644
--- a/drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c
+++ b/drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c
@@ -1267,13 +1267,13 @@ int mtk_mdp_register_m2m_device(struct mtk_mdp_dev *mdp)
 err_vdev_register:
v4l2_m2m_release(mdp->m2m_dev);
 err_m2m_init:
-   video_device_release(>vdev);
+   video_device_release(mdp->vdev);
 
return ret;
 }
 
 void mtk_mdp_unregister_m2m_device(struct mtk_mdp_dev *mdp)
 {
-   video_device_release(>vdev);
+   video_device_release(mdp->vdev);
v4l2_m2m_release(mdp->m2m_dev);
 }
-- 
2.9.3



[PATCH next 1/2] media: mtk-mdp: fix video_device_release argument

2016-10-27 Thread Vincent Stehlé
video_device_release() takes a pointer to struct video_device as argument.
Fix two call sites where the address of the pointer is passed instead.

Fixes: c8eb2d7e8202fd9c ("[media] media: Add Mediatek MDP Driver")
Signed-off-by: Vincent Stehlé 
Cc: Minghsiu Tsai 
Cc: Hans Verkuil 
Cc: Mauro Carvalho Chehab 
---
 drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c 
b/drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c
index 9a747e7..4a9e3e9d 100644
--- a/drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c
+++ b/drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c
@@ -1267,13 +1267,13 @@ int mtk_mdp_register_m2m_device(struct mtk_mdp_dev *mdp)
 err_vdev_register:
v4l2_m2m_release(mdp->m2m_dev);
 err_m2m_init:
-   video_device_release(>vdev);
+   video_device_release(mdp->vdev);
 
return ret;
 }
 
 void mtk_mdp_unregister_m2m_device(struct mtk_mdp_dev *mdp)
 {
-   video_device_release(>vdev);
+   video_device_release(mdp->vdev);
v4l2_m2m_release(mdp->m2m_dev);
 }
-- 
2.9.3



[PATCH next 2/2] media: mtk-mdp: NULL-terminate mtk_mdp_comp_dt_ids

2016-10-27 Thread Vincent Stehlé
The mtk_mdp_comp_dt_ids[] array should be NULL-terminated; add therefore an
empty entry in the end.

Fixes: c8eb2d7e8202fd9c ("[media] media: Add Mediatek MDP Driver")
Signed-off-by: Vincent Stehlé <vincent.ste...@laposte.net>
Cc: Minghsiu Tsai <minghsiu.t...@mediatek.com>
Cc: Hans Verkuil <hans.verk...@cisco.com>
Cc: Mauro Carvalho Chehab <mche...@s-opensource.com>
---
 drivers/media/platform/mtk-mdp/mtk_mdp_core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/mtk-mdp/mtk_mdp_core.c 
b/drivers/media/platform/mtk-mdp/mtk_mdp_core.c
index 40a229d..53296e2 100644
--- a/drivers/media/platform/mtk-mdp/mtk_mdp_core.c
+++ b/drivers/media/platform/mtk-mdp/mtk_mdp_core.c
@@ -50,7 +50,8 @@ static const struct of_device_id mtk_mdp_comp_dt_ids[] = {
}, {
.compatible = "mediatek,mt8173-mdp-wrot",
.data = (void *)MTK_MDP_WROT
-   }
+   },
+   { },
 };
 
 static const struct of_device_id mtk_mdp_of_ids[] = {
-- 
2.9.3



[PATCH next 2/2] media: mtk-mdp: NULL-terminate mtk_mdp_comp_dt_ids

2016-10-27 Thread Vincent Stehlé
The mtk_mdp_comp_dt_ids[] array should be NULL-terminated; add therefore an
empty entry in the end.

Fixes: c8eb2d7e8202fd9c ("[media] media: Add Mediatek MDP Driver")
Signed-off-by: Vincent Stehlé 
Cc: Minghsiu Tsai 
Cc: Hans Verkuil 
Cc: Mauro Carvalho Chehab 
---
 drivers/media/platform/mtk-mdp/mtk_mdp_core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/mtk-mdp/mtk_mdp_core.c 
b/drivers/media/platform/mtk-mdp/mtk_mdp_core.c
index 40a229d..53296e2 100644
--- a/drivers/media/platform/mtk-mdp/mtk_mdp_core.c
+++ b/drivers/media/platform/mtk-mdp/mtk_mdp_core.c
@@ -50,7 +50,8 @@ static const struct of_device_id mtk_mdp_comp_dt_ids[] = {
}, {
.compatible = "mediatek,mt8173-mdp-wrot",
.data = (void *)MTK_MDP_WROT
-   }
+   },
+   { },
 };
 
 static const struct of_device_id mtk_mdp_of_ids[] = {
-- 
2.9.3



[PATCH 1/2] perf: cast some printf() arguments to fix x32 build

2016-10-06 Thread Vincent Stehlé
Fix a few printf() format warnings regarding struct timeval fields on x32
(a.k.a AMD64 ILP32). As those warnings are treated as errors, they break
the build.

This fixes this kind of build warning:

  bench/sched-pipe.c:160:20: error: format '%lu' expects argument of type 'long 
unsigned int', but argument 3 has type '__time_t {aka long long int}' 
[-Werror=format=]
 printf(" %14s: %lu.%03lu [sec]\n\n", "Total time",
  ^

Signed-off-by: Vincent Stehlé <vincent.ste...@intel.com>
Cc: Peter Zijlstra <pet...@infradead.org>
Cc: Ingo Molnar <mi...@redhat.com>
Cc: Arnaldo Carvalho de Melo <a...@kernel.org>
Cc: Jiri Olsa <jo...@redhat.com>
Cc: Adrian Hunter <adrian.hun...@intel.com>
---
 tools/perf/bench/sched-messaging.c | 4 ++--
 tools/perf/bench/sched-pipe.c  | 4 ++--
 tools/perf/builtin-kvm.c   | 2 +-
 tools/perf/builtin-stat.c  | 3 ++-
 4 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/tools/perf/bench/sched-messaging.c 
b/tools/perf/bench/sched-messaging.c
index 6a111e77..7ad91c1 100644
--- a/tools/perf/bench/sched-messaging.c
+++ b/tools/perf/bench/sched-messaging.c
@@ -312,11 +312,11 @@ int bench_sched_messaging(int argc, const char **argv,
   num_groups, num_groups * 2 * num_fds,
   thread_mode ? "threads" : "processes");
printf(" %14s: %lu.%03lu [sec]\n", "Total time",
-  diff.tv_sec,
+  (unsigned long) diff.tv_sec,
   (unsigned long) (diff.tv_usec / USEC_PER_MSEC));
break;
case BENCH_FORMAT_SIMPLE:
-   printf("%lu.%03lu\n", diff.tv_sec,
+   printf("%lu.%03lu\n", (unsigned long) diff.tv_sec,
   (unsigned long) (diff.tv_usec / USEC_PER_MSEC));
break;
default:
diff --git a/tools/perf/bench/sched-pipe.c b/tools/perf/bench/sched-pipe.c
index 2243f01..62277fb 100644
--- a/tools/perf/bench/sched-pipe.c
+++ b/tools/perf/bench/sched-pipe.c
@@ -158,7 +158,7 @@ int bench_sched_pipe(int argc, const char **argv, const 
char *prefix __maybe_unu
result_usec += diff.tv_usec;
 
printf(" %14s: %lu.%03lu [sec]\n\n", "Total time",
-  diff.tv_sec,
+  (unsigned long) diff.tv_sec,
   (unsigned long) (diff.tv_usec / USEC_PER_MSEC));
 
printf(" %14lf usecs/op\n",
@@ -170,7 +170,7 @@ int bench_sched_pipe(int argc, const char **argv, const 
char *prefix __maybe_unu
 
case BENCH_FORMAT_SIMPLE:
printf("%lu.%03lu\n",
-  diff.tv_sec,
+  (unsigned long) diff.tv_sec,
   (unsigned long) (diff.tv_usec / USEC_PER_MSEC));
break;
 
diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c
index 08fa88f..9a6489f 100644
--- a/tools/perf/builtin-kvm.c
+++ b/tools/perf/builtin-kvm.c
@@ -566,7 +566,7 @@ static void show_timeofday(void)
gettimeofday(, NULL);
if (localtime_r(_sec, )) {
strftime(date, sizeof(date), "%H:%M:%S", );
-   pr_info("%s.%06ld", date, tv.tv_usec);
+   pr_info("%s.%06ld", date, (long) tv.tv_usec);
} else
pr_info("00:00:00.00");
 
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index 688dea7..ab86bc6 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -1393,7 +1393,8 @@ static void print_interval(char *prefix, struct timespec 
*ts)
FILE *output = stat_config.output;
static int num_print_interval;
 
-   sprintf(prefix, "%6lu.%09lu%s", ts->tv_sec, ts->tv_nsec, csv_sep);
+   sprintf(prefix, "%6lu.%09lu%s", (unsigned long) ts->tv_sec,
+   (unsigned long) ts->tv_nsec, csv_sep);
 
if (num_print_interval == 0 && !csv_output) {
switch (stat_config.aggr_mode) {
-- 
2.9.3



[PATCH 1/2] perf: cast some printf() arguments to fix x32 build

2016-10-06 Thread Vincent Stehlé
Fix a few printf() format warnings regarding struct timeval fields on x32
(a.k.a AMD64 ILP32). As those warnings are treated as errors, they break
the build.

This fixes this kind of build warning:

  bench/sched-pipe.c:160:20: error: format '%lu' expects argument of type 'long 
unsigned int', but argument 3 has type '__time_t {aka long long int}' 
[-Werror=format=]
 printf(" %14s: %lu.%03lu [sec]\n\n", "Total time",
  ^

Signed-off-by: Vincent Stehlé 
Cc: Peter Zijlstra 
Cc: Ingo Molnar 
Cc: Arnaldo Carvalho de Melo 
Cc: Jiri Olsa 
Cc: Adrian Hunter 
---
 tools/perf/bench/sched-messaging.c | 4 ++--
 tools/perf/bench/sched-pipe.c  | 4 ++--
 tools/perf/builtin-kvm.c   | 2 +-
 tools/perf/builtin-stat.c  | 3 ++-
 4 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/tools/perf/bench/sched-messaging.c 
b/tools/perf/bench/sched-messaging.c
index 6a111e77..7ad91c1 100644
--- a/tools/perf/bench/sched-messaging.c
+++ b/tools/perf/bench/sched-messaging.c
@@ -312,11 +312,11 @@ int bench_sched_messaging(int argc, const char **argv,
   num_groups, num_groups * 2 * num_fds,
   thread_mode ? "threads" : "processes");
printf(" %14s: %lu.%03lu [sec]\n", "Total time",
-  diff.tv_sec,
+  (unsigned long) diff.tv_sec,
   (unsigned long) (diff.tv_usec / USEC_PER_MSEC));
break;
case BENCH_FORMAT_SIMPLE:
-   printf("%lu.%03lu\n", diff.tv_sec,
+   printf("%lu.%03lu\n", (unsigned long) diff.tv_sec,
   (unsigned long) (diff.tv_usec / USEC_PER_MSEC));
break;
default:
diff --git a/tools/perf/bench/sched-pipe.c b/tools/perf/bench/sched-pipe.c
index 2243f01..62277fb 100644
--- a/tools/perf/bench/sched-pipe.c
+++ b/tools/perf/bench/sched-pipe.c
@@ -158,7 +158,7 @@ int bench_sched_pipe(int argc, const char **argv, const 
char *prefix __maybe_unu
result_usec += diff.tv_usec;
 
printf(" %14s: %lu.%03lu [sec]\n\n", "Total time",
-  diff.tv_sec,
+  (unsigned long) diff.tv_sec,
   (unsigned long) (diff.tv_usec / USEC_PER_MSEC));
 
printf(" %14lf usecs/op\n",
@@ -170,7 +170,7 @@ int bench_sched_pipe(int argc, const char **argv, const 
char *prefix __maybe_unu
 
case BENCH_FORMAT_SIMPLE:
printf("%lu.%03lu\n",
-  diff.tv_sec,
+  (unsigned long) diff.tv_sec,
   (unsigned long) (diff.tv_usec / USEC_PER_MSEC));
break;
 
diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c
index 08fa88f..9a6489f 100644
--- a/tools/perf/builtin-kvm.c
+++ b/tools/perf/builtin-kvm.c
@@ -566,7 +566,7 @@ static void show_timeofday(void)
gettimeofday(, NULL);
if (localtime_r(_sec, )) {
strftime(date, sizeof(date), "%H:%M:%S", );
-   pr_info("%s.%06ld", date, tv.tv_usec);
+   pr_info("%s.%06ld", date, (long) tv.tv_usec);
} else
pr_info("00:00:00.00");
 
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index 688dea7..ab86bc6 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -1393,7 +1393,8 @@ static void print_interval(char *prefix, struct timespec 
*ts)
FILE *output = stat_config.output;
static int num_print_interval;
 
-   sprintf(prefix, "%6lu.%09lu%s", ts->tv_sec, ts->tv_nsec, csv_sep);
+   sprintf(prefix, "%6lu.%09lu%s", (unsigned long) ts->tv_sec,
+   (unsigned long) ts->tv_nsec, csv_sep);
 
if (num_print_interval == 0 && !csv_output) {
switch (stat_config.aggr_mode) {
-- 
2.9.3



[PATCH 2/2] perf x86: fix compilation of push/pop for x32

2016-10-06 Thread Vincent Stehlé
The x32 ABI (a.k.a AMD64 ILP32) necessitates to push or pop a 64-bit
register even though ILP32 uses 32-bit integers, longs and pointers.

This fixes the following build errors:

  arch/x86/tests/regs_load.S:65: Error: operand type mismatch for `push'
  arch/x86/tests/regs_load.S:72: Error: operand type mismatch for `pop'

Signed-off-by: Vincent Stehlé <vincent.ste...@intel.com>
Cc: Peter Zijlstra <pet...@infradead.org>
Cc: Ingo Molnar <mi...@redhat.com>
Cc: Arnaldo Carvalho de Melo <a...@kernel.org>
Cc: Jiri Olsa <jo...@redhat.com>
Cc: Adrian Hunter <adrian.hun...@intel.com>
---
 tools/perf/arch/x86/tests/regs_load.S | 8 
 1 file changed, 8 insertions(+)

diff --git a/tools/perf/arch/x86/tests/regs_load.S 
b/tools/perf/arch/x86/tests/regs_load.S
index 60875d5..4fa7943 100644
--- a/tools/perf/arch/x86/tests/regs_load.S
+++ b/tools/perf/arch/x86/tests/regs_load.S
@@ -62,14 +62,22 @@ ENTRY(perf_regs_load)
 ENDPROC(perf_regs_load)
 #else
 ENTRY(perf_regs_load)
+#if defined(__x86_64__) && defined(__ILP32__)
+   pushq %rdi
+#else
push %edi
+#endif
movl 8(%esp), %edi
movl %eax, AX(%edi)
movl %ebx, BX(%edi)
movl %ecx, CX(%edi)
movl %edx, DX(%edi)
movl %esi, SI(%edi)
+#if defined(__x86_64__) && defined(__ILP32__)
+   popq %rax
+#else
pop %eax
+#endif
movl %eax, DI(%edi)
movl %ebp, BP(%edi)
 
-- 
2.9.3



[PATCH 2/2] perf x86: fix compilation of push/pop for x32

2016-10-06 Thread Vincent Stehlé
The x32 ABI (a.k.a AMD64 ILP32) necessitates to push or pop a 64-bit
register even though ILP32 uses 32-bit integers, longs and pointers.

This fixes the following build errors:

  arch/x86/tests/regs_load.S:65: Error: operand type mismatch for `push'
  arch/x86/tests/regs_load.S:72: Error: operand type mismatch for `pop'

Signed-off-by: Vincent Stehlé 
Cc: Peter Zijlstra 
Cc: Ingo Molnar 
Cc: Arnaldo Carvalho de Melo 
Cc: Jiri Olsa 
Cc: Adrian Hunter 
---
 tools/perf/arch/x86/tests/regs_load.S | 8 
 1 file changed, 8 insertions(+)

diff --git a/tools/perf/arch/x86/tests/regs_load.S 
b/tools/perf/arch/x86/tests/regs_load.S
index 60875d5..4fa7943 100644
--- a/tools/perf/arch/x86/tests/regs_load.S
+++ b/tools/perf/arch/x86/tests/regs_load.S
@@ -62,14 +62,22 @@ ENTRY(perf_regs_load)
 ENDPROC(perf_regs_load)
 #else
 ENTRY(perf_regs_load)
+#if defined(__x86_64__) && defined(__ILP32__)
+   pushq %rdi
+#else
push %edi
+#endif
movl 8(%esp), %edi
movl %eax, AX(%edi)
movl %ebx, BX(%edi)
movl %ecx, CX(%edi)
movl %edx, DX(%edi)
movl %esi, SI(%edi)
+#if defined(__x86_64__) && defined(__ILP32__)
+   popq %rax
+#else
pop %eax
+#endif
movl %eax, DI(%edi)
movl %ebp, BP(%edi)
 
-- 
2.9.3



[PATCH] dmaengine: k3dma: fix off by one

2016-09-21 Thread Vincent Stehlé
In k3_of_dma_simple_xlate(), the d->chans[] array has d->dma_requests
elements so > should be >=.

Fixes: 8e6152bc660e69f5 ("dmaengine: Add hisilicon k3 DMA engine driver")
Signed-off-by: Vincent Stehlé <vincent.ste...@laposte.net>
Cc: Zhangfei Gao <zhangfei@linaro.org>
Cc: Vinod Koul <vinod.k...@intel.com>
Cc: sta...@vger.kernel.org
---
 drivers/dma/k3dma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/dma/k3dma.c b/drivers/dma/k3dma.c
index aabcb79..cd7f67b 100644
--- a/drivers/dma/k3dma.c
+++ b/drivers/dma/k3dma.c
@@ -792,7 +792,7 @@ static struct dma_chan *k3_of_dma_simple_xlate(struct 
of_phandle_args *dma_spec,
struct k3_dma_dev *d = ofdma->of_dma_data;
unsigned int request = dma_spec->args[0];
 
-   if (request > d->dma_requests)
+   if (request >= d->dma_requests)
return NULL;
 
return dma_get_slave_channel(&(d->chans[request].vc.chan));
-- 
2.9.3



[PATCH] dmaengine: k3dma: fix off by one

2016-09-21 Thread Vincent Stehlé
In k3_of_dma_simple_xlate(), the d->chans[] array has d->dma_requests
elements so > should be >=.

Fixes: 8e6152bc660e69f5 ("dmaengine: Add hisilicon k3 DMA engine driver")
Signed-off-by: Vincent Stehlé 
Cc: Zhangfei Gao 
Cc: Vinod Koul 
Cc: sta...@vger.kernel.org
---
 drivers/dma/k3dma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/dma/k3dma.c b/drivers/dma/k3dma.c
index aabcb79..cd7f67b 100644
--- a/drivers/dma/k3dma.c
+++ b/drivers/dma/k3dma.c
@@ -792,7 +792,7 @@ static struct dma_chan *k3_of_dma_simple_xlate(struct 
of_phandle_args *dma_spec,
struct k3_dma_dev *d = ofdma->of_dma_data;
unsigned int request = dma_spec->args[0];
 
-   if (request > d->dma_requests)
+   if (request >= d->dma_requests)
return NULL;
 
return dma_get_slave_channel(&(d->chans[request].vc.chan));
-- 
2.9.3



[PATCH] pinctrl: intel: merrifield: fix dup size in probe

2016-08-31 Thread Vincent Stehlé
In function mrfld_pinctrl_probe(), when duplicating the mrfld_families
array the requested memory region length is multiplied once too many by the
number of elements in the original array. Fix this to spare some memory.

Fixes: 4e80c8f505741cbd ("pinctrl: intel: Add Intel Merrifield pin controller 
support")
Signed-off-by: Vincent Stehlé <vincent.ste...@intel.com>
Cc: Andy Shevchenko <andriy.shevche...@linux.intel.com>
Cc: Linus Walleij <linus.wall...@linaro.org>
---
 drivers/pinctrl/intel/pinctrl-merrifield.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pinctrl/intel/pinctrl-merrifield.c 
b/drivers/pinctrl/intel/pinctrl-merrifield.c
index 7fb7656..7826c7f 100644
--- a/drivers/pinctrl/intel/pinctrl-merrifield.c
+++ b/drivers/pinctrl/intel/pinctrl-merrifield.c
@@ -854,7 +854,7 @@ static int mrfld_pinctrl_probe(struct platform_device *pdev)
 */
nfamilies = ARRAY_SIZE(mrfld_families),
families = devm_kmemdup(>dev, mrfld_families,
-   nfamilies * sizeof(mrfld_families),
+   sizeof(mrfld_families),
GFP_KERNEL);
if (!families)
return -ENOMEM;
-- 
2.9.3



[PATCH] pinctrl: intel: merrifield: fix dup size in probe

2016-08-31 Thread Vincent Stehlé
In function mrfld_pinctrl_probe(), when duplicating the mrfld_families
array the requested memory region length is multiplied once too many by the
number of elements in the original array. Fix this to spare some memory.

Fixes: 4e80c8f505741cbd ("pinctrl: intel: Add Intel Merrifield pin controller 
support")
Signed-off-by: Vincent Stehlé 
Cc: Andy Shevchenko 
Cc: Linus Walleij 
---
 drivers/pinctrl/intel/pinctrl-merrifield.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pinctrl/intel/pinctrl-merrifield.c 
b/drivers/pinctrl/intel/pinctrl-merrifield.c
index 7fb7656..7826c7f 100644
--- a/drivers/pinctrl/intel/pinctrl-merrifield.c
+++ b/drivers/pinctrl/intel/pinctrl-merrifield.c
@@ -854,7 +854,7 @@ static int mrfld_pinctrl_probe(struct platform_device *pdev)
 */
nfamilies = ARRAY_SIZE(mrfld_families),
families = devm_kmemdup(>dev, mrfld_families,
-   nfamilies * sizeof(mrfld_families),
+   sizeof(mrfld_families),
GFP_KERNEL);
if (!families)
return -ENOMEM;
-- 
2.9.3



[PATCH] nvmet-rdma: Fix use after free

2016-08-16 Thread Vincent Stehlé
Avoid dereferencing the queue pointer in nvmet_rdma_release_queue_work()
after it has been freed by nvmet_rdma_free_queue().

Fixes: d8f7750a08968b10 ("nvmet-rdma: Correctly handle RDMA device hot removal")
Signed-off-by: Vincent Stehlé <vincent.ste...@intel.com>
Cc: Sagi Grimberg <s...@grimberg.me>
Cc: Christoph Hellwig <h...@lst.de>
---
 drivers/nvme/target/rdma.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/nvme/target/rdma.c b/drivers/nvme/target/rdma.c
index b4d6485..5de8d0a 100644
--- a/drivers/nvme/target/rdma.c
+++ b/drivers/nvme/target/rdma.c
@@ -978,10 +978,11 @@ static void nvmet_rdma_release_queue_work(struct 
work_struct *w)
container_of(w, struct nvmet_rdma_queue, release_work);
struct rdma_cm_id *cm_id = queue->cm_id;
struct nvmet_rdma_device *dev = queue->dev;
+   enum nvmet_rdma_queue_state state = queue->state;
 
nvmet_rdma_free_queue(queue);
 
-   if (queue->state != NVMET_RDMA_IN_DEVICE_REMOVAL)
+   if (state != NVMET_RDMA_IN_DEVICE_REMOVAL)
rdma_destroy_id(cm_id);
 
kref_put(>ref, nvmet_rdma_free_dev);
-- 
2.8.1



[PATCH] nvmet-rdma: Fix use after free

2016-08-16 Thread Vincent Stehlé
Avoid dereferencing the queue pointer in nvmet_rdma_release_queue_work()
after it has been freed by nvmet_rdma_free_queue().

Fixes: d8f7750a08968b10 ("nvmet-rdma: Correctly handle RDMA device hot removal")
Signed-off-by: Vincent Stehlé 
Cc: Sagi Grimberg 
Cc: Christoph Hellwig 
---
 drivers/nvme/target/rdma.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/nvme/target/rdma.c b/drivers/nvme/target/rdma.c
index b4d6485..5de8d0a 100644
--- a/drivers/nvme/target/rdma.c
+++ b/drivers/nvme/target/rdma.c
@@ -978,10 +978,11 @@ static void nvmet_rdma_release_queue_work(struct 
work_struct *w)
container_of(w, struct nvmet_rdma_queue, release_work);
struct rdma_cm_id *cm_id = queue->cm_id;
struct nvmet_rdma_device *dev = queue->dev;
+   enum nvmet_rdma_queue_state state = queue->state;
 
nvmet_rdma_free_queue(queue);
 
-   if (queue->state != NVMET_RDMA_IN_DEVICE_REMOVAL)
+   if (state != NVMET_RDMA_IN_DEVICE_REMOVAL)
rdma_destroy_id(cm_id);
 
kref_put(>ref, nvmet_rdma_free_dev);
-- 
2.8.1



Re: [PATCH] UBIFS: fix assertion in layout_in_gaps()

2016-08-16 Thread Vincent Stehlé
On Sun, Aug 14, 2016 at 11:00:33AM +0200, Richard Weinberger wrote:
..
> Good catch! Did you hit this assertion or was it found by review?
> I bet the latter since it is here since ever and given the wrongness
> it is unlikely to trigger.

Dear Richard,

It was found with a static checker and later review to confirm.

Best regards,

Vincent.


Re: [PATCH] UBIFS: fix assertion in layout_in_gaps()

2016-08-16 Thread Vincent Stehlé
On Sun, Aug 14, 2016 at 11:00:33AM +0200, Richard Weinberger wrote:
..
> Good catch! Did you hit this assertion or was it found by review?
> I bet the latter since it is here since ever and given the wrongness
> it is unlikely to trigger.

Dear Richard,

It was found with a static checker and later review to confirm.

Best regards,

Vincent.


[PATCH] mlxsw: spectrum_router: Fix use after free

2016-08-14 Thread Vincent Stehlé
In mlxsw_sp_router_fib4_add_info_destroy(), the fib_entry pointer is used
after it has been freed by mlxsw_sp_fib_entry_destroy(). Use a temporary
variable to fix this.

Fixes: 61c503f976b5449e ("mlxsw: spectrum_router: Implement fib4 add/del 
switchdev obj ops")
Signed-off-by: Vincent Stehlé <vincent.ste...@laposte.net>
Cc: Jiri Pirko <j...@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c 
b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
index 81418d6..90bb93b 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
@@ -1651,9 +1651,10 @@ static void mlxsw_sp_router_fib4_add_info_destroy(void 
const *data)
const struct mlxsw_sp_router_fib4_add_info *info = data;
struct mlxsw_sp_fib_entry *fib_entry = info->fib_entry;
struct mlxsw_sp *mlxsw_sp = info->mlxsw_sp;
+   struct mlxsw_sp_vr *vr = fib_entry->vr;
 
mlxsw_sp_fib_entry_destroy(fib_entry);
-   mlxsw_sp_vr_put(mlxsw_sp, fib_entry->vr);
+   mlxsw_sp_vr_put(mlxsw_sp, vr);
kfree(info);
 }
 
-- 
2.8.1



[PATCH] mlxsw: spectrum_router: Fix use after free

2016-08-14 Thread Vincent Stehlé
In mlxsw_sp_router_fib4_add_info_destroy(), the fib_entry pointer is used
after it has been freed by mlxsw_sp_fib_entry_destroy(). Use a temporary
variable to fix this.

Fixes: 61c503f976b5449e ("mlxsw: spectrum_router: Implement fib4 add/del 
switchdev obj ops")
Signed-off-by: Vincent Stehlé 
Cc: Jiri Pirko 
---
 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c 
b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
index 81418d6..90bb93b 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
@@ -1651,9 +1651,10 @@ static void mlxsw_sp_router_fib4_add_info_destroy(void 
const *data)
const struct mlxsw_sp_router_fib4_add_info *info = data;
struct mlxsw_sp_fib_entry *fib_entry = info->fib_entry;
struct mlxsw_sp *mlxsw_sp = info->mlxsw_sp;
+   struct mlxsw_sp_vr *vr = fib_entry->vr;
 
mlxsw_sp_fib_entry_destroy(fib_entry);
-   mlxsw_sp_vr_put(mlxsw_sp, fib_entry->vr);
+   mlxsw_sp_vr_put(mlxsw_sp, vr);
kfree(info);
 }
 
-- 
2.8.1



[PATCH] UBIFS: fix assertion in layout_in_gaps()

2016-08-12 Thread Vincent Stehlé
An assertion in layout_in_gaps() verifies that the gap_lebs pointer is
below the maximum bound. When computing this maximum bound the idx_lebs
count is multiplied by sizeof(int), while C pointers arithmetic does take
into account the size of the pointed elements implicitly already. Remove
the multiplication to fix the assertion.

Fixes: 1e51764a3c2ac05a ("UBIFS: add new flash file system")
Signed-off-by: Vincent Stehlé <vincent.ste...@intel.com>
Cc: Artem Bityutskiy <artem.bityuts...@linux.intel.com>
---
 fs/ubifs/tnc_commit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ubifs/tnc_commit.c b/fs/ubifs/tnc_commit.c
index b45345d..51157da 100644
--- a/fs/ubifs/tnc_commit.c
+++ b/fs/ubifs/tnc_commit.c
@@ -370,7 +370,7 @@ static int layout_in_gaps(struct ubifs_info *c, int cnt)
 
p = c->gap_lebs;
do {
-   ubifs_assert(p < c->gap_lebs + sizeof(int) * c->lst.idx_lebs);
+   ubifs_assert(p < c->gap_lebs + c->lst.idx_lebs);
written = layout_leb_in_gaps(c, p);
if (written < 0) {
err = written;
-- 
2.8.1



[PATCH] UBIFS: fix assertion in layout_in_gaps()

2016-08-12 Thread Vincent Stehlé
An assertion in layout_in_gaps() verifies that the gap_lebs pointer is
below the maximum bound. When computing this maximum bound the idx_lebs
count is multiplied by sizeof(int), while C pointers arithmetic does take
into account the size of the pointed elements implicitly already. Remove
the multiplication to fix the assertion.

Fixes: 1e51764a3c2ac05a ("UBIFS: add new flash file system")
Signed-off-by: Vincent Stehlé 
Cc: Artem Bityutskiy 
---
 fs/ubifs/tnc_commit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ubifs/tnc_commit.c b/fs/ubifs/tnc_commit.c
index b45345d..51157da 100644
--- a/fs/ubifs/tnc_commit.c
+++ b/fs/ubifs/tnc_commit.c
@@ -370,7 +370,7 @@ static int layout_in_gaps(struct ubifs_info *c, int cnt)
 
p = c->gap_lebs;
do {
-   ubifs_assert(p < c->gap_lebs + sizeof(int) * c->lst.idx_lebs);
+   ubifs_assert(p < c->gap_lebs + c->lst.idx_lebs);
written = layout_leb_in_gaps(c, p);
if (written < 0) {
err = written;
-- 
2.8.1



Re: [PATCH] intel_menlow: prevent NULL pointer dereference

2016-06-09 Thread Vincent Stehlé
On Wed, Jun 08, 2016 at 01:38:46PM -0700, Darren Hart wrote:
> Under what circumstances can the .remove op be called with a NULL struct
> acpi_device * as a parameter? From what I can see, most acpi_* calls accpeting
> an acpi_device rely on it not being null, and they are regularly called from
> driver remove functions.
> Did you observe an explicit failure or can you describe a call path where this
> can occur?

Hi Darren,

Thank you for reviewing.

I am not sure about when the .remove() functions are called with a NULL
pointer, or if that can ever happen. I just noticed that dereferencing the
pointer and checking for NULL after did not seem to be the right thing to
do. So I wanted to replicate instead the same construct as e.g.
xen_acpi_processor_remove().

Your remark encouraged me to do some more digging into the sources and it
appears that 13 .remove() functions do indeed check their input device
pointer for NULL, while 26 do not (the remaining do not use their input
pointer at all). Now I am puzzled about the necessity to check the pointer
for NULL or not, and there does not seem to be a definitive answer in the
docs either...

Best regards,

Vincent.


Re: [PATCH] intel_menlow: prevent NULL pointer dereference

2016-06-09 Thread Vincent Stehlé
On Wed, Jun 08, 2016 at 01:38:46PM -0700, Darren Hart wrote:
> Under what circumstances can the .remove op be called with a NULL struct
> acpi_device * as a parameter? From what I can see, most acpi_* calls accpeting
> an acpi_device rely on it not being null, and they are regularly called from
> driver remove functions.
> Did you observe an explicit failure or can you describe a call path where this
> can occur?

Hi Darren,

Thank you for reviewing.

I am not sure about when the .remove() functions are called with a NULL
pointer, or if that can ever happen. I just noticed that dereferencing the
pointer and checking for NULL after did not seem to be the right thing to
do. So I wanted to replicate instead the same construct as e.g.
xen_acpi_processor_remove().

Your remark encouraged me to do some more digging into the sources and it
appears that 13 .remove() functions do indeed check their input device
pointer for NULL, while 26 do not (the remaining do not use their input
pointer at all). Now I am puzzled about the necessity to check the pointer
for NULL or not, and there does not seem to be a definitive answer in the
docs either...

Best regards,

Vincent.


[PATCH] intel_menlow: prevent NULL pointer dereference

2016-05-25 Thread Vincent Stehlé
The function acpi_driver_data() will dereference its parameter; make sure
to check for NULL pointer before we call it.

Signed-off-by: Vincent Stehlé <vincent.ste...@intel.com>
Cc: Sujith Thomas <sujith.tho...@intel.com>
Cc: Darren Hart <dvh...@infradead.org>
Cc: Zhang Rui <rui.zh...@intel.com>
Cc: Len Brown <len.br...@intel.com>
---
 drivers/platform/x86/intel_menlow.c | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/platform/x86/intel_menlow.c 
b/drivers/platform/x86/intel_menlow.c
index 0a919d8..185a1bd 100644
--- a/drivers/platform/x86/intel_menlow.c
+++ b/drivers/platform/x86/intel_menlow.c
@@ -196,9 +196,13 @@ static int intel_menlow_memory_add(struct acpi_device 
*device)
 
 static int intel_menlow_memory_remove(struct acpi_device *device)
 {
-   struct thermal_cooling_device *cdev = acpi_driver_data(device);
+   struct thermal_cooling_device *cdev;
+
+   if (!device)
+   return -EINVAL;
 
-   if (!device || !cdev)
+   cdev = acpi_driver_data(device);
+   if (!cdev)
return -EINVAL;
 
sysfs_remove_link(>dev.kobj, "thermal_cooling");
-- 
2.8.1



[PATCH] intel_menlow: prevent NULL pointer dereference

2016-05-25 Thread Vincent Stehlé
The function acpi_driver_data() will dereference its parameter; make sure
to check for NULL pointer before we call it.

Signed-off-by: Vincent Stehlé 
Cc: Sujith Thomas 
Cc: Darren Hart 
Cc: Zhang Rui 
Cc: Len Brown 
---
 drivers/platform/x86/intel_menlow.c | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/platform/x86/intel_menlow.c 
b/drivers/platform/x86/intel_menlow.c
index 0a919d8..185a1bd 100644
--- a/drivers/platform/x86/intel_menlow.c
+++ b/drivers/platform/x86/intel_menlow.c
@@ -196,9 +196,13 @@ static int intel_menlow_memory_add(struct acpi_device 
*device)
 
 static int intel_menlow_memory_remove(struct acpi_device *device)
 {
-   struct thermal_cooling_device *cdev = acpi_driver_data(device);
+   struct thermal_cooling_device *cdev;
+
+   if (!device)
+   return -EINVAL;
 
-   if (!device || !cdev)
+   cdev = acpi_driver_data(device);
+   if (!cdev)
return -EINVAL;
 
sysfs_remove_link(>dev.kobj, "thermal_cooling");
-- 
2.8.1



[PATCH] perf/x86/intel/rapl: fix pmus free during cleanup

2016-05-24 Thread Vincent Stehlé
On rapl cleanup path, kfree() is given by mistake the address of the
pointer of the structure to free (rapl_pmus->pmus + i). Pass the pointer
instead (rapl_pmus->pmus[i]).

This was introduced by commit 9de8d686955b0e8e27847ed4edbbcd280f3fd8
("perf/x86/intel/rapl: Convert it to a per package facility").

Signed-off-by: Vincent Stehlé <vincent.ste...@intel.com>
Cc: Thomas Gleixner <t...@linutronix.de>
Cc: Ingo Molnar <mi...@redhat.com>
Cc: "H. Peter Anvin" <h...@zytor.com>
---
 arch/x86/events/intel/rapl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/events/intel/rapl.c b/arch/x86/events/intel/rapl.c
index 99c4bab..e30eef4 100644
--- a/arch/x86/events/intel/rapl.c
+++ b/arch/x86/events/intel/rapl.c
@@ -714,7 +714,7 @@ static void cleanup_rapl_pmus(void)
int i;
 
for (i = 0; i < rapl_pmus->maxpkg; i++)
-   kfree(rapl_pmus->pmus + i);
+   kfree(rapl_pmus->pmus[i]);
kfree(rapl_pmus);
 }
 
-- 
2.8.1



[PATCH] perf/x86/intel/rapl: fix pmus free during cleanup

2016-05-24 Thread Vincent Stehlé
On rapl cleanup path, kfree() is given by mistake the address of the
pointer of the structure to free (rapl_pmus->pmus + i). Pass the pointer
instead (rapl_pmus->pmus[i]).

This was introduced by commit 9de8d686955b0e8e27847ed4edbbcd280f3fd8
("perf/x86/intel/rapl: Convert it to a per package facility").

Signed-off-by: Vincent Stehlé 
Cc: Thomas Gleixner 
Cc: Ingo Molnar 
Cc: "H. Peter Anvin" 
---
 arch/x86/events/intel/rapl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/events/intel/rapl.c b/arch/x86/events/intel/rapl.c
index 99c4bab..e30eef4 100644
--- a/arch/x86/events/intel/rapl.c
+++ b/arch/x86/events/intel/rapl.c
@@ -714,7 +714,7 @@ static void cleanup_rapl_pmus(void)
int i;
 
for (i = 0; i < rapl_pmus->maxpkg; i++)
-   kfree(rapl_pmus->pmus + i);
+   kfree(rapl_pmus->pmus[i]);
kfree(rapl_pmus);
 }
 
-- 
2.8.1



[PATCH] Btrfs: fix fspath error deallocation

2016-05-10 Thread Vincent Stehlé
Make sure to deallocate fspath with vfree() in case of error in
init_ipath().

fspath is allocated with vmalloc() in init_data_container() since
commit 425d17a290c0 ("Btrfs: use larger limit for translation of logical to
inode").

Signed-off-by: Vincent Stehlé <vincent.ste...@intel.com>
Cc: Chris Mason <c...@fb.com>
Cc: Josef Bacik <jba...@fb.com>
Cc: David Sterba <dste...@suse.com>
---
 fs/btrfs/backref.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c
index 80e8472..d309018 100644
--- a/fs/btrfs/backref.c
+++ b/fs/btrfs/backref.c
@@ -1991,7 +1991,7 @@ struct inode_fs_paths *init_ipath(s32 total_bytes, struct 
btrfs_root *fs_root,
 
ifp = kmalloc(sizeof(*ifp), GFP_NOFS);
if (!ifp) {
-   kfree(fspath);
+   vfree(fspath);
return ERR_PTR(-ENOMEM);
}
 
-- 
2.8.0.rc3



[PATCH] Btrfs: fix fspath error deallocation

2016-05-10 Thread Vincent Stehlé
Make sure to deallocate fspath with vfree() in case of error in
init_ipath().

fspath is allocated with vmalloc() in init_data_container() since
commit 425d17a290c0 ("Btrfs: use larger limit for translation of logical to
inode").

Signed-off-by: Vincent Stehlé 
Cc: Chris Mason 
Cc: Josef Bacik 
Cc: David Sterba 
---
 fs/btrfs/backref.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c
index 80e8472..d309018 100644
--- a/fs/btrfs/backref.c
+++ b/fs/btrfs/backref.c
@@ -1991,7 +1991,7 @@ struct inode_fs_paths *init_ipath(s32 total_bytes, struct 
btrfs_root *fs_root,
 
ifp = kmalloc(sizeof(*ifp), GFP_NOFS);
if (!ifp) {
-   kfree(fspath);
+   vfree(fspath);
return ERR_PTR(-ENOMEM);
}
 
-- 
2.8.0.rc3



[PATCH next] ARM: virt: fix build of hyp-stub

2016-02-18 Thread Vincent Stehlé
Compile hyp-stub explicitly for arm v7-a. This fixes the following build
errors:

  arch/arm/kernel/hyp-stub.S: Assembler messages:
  arch/arm/kernel/hyp-stub.S:168: Error: selected processor does not support 
`ubfx r7,r7,#28,#4' in ARM mode
  arch/arm/kernel/hyp-stub.S:176: Error: selected processor does not support 
`isb' in ARM mode

Signed-off-by: Vincent Stehlé <vincent.ste...@laposte.net>
Cc: Jean-Philippe Brucker <jean-philippe.bruc...@arm.com>
Cc: Marc Zyngier <marc.zyng...@arm.com>
Cc: Russell King <rmk+ker...@arm.linux.org.uk>
---


Hi,

This can be seen with linux next-20160218 and arm e.g. allmodconfig.

Best regards,

V.


 arch/arm/kernel/Makefile | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile
index 2c5f160..15684c5 100644
--- a/arch/arm/kernel/Makefile
+++ b/arch/arm/kernel/Makefile
@@ -88,6 +88,8 @@ obj-$(CONFIG_DEBUG_LL)+= debug.o
 obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
 
 obj-$(CONFIG_ARM_VIRT_EXT) += hyp-stub.o
+AFLAGS_hyp-stub.o  :=-Wa,-march=armv7-a
+
 ifeq ($(CONFIG_ARM_PSCI),y)
 obj-$(CONFIG_SMP)  += psci_smp.o
 endif
-- 
2.7.0



[PATCH next] ARM: virt: fix build of hyp-stub

2016-02-18 Thread Vincent Stehlé
Compile hyp-stub explicitly for arm v7-a. This fixes the following build
errors:

  arch/arm/kernel/hyp-stub.S: Assembler messages:
  arch/arm/kernel/hyp-stub.S:168: Error: selected processor does not support 
`ubfx r7,r7,#28,#4' in ARM mode
  arch/arm/kernel/hyp-stub.S:176: Error: selected processor does not support 
`isb' in ARM mode

Signed-off-by: Vincent Stehlé 
Cc: Jean-Philippe Brucker 
Cc: Marc Zyngier 
Cc: Russell King 
---


Hi,

This can be seen with linux next-20160218 and arm e.g. allmodconfig.

Best regards,

V.


 arch/arm/kernel/Makefile | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile
index 2c5f160..15684c5 100644
--- a/arch/arm/kernel/Makefile
+++ b/arch/arm/kernel/Makefile
@@ -88,6 +88,8 @@ obj-$(CONFIG_DEBUG_LL)+= debug.o
 obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
 
 obj-$(CONFIG_ARM_VIRT_EXT) += hyp-stub.o
+AFLAGS_hyp-stub.o  :=-Wa,-march=armv7-a
+
 ifeq ($(CONFIG_ARM_PSCI),y)
 obj-$(CONFIG_SMP)  += psci_smp.o
 endif
-- 
2.7.0



[PATCH] ASoC: Intel: Skylake: fix typo in sizeof

2015-10-29 Thread Vincent Stehlé
The size of the pointer to a data structure to send is erroneously
passed to sst_ipc_tx_message_wait() as its tx_bytes argument. It should
be given the size of the pointed skl_ipc_dxstate_info structure instead.

Coincidentally, both the pointer and the structure have the same size of
8 bytes on a 64 bit machine, which "masks" the issue. Compiling for 32
bit reveals the issue more clearly.

Fix the typo for correctness, and to make the code robust to future
evolutions of the skl_ipc_dxstate_info structure size.

This fixes the following coccicheck error:

  sound/soc/intel/skylake/skl-sst-ipc.c:641:8-14: ERROR: application of sizeof 
to pointer

Signed-off-by: Vincent Stehlé 
Cc: Subhransu S. Prusty 
Cc: Jeeja KP 
Cc: Vinod Koul 
Cc: Mark Brown 
Cc: triv...@kernel.org
---
 sound/soc/intel/skylake/skl-sst-ipc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/intel/skylake/skl-sst-ipc.c 
b/sound/soc/intel/skylake/skl-sst-ipc.c
index 937a0a3..9aee835 100644
--- a/sound/soc/intel/skylake/skl-sst-ipc.c
+++ b/sound/soc/intel/skylake/skl-sst-ipc.c
@@ -638,7 +638,7 @@ int skl_ipc_set_dx(struct sst_generic_ipc *ipc, u8 
instance_id,
dev_dbg(ipc->dev, "In %s primary =%x ext=%x\n", __func__,
 header.primary, header.extension);
ret = sst_ipc_tx_message_wait(ipc, *ipc_header,
-   dx, sizeof(dx), NULL, 0);
+   dx, sizeof(*dx), NULL, 0);
if (ret < 0) {
dev_err(ipc->dev, "ipc: set dx failed, err %d\n", ret);
return ret;
-- 
2.6.1

--
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] ASoC: Intel: Skylake: fix typo in sizeof

2015-10-29 Thread Vincent Stehlé
The size of the pointer to a data structure to send is erroneously
passed to sst_ipc_tx_message_wait() as its tx_bytes argument. It should
be given the size of the pointed skl_ipc_dxstate_info structure instead.

Coincidentally, both the pointer and the structure have the same size of
8 bytes on a 64 bit machine, which "masks" the issue. Compiling for 32
bit reveals the issue more clearly.

Fix the typo for correctness, and to make the code robust to future
evolutions of the skl_ipc_dxstate_info structure size.

This fixes the following coccicheck error:

  sound/soc/intel/skylake/skl-sst-ipc.c:641:8-14: ERROR: application of sizeof 
to pointer

Signed-off-by: Vincent Stehlé <vincent.ste...@laposte.net>
Cc: Subhransu S. Prusty <subhransu.s.pru...@intel.com>
Cc: Jeeja KP <jeeja...@intel.com>
Cc: Vinod Koul <vinod.k...@intel.com>
Cc: Mark Brown <broo...@kernel.org>
Cc: triv...@kernel.org
---
 sound/soc/intel/skylake/skl-sst-ipc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/intel/skylake/skl-sst-ipc.c 
b/sound/soc/intel/skylake/skl-sst-ipc.c
index 937a0a3..9aee835 100644
--- a/sound/soc/intel/skylake/skl-sst-ipc.c
+++ b/sound/soc/intel/skylake/skl-sst-ipc.c
@@ -638,7 +638,7 @@ int skl_ipc_set_dx(struct sst_generic_ipc *ipc, u8 
instance_id,
dev_dbg(ipc->dev, "In %s primary =%x ext=%x\n", __func__,
 header.primary, header.extension);
ret = sst_ipc_tx_message_wait(ipc, *ipc_header,
-   dx, sizeof(dx), NULL, 0);
+   dx, sizeof(*dx), NULL, 0);
if (ret < 0) {
dev_err(ipc->dev, "ipc: set dx failed, err %d\n", ret);
return ret;
-- 
2.6.1

--
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] nfc: netlink: avoid NULL pointer dereference on error

2015-10-07 Thread Vincent Stehlé
The function nfc_genl_llc_sdreq() can dereference the dev pointer while
it is NULL on its error path. Create a new error handling label to avoid
that.

This fixes the following coccinelle error:

  ./net/nfc/netlink.c:1175:21-24: ERROR: dev is NULL but dereferenced.

Signed-off-by: Vincent Stehlé 
Cc: Thierry Escande 
Cc: Samuel Ortiz 
---
 net/nfc/netlink.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/nfc/netlink.c b/net/nfc/netlink.c
index 853172c..51c48f0 100644
--- a/net/nfc/netlink.c
+++ b/net/nfc/netlink.c
@@ -,7 +,7 @@ static int nfc_genl_llc_sdreq(struct sk_buff *skb, struct 
genl_info *info)
dev = nfc_get_device(idx);
if (!dev) {
rc = -ENODEV;
-   goto exit;
+   goto exit_nodev;
}
 
device_lock(>dev);
@@ -1176,6 +1176,7 @@ exit:
 
nfc_put_device(dev);
 
+exit_nodev:
return rc;
 }
 
-- 
2.5.1

--
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] nfc: netlink: avoid NULL pointer dereference on error

2015-10-07 Thread Vincent Stehlé
The function nfc_genl_llc_sdreq() can dereference the dev pointer while
it is NULL on its error path. Create a new error handling label to avoid
that.

This fixes the following coccinelle error:

  ./net/nfc/netlink.c:1175:21-24: ERROR: dev is NULL but dereferenced.

Signed-off-by: Vincent Stehlé <vincent.ste...@laposte.net>
Cc: Thierry Escande <thierry.esca...@linux.intel.com>
Cc: Samuel Ortiz <sa...@linux.intel.com>
---
 net/nfc/netlink.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/nfc/netlink.c b/net/nfc/netlink.c
index 853172c..51c48f0 100644
--- a/net/nfc/netlink.c
+++ b/net/nfc/netlink.c
@@ -,7 +,7 @@ static int nfc_genl_llc_sdreq(struct sk_buff *skb, struct 
genl_info *info)
dev = nfc_get_device(idx);
if (!dev) {
rc = -ENODEV;
-   goto exit;
+   goto exit_nodev;
}
 
device_lock(>dev);
@@ -1176,6 +1176,7 @@ exit:
 
nfc_put_device(dev);
 
+exit_nodev:
return rc;
 }
 
-- 
2.5.1

--
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 next] staging: wilc1000: avoid NULL pointer dereference on error

2015-10-06 Thread Vincent Stehlé
The host_int_init() function can dereference the pstrWFIDrv pointer
while it is NULL on its error path. Jump directly to the _fail_ error
label in the end of the error handling path to avoid that.
By doing that we also skip stopping our kthread and destroying
our message queue, but they were not started or created yet in that case
anyway.

This fixes the following coccinelle error:

  drivers/staging/wilc1000/host_interface.c:6100:17-33: ERROR: pstrWFIDrv is 
NULL but dereferenced.

Signed-off-by: Vincent Stehlé 
Cc: Johnny Kim 
Cc: Rachel Kim 
Cc: Dean Lee 
Cc: Chris Park 
Cc: Nicolas Ferre 
Cc: Greg Kroah-Hartman 
---


Hi,

Another form of this patch would make sense on mainline as well, but the
driver has changed so much in the mean time that it makes more sense to
modify staging-next.

Best regards,

V.


 drivers/staging/wilc1000/host_interface.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 2cf82b2..2fe3023 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -6017,7 +6017,7 @@ s32 host_int_init(tstrWILC_WFIDrv **phWFIDrv)
pstrWFIDrv  = kzalloc(sizeof(tstrWILC_WFIDrv), GFP_KERNEL);
if (!pstrWFIDrv) {
result = -ENOMEM;
-   goto _fail_timer_2;
+   goto _fail_;
}
*phWFIDrv = pstrWFIDrv;
err = add_handler_in_list(pstrWFIDrv);
-- 
2.5.1

--
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 next] staging: wilc1000: avoid NULL pointer dereference on error

2015-10-06 Thread Vincent Stehlé
The host_int_init() function can dereference the pstrWFIDrv pointer
while it is NULL on its error path. Jump directly to the _fail_ error
label in the end of the error handling path to avoid that.
By doing that we also skip stopping our kthread and destroying
our message queue, but they were not started or created yet in that case
anyway.

This fixes the following coccinelle error:

  drivers/staging/wilc1000/host_interface.c:6100:17-33: ERROR: pstrWFIDrv is 
NULL but dereferenced.

Signed-off-by: Vincent Stehlé <vincent.ste...@laposte.net>
Cc: Johnny Kim <johnny@atmel.com>
Cc: Rachel Kim <rachel@atmel.com>
Cc: Dean Lee <dean@atmel.com>
Cc: Chris Park <chris.p...@atmel.com>
Cc: Nicolas Ferre <nicolas.fe...@atmel.com>
Cc: Greg Kroah-Hartman <gre...@linuxfoundation.org>
---


Hi,

Another form of this patch would make sense on mainline as well, but the
driver has changed so much in the mean time that it makes more sense to
modify staging-next.

Best regards,

V.


 drivers/staging/wilc1000/host_interface.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 2cf82b2..2fe3023 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -6017,7 +6017,7 @@ s32 host_int_init(tstrWILC_WFIDrv **phWFIDrv)
pstrWFIDrv  = kzalloc(sizeof(tstrWILC_WFIDrv), GFP_KERNEL);
if (!pstrWFIDrv) {
result = -ENOMEM;
-   goto _fail_timer_2;
+   goto _fail_;
}
*phWFIDrv = pstrWFIDrv;
err = add_handler_in_list(pstrWFIDrv);
-- 
2.5.1

--
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] fs/super.c: use && instead of & for warn_on condition

2015-09-21 Thread Vincent Stehlé
This fixes the following sparse warning:

  fs/super.c:1202:9: warning: dubious: x & !y

Bitwise and logical and are equivalent here, but logical was intended.
The generated code is identical, with and without CONFIG_LOCKDEP.

Signed-off-by: Vincent Stehlé 
Cc: Oleg Nesterov 
Cc: Alexander Viro 
Cc: triv...@kernel.org
---
 fs/super.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/super.c b/fs/super.c
index 954aeb8..7ea56de 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -1199,7 +1199,7 @@ int __sb_start_write(struct super_block *sb, int level, 
bool wait)
else
ret = percpu_down_read_trylock(sb->s_writers.rw_sem + level-1);
 
-   WARN_ON(force_trylock & !ret);
+   WARN_ON(force_trylock && !ret);
return ret;
 }
 EXPORT_SYMBOL(__sb_start_write);
-- 
2.5.1

--
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] fs/super.c: use && instead of & for warn_on condition

2015-09-21 Thread Vincent Stehlé
This fixes the following sparse warning:

  fs/super.c:1202:9: warning: dubious: x & !y

Bitwise and logical and are equivalent here, but logical was intended.
The generated code is identical, with and without CONFIG_LOCKDEP.

Signed-off-by: Vincent Stehlé <vincent.ste...@freescale.com>
Cc: Oleg Nesterov <o...@redhat.com>
Cc: Alexander Viro <v...@zeniv.linux.org.uk>
Cc: triv...@kernel.org
---
 fs/super.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/super.c b/fs/super.c
index 954aeb8..7ea56de 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -1199,7 +1199,7 @@ int __sb_start_write(struct super_block *sb, int level, 
bool wait)
else
ret = percpu_down_read_trylock(sb->s_writers.rw_sem + level-1);
 
-   WARN_ON(force_trylock & !ret);
+   WARN_ON(force_trylock && !ret);
return ret;
 }
 EXPORT_SYMBOL(__sb_start_write);
-- 
2.5.1

--
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] Bluetooth: btintel: fix warning

2015-09-03 Thread Vincent Stehlé
Fix compilation the following compilation warning, which happens when
CONFIG_BT_INTEL is not set:

  drivers/bluetooth/btintel.h:98:13: warning: ‘btintel_version_info’
  defined but not used [-Wunused-function]
   static void btintel_version_info(struct hci_dev *hdev,
struct intel_version *ver)
   ^

Signed-off-by: Vincent Stehlé 
Cc: Marcel Holtmann 
Cc: triv...@kernel.org
---


Hi,

This warning can be seen with e.g. ARM imx_v6_v7_defconfig.

Best regards,

V. 


 drivers/bluetooth/btintel.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/bluetooth/btintel.h b/drivers/bluetooth/btintel.h
index b278d14..a49c8db 100644
--- a/drivers/bluetooth/btintel.h
+++ b/drivers/bluetooth/btintel.h
@@ -95,7 +95,8 @@ static inline void btintel_hw_error(struct hci_dev *hdev, u8 
code)
 {
 }
 
-static void btintel_version_info(struct hci_dev *hdev, struct intel_version 
*ver)
+static inline void btintel_version_info(struct hci_dev *hdev,
+   struct intel_version *ver)
 {
 }
 
-- 
2.5.0

--
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] Bluetooth: btintel: fix warning

2015-09-03 Thread Vincent Stehlé
Fix compilation the following compilation warning, which happens when
CONFIG_BT_INTEL is not set:

  drivers/bluetooth/btintel.h:98:13: warning: ‘btintel_version_info’
  defined but not used [-Wunused-function]
   static void btintel_version_info(struct hci_dev *hdev,
struct intel_version *ver)
   ^

Signed-off-by: Vincent Stehlé <vincent.ste...@laposte.net>
Cc: Marcel Holtmann <mar...@holtmann.org>
Cc: triv...@kernel.org
---


Hi,

This warning can be seen with e.g. ARM imx_v6_v7_defconfig.

Best regards,

V. 


 drivers/bluetooth/btintel.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/bluetooth/btintel.h b/drivers/bluetooth/btintel.h
index b278d14..a49c8db 100644
--- a/drivers/bluetooth/btintel.h
+++ b/drivers/bluetooth/btintel.h
@@ -95,7 +95,8 @@ static inline void btintel_hw_error(struct hci_dev *hdev, u8 
code)
 {
 }
 
-static void btintel_version_info(struct hci_dev *hdev, struct intel_version 
*ver)
+static inline void btintel_version_info(struct hci_dev *hdev,
+   struct intel_version *ver)
 {
 }
 
-- 
2.5.0

--
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] ARM: dts: imx27: fix typo in makefile

2015-03-19 Thread Vincent Stehlé
Commit cb612390e546 ("ARM: dts: Only build dtb if associated Arch and/or SoC is
enabled") conditioned the generation of i.MX27 systems dts with
CONFIG_SOC_IMX31; fix this typo.

Signed-off-by: Vincent Stehlé 
Cc: Peter Robinson 
Cc: Shawn Guo 
Cc: Olof Johansson 
Cc: Rob Herring 
---
 arch/arm/boot/dts/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index a1c776b..992ea0b 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -215,7 +215,7 @@ dtb-$(CONFIG_SOC_IMX25) += \
imx25-eukrea-mbimxsd25-baseboard-dvi-vga.dtb \
imx25-karo-tx25.dtb \
imx25-pdk.dtb
-dtb-$(CONFIG_SOC_IMX31) += \
+dtb-$(CONFIG_SOC_IMX27) += \
imx27-apf27.dtb \
imx27-apf27dev.dtb \
imx27-eukrea-mbimxsd27-baseboard.dtb \
-- 
2.1.4

--
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] ARM: dts: imx27: fix typo in makefile

2015-03-19 Thread Vincent Stehlé
Commit cb612390e546 (ARM: dts: Only build dtb if associated Arch and/or SoC is
enabled) conditioned the generation of i.MX27 systems dts with
CONFIG_SOC_IMX31; fix this typo.

Signed-off-by: Vincent Stehlé vincent.ste...@freescale.com
Cc: Peter Robinson pbrobin...@gmail.com
Cc: Shawn Guo shawn@freescale.com
Cc: Olof Johansson o...@lixom.net
Cc: Rob Herring robh...@kernel.org
---
 arch/arm/boot/dts/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index a1c776b..992ea0b 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -215,7 +215,7 @@ dtb-$(CONFIG_SOC_IMX25) += \
imx25-eukrea-mbimxsd25-baseboard-dvi-vga.dtb \
imx25-karo-tx25.dtb \
imx25-pdk.dtb
-dtb-$(CONFIG_SOC_IMX31) += \
+dtb-$(CONFIG_SOC_IMX27) += \
imx27-apf27.dtb \
imx27-apf27dev.dtb \
imx27-eukrea-mbimxsd27-baseboard.dtb \
-- 
2.1.4

--
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 v3 linux-next] iommu: Enable LPAE pagetable on ARM and ARM64 only

2015-02-23 Thread Vincent Stehlé
LPAE iommu page table makes sense only for ARM and ARM64 architectures. Add the
corresponding dependency in Kconfig (and enable for COMPILE_TEST, too, as per
Laurent's suggestion).

Signed-off-by: Vincent Stehlé 
Suggested-by: Laurent Pinchart 
Cc: Will Deacon 
---


On 02/24/2015 01:02 AM, Laurent Pinchart wrote:
> Shouldn't this be ARM || ARM64 || COMPILE_TEST ?

Hi Laurent,

It makes perfect sense; thanks. I completely forgot, as I have yet to see one
of those. Here is v3 of the patch.

Best regards,

V.


Changes since v2:
- Add condition on ARM64

Changes since v1:
- Add condition on COMPILE_TEST


 drivers/iommu/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig
index baa0d97..a440922 100644
--- a/drivers/iommu/Kconfig
+++ b/drivers/iommu/Kconfig
@@ -22,6 +22,7 @@ config IOMMU_IO_PGTABLE
 
 config IOMMU_IO_PGTABLE_LPAE
bool "ARMv7/v8 Long Descriptor Format"
+   depends on ARM || ARM64 || COMPILE_TEST
select IOMMU_IO_PGTABLE
help
  Enable support for the ARM long descriptor pagetable format.
-- 
2.1.4

--
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 v2 linux-next] iommu: Enable LPAE pagetable on ARM only

2015-02-23 Thread Vincent Stehlé
LPAE iommu page table makes sense only for ARM architecture. Add the
corresponding dependency in Kconfig (and enable for COMPILE_TEST, too, as per
Laurent's suggestion).

Signed-off-by: Vincent Stehlé 
Suggested-by: Laurent Pinchart 
Cc: Will Deacon 
---

Changes since v1:
- Add condition on COMPILE_TEST

 drivers/iommu/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig
index baa0d97..27cd88d 100644
--- a/drivers/iommu/Kconfig
+++ b/drivers/iommu/Kconfig
@@ -22,6 +22,7 @@ config IOMMU_IO_PGTABLE
 
 config IOMMU_IO_PGTABLE_LPAE
bool "ARMv7/v8 Long Descriptor Format"
+   depends on ARM || COMPILE_TEST
select IOMMU_IO_PGTABLE
help
  Enable support for the ARM long descriptor pagetable format.
-- 
2.1.4

--
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 linux-next] iommu: Enable LPAE pagetable on ARM only

2015-02-23 Thread Vincent Stehlé
On 02/23/2015 05:52 PM, Laurent Pinchart wrote:
(runtime warning)
> I suppose this is caused by the selftest code ?

Hi Laurent,

Thanks for your feedback. You are right, this is the selftest code. Here
are the traces just before the first warnings:

  arm-lpae io-pgtable: selftest: pgsize_bitmap 0x40201000, IAS 32^M
  arm-lpae io-pgtable: selftest: pgsize_bitmap 0x40201000, IAS 36^M
  arm-lpae io-pgtable: selftest: pgsize_bitmap 0x40201000, IAS 40^M

There are a number of failed selftests and warnings, and in the end the
PA-RISC machine won't boot.

..
> How about ARM || COMPILE_TEST ? It can still be useful to compile the module 
> on other architectures.

I think you are right and this is how it should be; thank you for the
tips, I did not know about COMPILE_TEST. I'll resend a patch v2 right away.

Best regards,

V.
--
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 v3 linux-next] iommu: Enable LPAE pagetable on ARM and ARM64 only

2015-02-23 Thread Vincent Stehlé
LPAE iommu page table makes sense only for ARM and ARM64 architectures. Add the
corresponding dependency in Kconfig (and enable for COMPILE_TEST, too, as per
Laurent's suggestion).

Signed-off-by: Vincent Stehlé vincent.ste...@laposte.net
Suggested-by: Laurent Pinchart laurent.pinch...@ideasonboard.com
Cc: Will Deacon will.dea...@arm.com
---


On 02/24/2015 01:02 AM, Laurent Pinchart wrote:
 Shouldn't this be ARM || ARM64 || COMPILE_TEST ?

Hi Laurent,

It makes perfect sense; thanks. I completely forgot, as I have yet to see one
of those. Here is v3 of the patch.

Best regards,

V.


Changes since v2:
- Add condition on ARM64

Changes since v1:
- Add condition on COMPILE_TEST


 drivers/iommu/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig
index baa0d97..a440922 100644
--- a/drivers/iommu/Kconfig
+++ b/drivers/iommu/Kconfig
@@ -22,6 +22,7 @@ config IOMMU_IO_PGTABLE
 
 config IOMMU_IO_PGTABLE_LPAE
bool ARMv7/v8 Long Descriptor Format
+   depends on ARM || ARM64 || COMPILE_TEST
select IOMMU_IO_PGTABLE
help
  Enable support for the ARM long descriptor pagetable format.
-- 
2.1.4

--
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 v2 linux-next] iommu: Enable LPAE pagetable on ARM only

2015-02-23 Thread Vincent Stehlé
LPAE iommu page table makes sense only for ARM architecture. Add the
corresponding dependency in Kconfig (and enable for COMPILE_TEST, too, as per
Laurent's suggestion).

Signed-off-by: Vincent Stehlé vincent.ste...@laposte.net
Suggested-by: Laurent Pinchart laurent.pinch...@ideasonboard.com
Cc: Will Deacon will.dea...@arm.com
---

Changes since v1:
- Add condition on COMPILE_TEST

 drivers/iommu/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig
index baa0d97..27cd88d 100644
--- a/drivers/iommu/Kconfig
+++ b/drivers/iommu/Kconfig
@@ -22,6 +22,7 @@ config IOMMU_IO_PGTABLE
 
 config IOMMU_IO_PGTABLE_LPAE
bool ARMv7/v8 Long Descriptor Format
+   depends on ARM || COMPILE_TEST
select IOMMU_IO_PGTABLE
help
  Enable support for the ARM long descriptor pagetable format.
-- 
2.1.4

--
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 linux-next] iommu: Enable LPAE pagetable on ARM only

2015-02-23 Thread Vincent Stehlé
On 02/23/2015 05:52 PM, Laurent Pinchart wrote:
(runtime warning)
 I suppose this is caused by the selftest code ?

Hi Laurent,

Thanks for your feedback. You are right, this is the selftest code. Here
are the traces just before the first warnings:

  arm-lpae io-pgtable: selftest: pgsize_bitmap 0x40201000, IAS 32^M
  arm-lpae io-pgtable: selftest: pgsize_bitmap 0x40201000, IAS 36^M
  arm-lpae io-pgtable: selftest: pgsize_bitmap 0x40201000, IAS 40^M

There are a number of failed selftests and warnings, and in the end the
PA-RISC machine won't boot.

..
 How about ARM || COMPILE_TEST ? It can still be useful to compile the module 
 on other architectures.

I think you are right and this is how it should be; thank you for the
tips, I did not know about COMPILE_TEST. I'll resend a patch v2 right away.

Best regards,

V.
--
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 linux-next] iommu: Enable LPAE pagetable on ARM only

2015-02-22 Thread Vincent Stehlé
LPAE iommu page table makes sense only for ARM architecture. Add the
corresponding dependency in Kconfig.

This fixes the following runtime warnings on PA-RISC architecture:

  WARNING: at drivers/iommu/io-pgtable-arm.c:413
  Modules linked in:
  CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.19.0-next-20150222-2-gc420256 
#2
  task: 17ca ti: 17ca8000 task.ti: 17ca8000
  
   YZrvWESTHLNXBCVMcbcbcbcbOGFRQPDI
  PSW: 0100 Not tainted
  r00-03  0004ff0f 001b 104871b0 17ca83c0
  r04-07  1000   
  r08-11   40001000 1013b36c 17ca8248
  r12-15  0080 17e712c0  17c5e100
  r16-19  000c 105d8eb0 40001000 
  r20-23   00800020 1048717c 
  r24-27  1000  0009 10774ce0
  r28-31   0027 17ca8480 10486d44
  sr00-03     
  sr04-07     
  
  IASQ:   IAOQ: 10486df4 10486df8
   IIR: 03ffe01fISR:   IOR: 17c86e54
   CPU:0   CR30: 17ca8000 CR31: 0002
   ORIG_R28: 0001
   IAOQ[0]: __arm_lpae_unmap+0x144/0x4cc
   IAOQ[1]: __arm_lpae_unmap+0x148/0x4cc
   RP(r2): arm_lpae_unmap+0x34/0x6c
  Backtrace:
   [<104871b0>] arm_lpae_unmap+0x34/0x6c
   [<10127944>] 0x10127944
   [<10168ee0>] do_one_initcall+0x128/0x1dc
   [<101028fc>] 0x101028fc
   [<10161b48>] kernel_init+0x1c/0x118
   [<1015d01c>] end_fault_vector+0x1c/0x24
   [<101762ec>] save_stack_trace+0x28/0x60

Signed-off-by: Vincent Stehlé 
Cc: Laurent Pinchart 
Cc: Will Deacon 
---


Hi,

This can be seen with e.g. Linux next-20150222 on parisc with allmodconfig.

Best regards,

V.


 drivers/iommu/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig
index baa0d97..c73fd72 100644
--- a/drivers/iommu/Kconfig
+++ b/drivers/iommu/Kconfig
@@ -22,6 +22,7 @@ config IOMMU_IO_PGTABLE
 
 config IOMMU_IO_PGTABLE_LPAE
bool "ARMv7/v8 Long Descriptor Format"
+   depends on ARM
select IOMMU_IO_PGTABLE
help
  Enable support for the ARM long descriptor pagetable format.
-- 
2.1.4

--
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 linux-next] iommu: Enable LPAE pagetable on ARM only

2015-02-22 Thread Vincent Stehlé
LPAE iommu page table makes sense only for ARM architecture. Add the
corresponding dependency in Kconfig.

This fixes the following runtime warnings on PA-RISC architecture:

  WARNING: at drivers/iommu/io-pgtable-arm.c:413
  Modules linked in:
  CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.19.0-next-20150222-2-gc420256 
#2
  task: 17ca ti: 17ca8000 task.ti: 17ca8000
  
   YZrvWESTHLNXBCVMcbcbcbcbOGFRQPDI
  PSW: 0100 Not tainted
  r00-03  0004ff0f 001b 104871b0 17ca83c0
  r04-07  1000   
  r08-11   40001000 1013b36c 17ca8248
  r12-15  0080 17e712c0  17c5e100
  r16-19  000c 105d8eb0 40001000 
  r20-23   00800020 1048717c 
  r24-27  1000  0009 10774ce0
  r28-31   0027 17ca8480 10486d44
  sr00-03     
  sr04-07     
  
  IASQ:   IAOQ: 10486df4 10486df8
   IIR: 03ffe01fISR:   IOR: 17c86e54
   CPU:0   CR30: 17ca8000 CR31: 0002
   ORIG_R28: 0001
   IAOQ[0]: __arm_lpae_unmap+0x144/0x4cc
   IAOQ[1]: __arm_lpae_unmap+0x148/0x4cc
   RP(r2): arm_lpae_unmap+0x34/0x6c
  Backtrace:
   [104871b0] arm_lpae_unmap+0x34/0x6c
   [10127944] 0x10127944
   [10168ee0] do_one_initcall+0x128/0x1dc
   [101028fc] 0x101028fc
   [10161b48] kernel_init+0x1c/0x118
   [1015d01c] end_fault_vector+0x1c/0x24
   [101762ec] save_stack_trace+0x28/0x60

Signed-off-by: Vincent Stehlé vincent.ste...@laposte.net
Cc: Laurent Pinchart laurent.pinch...@ideasonboard.com
Cc: Will Deacon will.dea...@arm.com
---


Hi,

This can be seen with e.g. Linux next-20150222 on parisc with allmodconfig.

Best regards,

V.


 drivers/iommu/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig
index baa0d97..c73fd72 100644
--- a/drivers/iommu/Kconfig
+++ b/drivers/iommu/Kconfig
@@ -22,6 +22,7 @@ config IOMMU_IO_PGTABLE
 
 config IOMMU_IO_PGTABLE_LPAE
bool ARMv7/v8 Long Descriptor Format
+   depends on ARM
select IOMMU_IO_PGTABLE
help
  Enable support for the ARM long descriptor pagetable format.
-- 
2.1.4

--
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] ASoC: max98357a: Fix missing include

2015-02-11 Thread Vincent Stehlé
This fixes the following compilation errors:

  sound/soc/codecs/max98357a.c: In function ‘max98357a_daiops_trigger’:
  sound/soc/codecs/max98357a.c:30:3: error: implicit declaration of function 
‘gpiod_set_value’ [-Werror=implicit-function-declaration]
  sound/soc/codecs/max98357a.c: In function ‘max98357a_codec_probe’:
  sound/soc/codecs/max98357a.c:55:2: error: implicit declaration of function 
‘devm_gpiod_get’ [-Werror=implicit-function-declaration]
  sound/soc/codecs/max98357a.c:61:2: error: implicit declaration of function 
‘gpiod_direction_output’ [-Werror=implicit-function-declaration]
  cc1: some warnings being treated as errors

Signed-off-by: Vincent Stehlé 
Cc: Kenneth Westfield 
Cc: Mark Brown 
---


Hi,

Those compilation errors can be seen for example with hppa allmodconfig.

Best regards,

V.


 sound/soc/codecs/max98357a.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/soc/codecs/max98357a.c b/sound/soc/codecs/max98357a.c
index 1806333..f493fb6 100644
--- a/sound/soc/codecs/max98357a.c
+++ b/sound/soc/codecs/max98357a.c
@@ -14,6 +14,7 @@
 
 #include 
 #include 
+#include 
 #include 
 
 #define DRV_NAME "max98357a"
-- 
2.1.4

--
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] ASoC: max98357a: Fix missing include

2015-02-11 Thread Vincent Stehlé
This fixes the following compilation errors:

  sound/soc/codecs/max98357a.c: In function ‘max98357a_daiops_trigger’:
  sound/soc/codecs/max98357a.c:30:3: error: implicit declaration of function 
‘gpiod_set_value’ [-Werror=implicit-function-declaration]
  sound/soc/codecs/max98357a.c: In function ‘max98357a_codec_probe’:
  sound/soc/codecs/max98357a.c:55:2: error: implicit declaration of function 
‘devm_gpiod_get’ [-Werror=implicit-function-declaration]
  sound/soc/codecs/max98357a.c:61:2: error: implicit declaration of function 
‘gpiod_direction_output’ [-Werror=implicit-function-declaration]
  cc1: some warnings being treated as errors

Signed-off-by: Vincent Stehlé vincent.ste...@laposte.net
Cc: Kenneth Westfield kwest...@codeaurora.org
Cc: Mark Brown broo...@kernel.org
---


Hi,

Those compilation errors can be seen for example with hppa allmodconfig.

Best regards,

V.


 sound/soc/codecs/max98357a.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/soc/codecs/max98357a.c b/sound/soc/codecs/max98357a.c
index 1806333..f493fb6 100644
--- a/sound/soc/codecs/max98357a.c
+++ b/sound/soc/codecs/max98357a.c
@@ -14,6 +14,7 @@
 
 #include linux/module.h
 #include linux/gpio.h
+#include linux/gpio/consumer.h
 #include sound/soc.h
 
 #define DRV_NAME max98357a
-- 
2.1.4

--
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: Linux next: boot on Wandboard broken by gic related change

2014-12-02 Thread Vincent Stehlé
On 12/02/2014 01:11 AM, Fabio Estevam wrote:
(..)
> Marc fixed this problem with these patches:
> http://www.spinics.net/lists/arm-kernel/msg382778.html
> and
> http://www.spinics.net/lists/arm-kernel/msg382802.html

Ah! Thanks for pointing that out.

You are right, those two patches repair next-20141201 for me.

Best regards,

V.

--
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: Linux next: boot on Wandboard broken by gic related change

2014-12-02 Thread Vincent Stehlé
On 12/02/2014 01:11 AM, Fabio Estevam wrote:
(..)
 Marc fixed this problem with these patches:
 http://www.spinics.net/lists/arm-kernel/msg382778.html
 and
 http://www.spinics.net/lists/arm-kernel/msg382802.html

Ah! Thanks for pointing that out.

You are right, those two patches repair next-20141201 for me.

Best regards,

V.

--
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 linux-next] clk-gpio-gate: include gpio/consumer to fix build

2014-09-30 Thread Vincent Stehlé
This fixes the following build error:

  drivers/clk/clk-gpio-gate.c: In function ‘clk_gpio_gate_enable’:
  drivers/clk/clk-gpio-gate.c:36:2: error: implicit declaration of function 
‘gpiod_set_value’ [-Werror=implicit-function-declaration]
  drivers/clk/clk-gpio-gate.c: In function ‘clk_gpio_gate_is_enabled’:
  drivers/clk/clk-gpio-gate.c:52:2: error: implicit declaration of function 
‘gpiod_get_value’ [-Werror=implicit-function-declaration]
  drivers/clk/clk-gpio-gate.c: In function ‘clk_register_gpio_gate’:
  drivers/clk/clk-gpio-gate.c:79:2: error: implicit declaration of function 
‘gpiod_is_active_low’ [-Werror=implicit-function-declaration]
  drivers/clk/clk-gpio-gate.c:85:3: error: implicit declaration of function 
‘desc_to_gpio’ [-Werror=implicit-function-declaration]
  drivers/clk/clk-gpio-gate.c:125:2: error: implicit declaration of function 
‘gpiod_put’ [-Werror=implicit-function-declaration]
  drivers/clk/clk-gpio-gate.c: In function 
‘of_clk_gpio_gate_delayed_register_get’:
  drivers/clk/clk-gpio-gate.c:169:2: error: implicit declaration of function 
‘gpio_to_desc’ [-Werror=implicit-function-declaration]

Signed-off-by: Vincent Stehlé 
Cc: Jyri Sarha 
Cc: Mike Turquette 
---

Hi,

This can be seen with e.g. linux next-20140930 and arm alldefconfig.

Best regards,

V.

 drivers/clk/clk-gpio-gate.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/clk/clk-gpio-gate.c b/drivers/clk/clk-gpio-gate.c
index 9dde885..08e4322 100644
--- a/drivers/clk/clk-gpio-gate.c
+++ b/drivers/clk/clk-gpio-gate.c
@@ -13,6 +13,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
-- 
2.1.0

--
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 linux-next] clk-gpio-gate: include gpio/consumer to fix build

2014-09-30 Thread Vincent Stehlé
This fixes the following build error:

  drivers/clk/clk-gpio-gate.c: In function ‘clk_gpio_gate_enable’:
  drivers/clk/clk-gpio-gate.c:36:2: error: implicit declaration of function 
‘gpiod_set_value’ [-Werror=implicit-function-declaration]
  drivers/clk/clk-gpio-gate.c: In function ‘clk_gpio_gate_is_enabled’:
  drivers/clk/clk-gpio-gate.c:52:2: error: implicit declaration of function 
‘gpiod_get_value’ [-Werror=implicit-function-declaration]
  drivers/clk/clk-gpio-gate.c: In function ‘clk_register_gpio_gate’:
  drivers/clk/clk-gpio-gate.c:79:2: error: implicit declaration of function 
‘gpiod_is_active_low’ [-Werror=implicit-function-declaration]
  drivers/clk/clk-gpio-gate.c:85:3: error: implicit declaration of function 
‘desc_to_gpio’ [-Werror=implicit-function-declaration]
  drivers/clk/clk-gpio-gate.c:125:2: error: implicit declaration of function 
‘gpiod_put’ [-Werror=implicit-function-declaration]
  drivers/clk/clk-gpio-gate.c: In function 
‘of_clk_gpio_gate_delayed_register_get’:
  drivers/clk/clk-gpio-gate.c:169:2: error: implicit declaration of function 
‘gpio_to_desc’ [-Werror=implicit-function-declaration]

Signed-off-by: Vincent Stehlé vincent.ste...@laposte.net
Cc: Jyri Sarha jsa...@ti.com
Cc: Mike Turquette mturque...@linaro.org
---

Hi,

This can be seen with e.g. linux next-20140930 and arm alldefconfig.

Best regards,

V.

 drivers/clk/clk-gpio-gate.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/clk/clk-gpio-gate.c b/drivers/clk/clk-gpio-gate.c
index 9dde885..08e4322 100644
--- a/drivers/clk/clk-gpio-gate.c
+++ b/drivers/clk/clk-gpio-gate.c
@@ -13,6 +13,7 @@
 #include linux/module.h
 #include linux/slab.h
 #include linux/gpio.h
+#include linux/gpio/consumer.h
 #include linux/of_gpio.h
 #include linux/err.h
 #include linux/device.h
-- 
2.1.0

--
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/


[tip:irq/urgent] irq: Export handle_fasteoi_irq

2014-08-25 Thread tip-bot for Vincent Stehlé
Commit-ID:  7cad45eea3849faeb34591b60d16b50d13a38d77
Gitweb: http://git.kernel.org/tip/7cad45eea3849faeb34591b60d16b50d13a38d77
Author: Vincent Stehlé 
AuthorDate: Fri, 22 Aug 2014 01:31:20 +0200
Committer:  Thomas Gleixner 
CommitDate: Mon, 25 Aug 2014 21:13:30 +0200

irq: Export handle_fasteoi_irq

Export handle_fasteoi_irq to be able to use it in e.g. the Zynq gpio driver
since commit 6dd859508336 ("gpio: zynq: Fix IRQ handlers").

This fixes the following link issue:

  ERROR: "handle_fasteoi_irq" [drivers/gpio/gpio-zynq.ko] undefined!

Signed-off-by: Vincent Stehlé 
Acked-by: Arnd Bergmann 
Cc: linux-arm-ker...@lists.infradead.org
Cc: Vincent Stehle 
Cc: Lars-Peter Clausen 
Cc: Linus Walleij 
Link: 
http://lkml.kernel.org/r/1408663880-29179-1-git-send-email-vincent.ste...@laposte.net
Signed-off-by: Thomas Gleixner 
---
 kernel/irq/chip.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
index a2b28a2..6223fab 100644
--- a/kernel/irq/chip.c
+++ b/kernel/irq/chip.c
@@ -517,6 +517,7 @@ out:
chip->irq_eoi(>irq_data);
raw_spin_unlock(>lock);
 }
+EXPORT_SYMBOL_GPL(handle_fasteoi_irq);
 
 /**
  * handle_edge_irq - edge type IRQ handler
--
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/


[tip:irq/urgent] irq: Export handle_fasteoi_irq

2014-08-25 Thread tip-bot for Vincent Stehlé
Commit-ID:  7cad45eea3849faeb34591b60d16b50d13a38d77
Gitweb: http://git.kernel.org/tip/7cad45eea3849faeb34591b60d16b50d13a38d77
Author: Vincent Stehlé vincent.ste...@laposte.net
AuthorDate: Fri, 22 Aug 2014 01:31:20 +0200
Committer:  Thomas Gleixner t...@linutronix.de
CommitDate: Mon, 25 Aug 2014 21:13:30 +0200

irq: Export handle_fasteoi_irq

Export handle_fasteoi_irq to be able to use it in e.g. the Zynq gpio driver
since commit 6dd859508336 (gpio: zynq: Fix IRQ handlers).

This fixes the following link issue:

  ERROR: handle_fasteoi_irq [drivers/gpio/gpio-zynq.ko] undefined!

Signed-off-by: Vincent Stehlé vincent.ste...@laposte.net
Acked-by: Arnd Bergmann a...@arndb.de
Cc: linux-arm-ker...@lists.infradead.org
Cc: Vincent Stehle vincent.ste...@laposte.net
Cc: Lars-Peter Clausen l...@metafoo.de
Cc: Linus Walleij linus.wall...@linaro.org
Link: 
http://lkml.kernel.org/r/1408663880-29179-1-git-send-email-vincent.ste...@laposte.net
Signed-off-by: Thomas Gleixner t...@linutronix.de
---
 kernel/irq/chip.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
index a2b28a2..6223fab 100644
--- a/kernel/irq/chip.c
+++ b/kernel/irq/chip.c
@@ -517,6 +517,7 @@ out:
chip-irq_eoi(desc-irq_data);
raw_spin_unlock(desc-lock);
 }
+EXPORT_SYMBOL_GPL(handle_fasteoi_irq);
 
 /**
  * handle_edge_irq - edge type IRQ handler
--
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 linux-next] irq: export handle_fasteoi_irq

2014-08-21 Thread Vincent Stehlé
Export handle_fasteoi_irq to be able to use it in e.g. the Zynq gpio driver
since commit 6dd859508336 ("gpio: zynq: Fix IRQ handlers").

This fixes the following link issue:

  ERROR: "handle_fasteoi_irq" [drivers/gpio/gpio-zynq.ko] undefined!

Signed-off-by: Vincent Stehlé 
Cc: Thomas Gleixner 
Cc: Lars-Peter Clausen 
Cc: Linus Walleij 
---

Hi,

This can be seen in Linux next-20140822 with e.g. arm allmodconfig.

Zync gpio seems to be the first code to use handle_fasteoi_irq, which can be
compiled as a module.

Best regards,

V.

 kernel/irq/chip.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
index a2b28a2..6223fab 100644
--- a/kernel/irq/chip.c
+++ b/kernel/irq/chip.c
@@ -517,6 +517,7 @@ out:
chip->irq_eoi(>irq_data);
raw_spin_unlock(>lock);
 }
+EXPORT_SYMBOL_GPL(handle_fasteoi_irq);
 
 /**
  * handle_edge_irq - edge type IRQ handler
-- 
2.1.0.rc1

--
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 linux-next] irq: export handle_fasteoi_irq

2014-08-21 Thread Vincent Stehlé
Export handle_fasteoi_irq to be able to use it in e.g. the Zynq gpio driver
since commit 6dd859508336 (gpio: zynq: Fix IRQ handlers).

This fixes the following link issue:

  ERROR: handle_fasteoi_irq [drivers/gpio/gpio-zynq.ko] undefined!

Signed-off-by: Vincent Stehlé vincent.ste...@laposte.net
Cc: Thomas Gleixner t...@linutronix.de
Cc: Lars-Peter Clausen l...@metafoo.de
Cc: Linus Walleij linus.wall...@linaro.org
---

Hi,

This can be seen in Linux next-20140822 with e.g. arm allmodconfig.

Zync gpio seems to be the first code to use handle_fasteoi_irq, which can be
compiled as a module.

Best regards,

V.

 kernel/irq/chip.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
index a2b28a2..6223fab 100644
--- a/kernel/irq/chip.c
+++ b/kernel/irq/chip.c
@@ -517,6 +517,7 @@ out:
chip-irq_eoi(desc-irq_data);
raw_spin_unlock(desc-lock);
 }
+EXPORT_SYMBOL_GPL(handle_fasteoi_irq);
 
 /**
  * handle_edge_irq - edge type IRQ handler
-- 
2.1.0.rc1

--
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] sparc: i8042-sparcio.h: fix unused kbd_res warning

2014-08-19 Thread Vincent Stehlé
kbd_res is used only when CONFIG_PCI is defined; condition its declaration as
well. This fixes the following compilation warning:

  drivers/input/serio/i8042-sparcio.h:20:25: warning: ‘kbd_res’ defined but not 
used [-Wunused-variable]

Signed-off-by: Vincent Stehlé 
Cc: Dmitry Torokhov 
Cc: "David S. Miller" 
---

Hi,

This can be seen with e.g. sparc alldefconfig.

Best regards,

V.

 drivers/input/serio/i8042-sparcio.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/input/serio/i8042-sparcio.h 
b/drivers/input/serio/i8042-sparcio.h
index d6aa4c6..93cb791 100644
--- a/drivers/input/serio/i8042-sparcio.h
+++ b/drivers/input/serio/i8042-sparcio.h
@@ -17,7 +17,6 @@ static int i8042_aux_irq = -1;
 #define I8042_MUX_PHYS_DESC "sparcps2/serio%d"
 
 static void __iomem *kbd_iobase;
-static struct resource *kbd_res;
 
 #define I8042_COMMAND_REG  (kbd_iobase + 0x64UL)
 #define I8042_DATA_REG (kbd_iobase + 0x60UL)
@@ -44,6 +43,8 @@ static inline void i8042_write_command(int val)
 
 #ifdef CONFIG_PCI
 
+static struct resource *kbd_res;
+
 #define OBP_PS2KBD_NAME1   "kb_ps2"
 #define OBP_PS2KBD_NAME2   "keyboard"
 #define OBP_PS2MS_NAME1"kdmouse"
-- 
2.1.0.rc1

--
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] sparc: i8042-sparcio.h: fix unused kbd_res warning

2014-08-19 Thread Vincent Stehlé
kbd_res is used only when CONFIG_PCI is defined; condition its declaration as
well. This fixes the following compilation warning:

  drivers/input/serio/i8042-sparcio.h:20:25: warning: ‘kbd_res’ defined but not 
used [-Wunused-variable]

Signed-off-by: Vincent Stehlé vincent.ste...@laposte.net
Cc: Dmitry Torokhov dmitry.torok...@gmail.com
Cc: David S. Miller da...@davemloft.net
---

Hi,

This can be seen with e.g. sparc alldefconfig.

Best regards,

V.

 drivers/input/serio/i8042-sparcio.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/input/serio/i8042-sparcio.h 
b/drivers/input/serio/i8042-sparcio.h
index d6aa4c6..93cb791 100644
--- a/drivers/input/serio/i8042-sparcio.h
+++ b/drivers/input/serio/i8042-sparcio.h
@@ -17,7 +17,6 @@ static int i8042_aux_irq = -1;
 #define I8042_MUX_PHYS_DESC sparcps2/serio%d
 
 static void __iomem *kbd_iobase;
-static struct resource *kbd_res;
 
 #define I8042_COMMAND_REG  (kbd_iobase + 0x64UL)
 #define I8042_DATA_REG (kbd_iobase + 0x60UL)
@@ -44,6 +43,8 @@ static inline void i8042_write_command(int val)
 
 #ifdef CONFIG_PCI
 
+static struct resource *kbd_res;
+
 #define OBP_PS2KBD_NAME1   kb_ps2
 #define OBP_PS2KBD_NAME2   keyboard
 #define OBP_PS2MS_NAME1kdmouse
-- 
2.1.0.rc1

--
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 linux-next] cifs: remove unused function cifs_oplock_break_wait

2014-07-21 Thread Vincent Stehlé
Commit 743162013d40 ("sched: Remove proliferation of wait_on_bit() action
functions") has removed the call to cifs_oplock_break_wait, making this
function unused; remove it.

This fixes the following compilation warning:

  fs/cifs/misc.c:578:1: warning: ‘cifs_oplock_break_wait’ defined but not used 
[-Wunused-function]

Signed-off-by: Vincent Stehlé 
Cc: Steve French 
---

Hi,

This can be seen with e.g. linux next-20140721 and arm allmodconfig.

Best regards,

V.

 fs/cifs/misc.c | 7 ---
 1 file changed, 7 deletions(-)

diff --git a/fs/cifs/misc.c b/fs/cifs/misc.c
index 9a70792..65c2682 100644
--- a/fs/cifs/misc.c
+++ b/fs/cifs/misc.c
@@ -574,13 +574,6 @@ void cifs_set_oplock_level(struct cifsInodeInfo *cinode, 
__u32 oplock)
cinode->oplock = 0;
 }
 
-static int
-cifs_oplock_break_wait(void *unused)
-{
-   schedule();
-   return signal_pending(current) ? -ERESTARTSYS : 0;
-}
-
 /*
  * We wait for oplock breaks to be processed before we attempt to perform
  * writes.
-- 
2.0.1

--
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 linux-next] cifs: remove unused function cifs_oplock_break_wait

2014-07-21 Thread Vincent Stehlé
Commit 743162013d40 (sched: Remove proliferation of wait_on_bit() action
functions) has removed the call to cifs_oplock_break_wait, making this
function unused; remove it.

This fixes the following compilation warning:

  fs/cifs/misc.c:578:1: warning: ‘cifs_oplock_break_wait’ defined but not used 
[-Wunused-function]

Signed-off-by: Vincent Stehlé vincent.ste...@laposte.net
Cc: Steve French sfre...@samba.org
---

Hi,

This can be seen with e.g. linux next-20140721 and arm allmodconfig.

Best regards,

V.

 fs/cifs/misc.c | 7 ---
 1 file changed, 7 deletions(-)

diff --git a/fs/cifs/misc.c b/fs/cifs/misc.c
index 9a70792..65c2682 100644
--- a/fs/cifs/misc.c
+++ b/fs/cifs/misc.c
@@ -574,13 +574,6 @@ void cifs_set_oplock_level(struct cifsInodeInfo *cinode, 
__u32 oplock)
cinode-oplock = 0;
 }
 
-static int
-cifs_oplock_break_wait(void *unused)
-{
-   schedule();
-   return signal_pending(current) ? -ERESTARTSYS : 0;
-}
-
 /*
  * We wait for oplock breaks to be processed before we attempt to perform
  * writes.
-- 
2.0.1

--
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 linux-next] staging: emxx_udc: replace strict_strtol call

2014-06-28 Thread Vincent Stehlé
Commit 582e9d37a9a3 'include/linux: remove strict_strto* definitions' has
obsoleted the strict_strtol function. Use kstrtol instead.

This fixes the following compilation error:

  drivers/staging/emxx_udc/emxx_udc.c: In function ‘nbu2ss_drv_set_ep_info’:
  drivers/staging/emxx_udc/emxx_udc.c:3287:3: error: implicit declaration of 
function ‘strict_strtol’ [-Werror=implicit-function-declaration]

Signed-off-by: Vincent Stehlé 

Cc: Greg Kroah-Hartman 
Cc: Magnus Damm 
---

Hi,

This compilation error can be seen with e.g. linux next-20140627 and arm
allmodconfig.

Best regards,

V.

 drivers/staging/emxx_udc/emxx_udc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/emxx_udc/emxx_udc.c 
b/drivers/staging/emxx_udc/emxx_udc.c
index ee0094d..b5c1511 100644
--- a/drivers/staging/emxx_udc/emxx_udc.c
+++ b/drivers/staging/emxx_udc/emxx_udc.c
@@ -3285,7 +3285,7 @@ static void __init nbu2ss_drv_set_ep_info(
 
tempbuf[0] = name[2];
tempbuf[1] = '\0';
-   res = strict_strtol(tempbuf, 16, );
+   res = kstrtol(tempbuf, 16, );
 
if (num == 0)
ep->ep.maxpacket = EP0_PACKETSIZE;
-- 
2.0.0

--
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 linux-next] staging: emxx_udc: replace strict_strtol call

2014-06-28 Thread Vincent Stehlé
Commit 582e9d37a9a3 'include/linux: remove strict_strto* definitions' has
obsoleted the strict_strtol function. Use kstrtol instead.

This fixes the following compilation error:

  drivers/staging/emxx_udc/emxx_udc.c: In function ‘nbu2ss_drv_set_ep_info’:
  drivers/staging/emxx_udc/emxx_udc.c:3287:3: error: implicit declaration of 
function ‘strict_strtol’ [-Werror=implicit-function-declaration]

Signed-off-by: Vincent Stehlé vincent.ste...@laposte.net

Cc: Greg Kroah-Hartman gre...@linuxfoundation.org
Cc: Magnus Damm damm+rene...@opensource.se
---

Hi,

This compilation error can be seen with e.g. linux next-20140627 and arm
allmodconfig.

Best regards,

V.

 drivers/staging/emxx_udc/emxx_udc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/emxx_udc/emxx_udc.c 
b/drivers/staging/emxx_udc/emxx_udc.c
index ee0094d..b5c1511 100644
--- a/drivers/staging/emxx_udc/emxx_udc.c
+++ b/drivers/staging/emxx_udc/emxx_udc.c
@@ -3285,7 +3285,7 @@ static void __init nbu2ss_drv_set_ep_info(
 
tempbuf[0] = name[2];
tempbuf[1] = '\0';
-   res = strict_strtol(tempbuf, 16, num);
+   res = kstrtol(tempbuf, 16, num);
 
if (num == 0)
ep-ep.maxpacket = EP0_PACKETSIZE;
-- 
2.0.0

--
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 linux-next] ARM: shmobile: rcar-gen2: update call to dma_contiguous_reserve_area

2014-06-19 Thread Vincent Stehlé
Commit 5ea3b1b2f8ad 'cma: add placement specifier for "cma=" kernel parameter'
adds a new 'fixed' parameter to dma_contiguous_reserve_area(). Update
rcar_gen2_reserve() accordingly.

This fixes the following compilation error:

  arch/arm/mach-shmobile/setup-rcar-gen2.c: In function ‘rcar_gen2_reserve’:
  arch/arm/mach-shmobile/setup-rcar-gen2.c:182:10: error: too few arguments to 
function ‘dma_contiguous_reserve_area’

Signed-off-by: Vincent Stehlé 
Cc: Simon Horman 
Cc: Magnus Damm 
Cc: Russell King 
Cc: Geert Uytterhoeven 
---

Hi,

This can be seen with linux next-20140619 and e.g. arm allmodconfig.

Best regards,

V.

 arch/arm/mach-shmobile/setup-rcar-gen2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-shmobile/setup-rcar-gen2.c 
b/arch/arm/mach-shmobile/setup-rcar-gen2.c
index 73fb2a6..42d5b43 100644
--- a/arch/arm/mach-shmobile/setup-rcar-gen2.c
+++ b/arch/arm/mach-shmobile/setup-rcar-gen2.c
@@ -179,6 +179,6 @@ void __init rcar_gen2_reserve(void)
 #ifdef CONFIG_DMA_CMA
if (mrc.size)
dma_contiguous_reserve_area(mrc.size, mrc.base, 0,
-   _gen2_dma_contiguous);
+   _gen2_dma_contiguous, true);
 #endif
 }
-- 
2.0.0

--
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 linux-next] ARM: shmobile: rcar-gen2: update call to dma_contiguous_reserve_area

2014-06-19 Thread Vincent Stehlé
Commit 5ea3b1b2f8ad 'cma: add placement specifier for cma= kernel parameter'
adds a new 'fixed' parameter to dma_contiguous_reserve_area(). Update
rcar_gen2_reserve() accordingly.

This fixes the following compilation error:

  arch/arm/mach-shmobile/setup-rcar-gen2.c: In function ‘rcar_gen2_reserve’:
  arch/arm/mach-shmobile/setup-rcar-gen2.c:182:10: error: too few arguments to 
function ‘dma_contiguous_reserve_area’

Signed-off-by: Vincent Stehlé vincent.ste...@laposte.net
Cc: Simon Horman ho...@verge.net.au
Cc: Magnus Damm magnus.d...@gmail.com
Cc: Russell King li...@arm.linux.org.uk
Cc: Geert Uytterhoeven geert+rene...@glider.be
---

Hi,

This can be seen with linux next-20140619 and e.g. arm allmodconfig.

Best regards,

V.

 arch/arm/mach-shmobile/setup-rcar-gen2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-shmobile/setup-rcar-gen2.c 
b/arch/arm/mach-shmobile/setup-rcar-gen2.c
index 73fb2a6..42d5b43 100644
--- a/arch/arm/mach-shmobile/setup-rcar-gen2.c
+++ b/arch/arm/mach-shmobile/setup-rcar-gen2.c
@@ -179,6 +179,6 @@ void __init rcar_gen2_reserve(void)
 #ifdef CONFIG_DMA_CMA
if (mrc.size)
dma_contiguous_reserve_area(mrc.size, mrc.base, 0,
-   rcar_gen2_dma_contiguous);
+   rcar_gen2_dma_contiguous, true);
 #endif
 }
-- 
2.0.0

--
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 linux-next] staging: r8192ee: Adapt flush function prototype

2014-06-07 Thread Vincent Stehlé
Commit 77be2c54c5bd 'mac80211: add vif to flush call' modifies the flush
operation prototype. Update r8192ee function accordingly.

This fixes the following compilation warnings:

  drivers/staging/rtl8192ee/core.c: At top level:
  drivers/staging/rtl8192ee/core.c:1599:2: warning: initialization from 
incompatible pointer type [enabled by default]
.flush = rtl_op_flush,
^
  drivers/staging/rtl8192ee/core.c:1599:2: warning: (near initialization for 
‘rtl92e_ops.flush’) [enabled by default]

Signed-off-by: Vincent Stehlé 
Cc: Greg Kroah-Hartman 
Cc: Larry Finger 
---

Hi,

Linux next gives a "heads up" that the flush function of staging driver r8192ee
needs to be adapted soon.

This can be seen with e.g. linux next-20140606 and x86 allmodconfig.

Also, r8192ee would benefit from the following patch:
http://www.spinics.net/lists/linux-driver-devel/msg47690.html

Best regards,

V.

 drivers/staging/rtl8192ee/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8192ee/core.c b/drivers/staging/rtl8192ee/core.c
index 76ea356..7f6accd 100644
--- a/drivers/staging/rtl8192ee/core.c
+++ b/drivers/staging/rtl8192ee/core.c
@@ -322,7 +322,7 @@ static void _rtl_add_wowlan_patterns(struct ieee80211_hw 
*hw,
struct rtl_mac *mac = &(rtlpriv->mac80211);
struct cfg80211_pkt_pattern *patterns = wow->patterns;
struct rtl_wow_pattern rtl_pattern;
-   u8 *pattern_os, *mask_os;
+   const u8 *pattern_os, *mask_os;
u8 mask[MAX_WOL_BIT_MASK_SIZE] = {0};
u8 content[MAX_WOL_PATTERN_SIZE] = {0};
u8 broadcast_addr[6] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
@@ -1561,7 +1561,7 @@ static void rtl_op_rfkill_poll(struct ieee80211_hw *hw)
  * before switch channle or power save, or tx buffer packet
  * maybe send after offchannel or rf sleep, this may cause
  * dis-association by AP */
-static void rtl_op_flush(struct ieee80211_hw *hw,
+static void rtl_op_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
 u32 queues, bool drop)
 {
struct rtl_priv *rtlpriv = rtl_priv(hw);
-- 
2.0.0.rc2

--
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 linux-next] staging: r8192ee: Adapt flush function prototype

2014-06-07 Thread Vincent Stehlé
Commit 77be2c54c5bd 'mac80211: add vif to flush call' modifies the flush
operation prototype. Update r8192ee function accordingly.

This fixes the following compilation warnings:

  drivers/staging/rtl8192ee/core.c: At top level:
  drivers/staging/rtl8192ee/core.c:1599:2: warning: initialization from 
incompatible pointer type [enabled by default]
.flush = rtl_op_flush,
^
  drivers/staging/rtl8192ee/core.c:1599:2: warning: (near initialization for 
‘rtl92e_ops.flush’) [enabled by default]

Signed-off-by: Vincent Stehlé vincent.ste...@laposte.net
Cc: Greg Kroah-Hartman gre...@linuxfoundation.org
Cc: Larry Finger larry.fin...@lwfinger.net
---

Hi,

Linux next gives a heads up that the flush function of staging driver r8192ee
needs to be adapted soon.

This can be seen with e.g. linux next-20140606 and x86 allmodconfig.

Also, r8192ee would benefit from the following patch:
http://www.spinics.net/lists/linux-driver-devel/msg47690.html

Best regards,

V.

 drivers/staging/rtl8192ee/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8192ee/core.c b/drivers/staging/rtl8192ee/core.c
index 76ea356..7f6accd 100644
--- a/drivers/staging/rtl8192ee/core.c
+++ b/drivers/staging/rtl8192ee/core.c
@@ -322,7 +322,7 @@ static void _rtl_add_wowlan_patterns(struct ieee80211_hw 
*hw,
struct rtl_mac *mac = (rtlpriv-mac80211);
struct cfg80211_pkt_pattern *patterns = wow-patterns;
struct rtl_wow_pattern rtl_pattern;
-   u8 *pattern_os, *mask_os;
+   const u8 *pattern_os, *mask_os;
u8 mask[MAX_WOL_BIT_MASK_SIZE] = {0};
u8 content[MAX_WOL_PATTERN_SIZE] = {0};
u8 broadcast_addr[6] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
@@ -1561,7 +1561,7 @@ static void rtl_op_rfkill_poll(struct ieee80211_hw *hw)
  * before switch channle or power save, or tx buffer packet
  * maybe send after offchannel or rf sleep, this may cause
  * dis-association by AP */
-static void rtl_op_flush(struct ieee80211_hw *hw,
+static void rtl_op_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
 u32 queues, bool drop)
 {
struct rtl_priv *rtlpriv = rtl_priv(hw);
-- 
2.0.0.rc2

--
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 linux-next] imx-drm: imx-tve: remove unused variable

2014-05-25 Thread Vincent Stehlé
Commit f9b0e251dfbf 'drm: make mode_valid callback optional' left variable ret
unused; remove it.

This fixes the following compilation warning:

  drivers/staging/imx-drm/imx-tve.c: In function ‘imx_tve_connector_mode_valid’:
  drivers/staging/imx-drm/imx-tve.c:252:6: warning: unused variable ‘ret’ 
[-Wunused-variable]

Signed-off-by: Vincent Stehlé 
Cc: Andrzej Hajda 
Cc: Daniel Vetter 
Cc: Greg Kroah-Hartman 
---

Hi,

This can be seen with e.g. linux next-20140523 and arm allmodconfig.

Best regards,

V.

 drivers/staging/imx-drm/imx-tve.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/imx-drm/imx-tve.c 
b/drivers/staging/imx-drm/imx-tve.c
index 3e8b0a1..4caef2b1 100644
--- a/drivers/staging/imx-drm/imx-tve.c
+++ b/drivers/staging/imx-drm/imx-tve.c
@@ -249,7 +249,6 @@ static int imx_tve_connector_mode_valid(struct 
drm_connector *connector,
 {
struct imx_tve *tve = con_to_tve(connector);
unsigned long rate;
-   int ret;
 
/* pixel clock with 2x oversampling */
rate = clk_round_rate(tve->clk, 2000UL * mode->clock) / 2000;
-- 
2.0.0.rc2

--
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] serial: efm32: add module_exit

2014-05-25 Thread Vincent Stehlé
Add missing specification of efm32_uart_exit as module_exit.

This fixes the following compilation warning:

  drivers/tty/serial/efm32-uart.c:840:123: warning: ‘efm32_uart_exit’ defined 
but not used [-Wunused-function]

Signed-off-by: Vincent Stehlé 
Cc: Uwe Kleine-König 
Cc: Greg Kroah-Hartman 
Cc: Jiri Slaby 
---

Hi,

This can be seen with e.g. arm allmodconfig.

Best regards,

V.

 drivers/tty/serial/efm32-uart.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/tty/serial/efm32-uart.c b/drivers/tty/serial/efm32-uart.c
index c167a71..b373f64 100644
--- a/drivers/tty/serial/efm32-uart.c
+++ b/drivers/tty/serial/efm32-uart.c
@@ -842,6 +842,7 @@ static void __exit efm32_uart_exit(void)
platform_driver_unregister(_uart_driver);
uart_unregister_driver(_uart_reg);
 }
+module_exit(efm32_uart_exit);
 
 MODULE_AUTHOR("Uwe Kleine-Koenig ");
 MODULE_DESCRIPTION("EFM32 UART/USART driver");
-- 
2.0.0.rc2

--
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] serial: efm32: add module_exit

2014-05-25 Thread Vincent Stehlé
Add missing specification of efm32_uart_exit as module_exit.

This fixes the following compilation warning:

  drivers/tty/serial/efm32-uart.c:840:123: warning: ‘efm32_uart_exit’ defined 
but not used [-Wunused-function]

Signed-off-by: Vincent Stehlé vincent.ste...@laposte.net
Cc: Uwe Kleine-König u.kleine-koe...@pengutronix.de
Cc: Greg Kroah-Hartman gre...@suse.de
Cc: Jiri Slaby jsl...@suse.cz
---

Hi,

This can be seen with e.g. arm allmodconfig.

Best regards,

V.

 drivers/tty/serial/efm32-uart.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/tty/serial/efm32-uart.c b/drivers/tty/serial/efm32-uart.c
index c167a71..b373f64 100644
--- a/drivers/tty/serial/efm32-uart.c
+++ b/drivers/tty/serial/efm32-uart.c
@@ -842,6 +842,7 @@ static void __exit efm32_uart_exit(void)
platform_driver_unregister(efm32_uart_driver);
uart_unregister_driver(efm32_uart_reg);
 }
+module_exit(efm32_uart_exit);
 
 MODULE_AUTHOR(Uwe Kleine-Koenig u.kleine-koe...@pengutronix.de);
 MODULE_DESCRIPTION(EFM32 UART/USART driver);
-- 
2.0.0.rc2

--
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 linux-next] imx-drm: imx-tve: remove unused variable

2014-05-25 Thread Vincent Stehlé
Commit f9b0e251dfbf 'drm: make mode_valid callback optional' left variable ret
unused; remove it.

This fixes the following compilation warning:

  drivers/staging/imx-drm/imx-tve.c: In function ‘imx_tve_connector_mode_valid’:
  drivers/staging/imx-drm/imx-tve.c:252:6: warning: unused variable ‘ret’ 
[-Wunused-variable]

Signed-off-by: Vincent Stehlé vincent.ste...@laposte.net
Cc: Andrzej Hajda a.ha...@samsung.com
Cc: Daniel Vetter daniel.vet...@ffwll.ch
Cc: Greg Kroah-Hartman gre...@linuxfoundation.org
---

Hi,

This can be seen with e.g. linux next-20140523 and arm allmodconfig.

Best regards,

V.

 drivers/staging/imx-drm/imx-tve.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/imx-drm/imx-tve.c 
b/drivers/staging/imx-drm/imx-tve.c
index 3e8b0a1..4caef2b1 100644
--- a/drivers/staging/imx-drm/imx-tve.c
+++ b/drivers/staging/imx-drm/imx-tve.c
@@ -249,7 +249,6 @@ static int imx_tve_connector_mode_valid(struct 
drm_connector *connector,
 {
struct imx_tve *tve = con_to_tve(connector);
unsigned long rate;
-   int ret;
 
/* pixel clock with 2x oversampling */
rate = clk_round_rate(tve-clk, 2000UL * mode-clock) / 2000;
-- 
2.0.0.rc2

--
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 linux-next] DRM: Armada: update dma_buf_export use

2014-05-24 Thread Vincent Stehlé
The dma_buf_export function was updated in commit 4bcec44ffaf9 'dma-buf: use
reservation objects' to take a reservation object parameter; update Armada
export method accordingly.

This fixes the following compilation error:

  drivers/gpu/drm/armada/armada_gem.c: In function ‘armada_gem_prime_export’:
  drivers/gpu/drm/armada/armada_gem.c:544:16: error: macro "dma_buf_export" 
requires 5 arguments, but only 4 given

Signed-off-by: Vincent Stehlé 
Cc: Russell King 
Cc: David Airlie 
Cc: Maarten Lankhorst 
Cc: Sumit Semwal 
---

Hi,

This can be seen with e.g. linux next-20140523 and arm allmodconfig.

Best regards,

V.

 drivers/gpu/drm/armada/armada_gem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/armada/armada_gem.c 
b/drivers/gpu/drm/armada/armada_gem.c
index 887816f..7adb0c3 100644
--- a/drivers/gpu/drm/armada/armada_gem.c
+++ b/drivers/gpu/drm/armada/armada_gem.c
@@ -541,7 +541,7 @@ armada_gem_prime_export(struct drm_device *dev, struct 
drm_gem_object *obj,
int flags)
 {
return dma_buf_export(obj, _gem_prime_dmabuf_ops, obj->size,
- O_RDWR);
+ O_RDWR, NULL);
 }
 
 struct drm_gem_object *
-- 
2.0.0.rc2

--
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 linux-next] DRM: Armada: update dma_buf_export use

2014-05-24 Thread Vincent Stehlé
The dma_buf_export function was updated in commit 4bcec44ffaf9 'dma-buf: use
reservation objects' to take a reservation object parameter; update Armada
export method accordingly.

This fixes the following compilation error:

  drivers/gpu/drm/armada/armada_gem.c: In function ‘armada_gem_prime_export’:
  drivers/gpu/drm/armada/armada_gem.c:544:16: error: macro dma_buf_export 
requires 5 arguments, but only 4 given

Signed-off-by: Vincent Stehlé vincent.ste...@laposte.net
Cc: Russell King rmk+ker...@arm.linux.org.uk
Cc: David Airlie airl...@linux.ie
Cc: Maarten Lankhorst maarten.lankho...@canonical.com
Cc: Sumit Semwal sumit.sem...@linaro.org
---

Hi,

This can be seen with e.g. linux next-20140523 and arm allmodconfig.

Best regards,

V.

 drivers/gpu/drm/armada/armada_gem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/armada/armada_gem.c 
b/drivers/gpu/drm/armada/armada_gem.c
index 887816f..7adb0c3 100644
--- a/drivers/gpu/drm/armada/armada_gem.c
+++ b/drivers/gpu/drm/armada/armada_gem.c
@@ -541,7 +541,7 @@ armada_gem_prime_export(struct drm_device *dev, struct 
drm_gem_object *obj,
int flags)
 {
return dma_buf_export(obj, armada_gem_prime_dmabuf_ops, obj-size,
- O_RDWR);
+ O_RDWR, NULL);
 }
 
 struct drm_gem_object *
-- 
2.0.0.rc2

--
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 linux-next] perf: remove unused variable

2014-05-11 Thread Vincent Stehlé
This fixes the following compilation warning:

  kernel/events/core.c: In function ‘perf_event_exit_task_context’:
  kernel/events/core.c:7434:35: warning: unused variable ‘tmp’ 
[-Wunused-variable]

Signed-off-by: Vincent Stehlé 
Cc: Peter Zijlstra 
Cc: Paul Mackerras 
Cc: Ingo Molnar 
Cc: Arnaldo Carvalho de Melo 
---

Hi,

This can be seen with e.g. linux next-20140509 and arm allmodconfig.

Best regards,

V.

 kernel/events/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/events/core.c b/kernel/events/core.c
index 7ab734f..ed50b09 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -7431,7 +7431,7 @@ __perf_event_exit_task(struct perf_event *child_event,
 
 static void perf_event_exit_task_context(struct task_struct *child, int ctxn)
 {
-   struct perf_event *child_event, *tmp;
+   struct perf_event *child_event;
struct perf_event_context *child_ctx;
unsigned long flags;
 
-- 
2.0.0.rc0

--
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] ab8500-fg: Fix use of uninitialized variable in error path

2014-05-11 Thread Vincent Stehlé
Fix the use of an uninitialized variable i as iterator (instead of j) in
function ab8500_fg_sysfs_psy_create_attrs error path.

This fixes the following compilation warning:

  drivers/power/ab8500_fg.c: In function ‘ab8500_fg_probe’:
  drivers/power/ab8500_fg.c:2989:27: warning: ‘i’ may be used uninitialized in 
this function [-Wuninitialized]
  drivers/power/ab8500_fg.c:2972:15: note: ‘i’ was declared here

While at it, remove j and use i instead, to stay consistent with the driver's
coding style, and split line for checkpatch.pl.

Signed-off-by: Vincent Stehlé 
Cc: Dmitry Eremin-Solenikov 
Cc: David Woodhouse 
---

Hi,

This starts from a compilation warning but is most probably a real bug.

This can be seen with e.g. mainline and x86 allyesconfig.

Best regards,

V.

 drivers/power/ab8500_fg.c | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/power/ab8500_fg.c b/drivers/power/ab8500_fg.c
index 3cb4178..fb65ea2 100644
--- a/drivers/power/ab8500_fg.c
+++ b/drivers/power/ab8500_fg.c
@@ -2969,7 +2969,7 @@ static struct device_attribute 
ab8505_fg_sysfs_psy_attrs[] = {
 
 static int ab8500_fg_sysfs_psy_create_attrs(struct device *dev)
 {
-   unsigned int i, j;
+   unsigned int i;
struct power_supply *psy = dev_get_drvdata(dev);
struct ab8500_fg *di;
 
@@ -2978,14 +2978,15 @@ static int ab8500_fg_sysfs_psy_create_attrs(struct 
device *dev)
if (((is_ab8505(di->parent) || is_ab9540(di->parent)) &&
 abx500_get_chip_id(dev->parent) >= AB8500_CUT2P0)
|| is_ab8540(di->parent)) {
-   for (j = 0; j < ARRAY_SIZE(ab8505_fg_sysfs_psy_attrs); j++)
-   if (device_create_file(dev, 
_fg_sysfs_psy_attrs[j]))
+   for (i = 0; i < ARRAY_SIZE(ab8505_fg_sysfs_psy_attrs); i++)
+   if (device_create_file(dev,
+   _fg_sysfs_psy_attrs[i]))
goto sysfs_psy_create_attrs_failed_ab8505;
}
return 0;
 sysfs_psy_create_attrs_failed_ab8505:
dev_err(dev, "Failed creating sysfs psy attrs for ab8505.\n");
-   while (j--)
+   while (i--)
device_remove_file(dev, _fg_sysfs_psy_attrs[i]);
 
return -EIO;
-- 
2.0.0.rc0

--
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] ab8500-fg: Fix use of uninitialized variable in error path

2014-05-11 Thread Vincent Stehlé
Fix the use of an uninitialized variable i as iterator (instead of j) in
function ab8500_fg_sysfs_psy_create_attrs error path.

This fixes the following compilation warning:

  drivers/power/ab8500_fg.c: In function ‘ab8500_fg_probe’:
  drivers/power/ab8500_fg.c:2989:27: warning: ‘i’ may be used uninitialized in 
this function [-Wuninitialized]
  drivers/power/ab8500_fg.c:2972:15: note: ‘i’ was declared here

While at it, remove j and use i instead, to stay consistent with the driver's
coding style, and split line for checkpatch.pl.

Signed-off-by: Vincent Stehlé vincent.ste...@laposte.net
Cc: Dmitry Eremin-Solenikov dbarysh...@gmail.com
Cc: David Woodhouse dw...@infradead.org
---

Hi,

This starts from a compilation warning but is most probably a real bug.

This can be seen with e.g. mainline and x86 allyesconfig.

Best regards,

V.

 drivers/power/ab8500_fg.c | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/power/ab8500_fg.c b/drivers/power/ab8500_fg.c
index 3cb4178..fb65ea2 100644
--- a/drivers/power/ab8500_fg.c
+++ b/drivers/power/ab8500_fg.c
@@ -2969,7 +2969,7 @@ static struct device_attribute 
ab8505_fg_sysfs_psy_attrs[] = {
 
 static int ab8500_fg_sysfs_psy_create_attrs(struct device *dev)
 {
-   unsigned int i, j;
+   unsigned int i;
struct power_supply *psy = dev_get_drvdata(dev);
struct ab8500_fg *di;
 
@@ -2978,14 +2978,15 @@ static int ab8500_fg_sysfs_psy_create_attrs(struct 
device *dev)
if (((is_ab8505(di-parent) || is_ab9540(di-parent)) 
 abx500_get_chip_id(dev-parent) = AB8500_CUT2P0)
|| is_ab8540(di-parent)) {
-   for (j = 0; j  ARRAY_SIZE(ab8505_fg_sysfs_psy_attrs); j++)
-   if (device_create_file(dev, 
ab8505_fg_sysfs_psy_attrs[j]))
+   for (i = 0; i  ARRAY_SIZE(ab8505_fg_sysfs_psy_attrs); i++)
+   if (device_create_file(dev,
+   ab8505_fg_sysfs_psy_attrs[i]))
goto sysfs_psy_create_attrs_failed_ab8505;
}
return 0;
 sysfs_psy_create_attrs_failed_ab8505:
dev_err(dev, Failed creating sysfs psy attrs for ab8505.\n);
-   while (j--)
+   while (i--)
device_remove_file(dev, ab8505_fg_sysfs_psy_attrs[i]);
 
return -EIO;
-- 
2.0.0.rc0

--
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 linux-next] perf: remove unused variable

2014-05-11 Thread Vincent Stehlé
This fixes the following compilation warning:

  kernel/events/core.c: In function ‘perf_event_exit_task_context’:
  kernel/events/core.c:7434:35: warning: unused variable ‘tmp’ 
[-Wunused-variable]

Signed-off-by: Vincent Stehlé vincent.ste...@laposte.net
Cc: Peter Zijlstra a.p.zijls...@chello.nl
Cc: Paul Mackerras pau...@samba.org
Cc: Ingo Molnar mi...@redhat.com
Cc: Arnaldo Carvalho de Melo a...@kernel.org
---

Hi,

This can be seen with e.g. linux next-20140509 and arm allmodconfig.

Best regards,

V.

 kernel/events/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/events/core.c b/kernel/events/core.c
index 7ab734f..ed50b09 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -7431,7 +7431,7 @@ __perf_event_exit_task(struct perf_event *child_event,
 
 static void perf_event_exit_task_context(struct task_struct *child, int ctxn)
 {
-   struct perf_event *child_event, *tmp;
+   struct perf_event *child_event;
struct perf_event_context *child_ctx;
unsigned long flags;
 
-- 
2.0.0.rc0

--
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 linux-next] ARM: mvebu: Fix pmsu compilation when ARMv6 is selected

2014-05-06 Thread Vincent Stehlé
When compiling for multiplatform for both ARMv6 and ARMv7, the default compiler
flags are for ARMv6, and we will get:

  /tmp/ccwDEzd0.s: Assembler messages:
  /tmp/ccwDEzd0.s:639: Error: selected processor does not support ARM mode `isb 
'
  /tmp/ccwDEzd0.s:645: Error: selected processor does not support ARM mode `isb 
'
  /tmp/ccwDEzd0.s:646: Error: selected processor does not support ARM mode `dsb 
'
  /tmp/ccwDEzd0.s:695: Error: selected processor does not support ARM mode `isb 
'
  make[1]: *** [arch/arm/mach-mvebu/pmsu.o] Error 1

Fix this in a similar manner than done previously in commit
72533b77d30c2be02672e26b5dde1263d7b4c2be, by specifying ARMv7 flags for pmsu.o.

Signed-off-by: Vincent Stehlé 
Cc: Jason Cooper 
Cc: Andrew Lunn 
Cc: Gregory Clement 
Cc: Sebastian Hesselbarth 
Cc: Russell King 
---

Hi,

This build issue can be seen with e.g. Linux next-20140506, ARCH=arm and
allmodconfig.

Best regards,

V.

 arch/arm/mach-mvebu/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-mvebu/Makefile b/arch/arm/mach-mvebu/Makefile
index 854b72a..2ecb828 100644
--- a/arch/arm/mach-mvebu/Makefile
+++ b/arch/arm/mach-mvebu/Makefile
@@ -2,6 +2,7 @@ ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := 
-I$(srctree)/$(src)/include \
-I$(srctree)/arch/arm/plat-orion/include
 
 AFLAGS_coherency_ll.o  := -Wa,-march=armv7-a
+CFLAGS_pmsu.o  := -march=armv7-a
 
 obj-y   += system-controller.o mvebu-soc-id.o
 
-- 
1.9.2

--
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 linux-next] ARM: mvebu: Fix pmsu compilation when ARMv6 is selected

2014-05-06 Thread Vincent Stehlé
When compiling for multiplatform for both ARMv6 and ARMv7, the default compiler
flags are for ARMv6, and we will get:

  /tmp/ccwDEzd0.s: Assembler messages:
  /tmp/ccwDEzd0.s:639: Error: selected processor does not support ARM mode `isb 
'
  /tmp/ccwDEzd0.s:645: Error: selected processor does not support ARM mode `isb 
'
  /tmp/ccwDEzd0.s:646: Error: selected processor does not support ARM mode `dsb 
'
  /tmp/ccwDEzd0.s:695: Error: selected processor does not support ARM mode `isb 
'
  make[1]: *** [arch/arm/mach-mvebu/pmsu.o] Error 1

Fix this in a similar manner than done previously in commit
72533b77d30c2be02672e26b5dde1263d7b4c2be, by specifying ARMv7 flags for pmsu.o.

Signed-off-by: Vincent Stehlé vincent.ste...@laposte.net
Cc: Jason Cooper ja...@lakedaemon.net
Cc: Andrew Lunn and...@lunn.ch
Cc: Gregory Clement gregory.clem...@free-electrons.com
Cc: Sebastian Hesselbarth sebastian.hesselba...@gmail.com
Cc: Russell King li...@arm.linux.org.uk
---

Hi,

This build issue can be seen with e.g. Linux next-20140506, ARCH=arm and
allmodconfig.

Best regards,

V.

 arch/arm/mach-mvebu/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-mvebu/Makefile b/arch/arm/mach-mvebu/Makefile
index 854b72a..2ecb828 100644
--- a/arch/arm/mach-mvebu/Makefile
+++ b/arch/arm/mach-mvebu/Makefile
@@ -2,6 +2,7 @@ ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := 
-I$(srctree)/$(src)/include \
-I$(srctree)/arch/arm/plat-orion/include
 
 AFLAGS_coherency_ll.o  := -Wa,-march=armv7-a
+CFLAGS_pmsu.o  := -march=armv7-a
 
 obj-y   += system-controller.o mvebu-soc-id.o
 
-- 
1.9.2

--
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] cpts: Fix missing includes

2014-04-06 Thread Vincent Stehlé
The ETH_HLEN and VLAN_HLEN definitions are not in if.h any more. Add the
necessary includes to fix the following compilation errors:

  drivers/net/ethernet/ti/cpts.c: In function ‘cpts_match’:
  drivers/net/ethernet/ti/cpts.c:266:12: error: ‘ETH_HLEN’ undeclared (first 
use in this function)
  drivers/net/ethernet/ti/cpts.c:266:12: note: each undeclared identifier is 
reported only once for each function it appears in
  drivers/net/ethernet/ti/cpts.c:276:23: error: ‘VLAN_HLEN’ undeclared (first 
use in this function)

Signed-off-by: Vincent Stehlé 
---


Hi,

This compilation error can be seen with e.g. arm allmodconfig.

Best regards,

V.


 drivers/net/ethernet/ti/cpts.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/ti/cpts.c b/drivers/net/ethernet/ti/cpts.c
index a3bbf59..2a2f82a 100644
--- a/drivers/net/ethernet/ti/cpts.c
+++ b/drivers/net/ethernet/ti/cpts.c
@@ -19,6 +19,8 @@
  */
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
-- 
1.9.1

--
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] cpts: Fix missing includes

2014-04-06 Thread Vincent Stehlé
The ETH_HLEN and VLAN_HLEN definitions are not in if.h any more. Add the
necessary includes to fix the following compilation errors:

  drivers/net/ethernet/ti/cpts.c: In function ‘cpts_match’:
  drivers/net/ethernet/ti/cpts.c:266:12: error: ‘ETH_HLEN’ undeclared (first 
use in this function)
  drivers/net/ethernet/ti/cpts.c:266:12: note: each undeclared identifier is 
reported only once for each function it appears in
  drivers/net/ethernet/ti/cpts.c:276:23: error: ‘VLAN_HLEN’ undeclared (first 
use in this function)

Signed-off-by: Vincent Stehlé vincent.ste...@laposte.net
---


Hi,

This compilation error can be seen with e.g. arm allmodconfig.

Best regards,

V.


 drivers/net/ethernet/ti/cpts.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/ti/cpts.c b/drivers/net/ethernet/ti/cpts.c
index a3bbf59..2a2f82a 100644
--- a/drivers/net/ethernet/ti/cpts.c
+++ b/drivers/net/ethernet/ti/cpts.c
@@ -19,6 +19,8 @@
  */
 #include linux/err.h
 #include linux/if.h
+#include linux/if_ether.h
+#include linux/if_vlan.h
 #include linux/hrtimer.h
 #include linux/module.h
 #include linux/net_tstamp.h
-- 
1.9.1

--
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/


  1   2   >