Skip to contentSkip to conversation

omap3isp cleanups

PATCH In review Sakari Ailus 2 participants 5 messages May 7, 2018 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

cover omap3isp cleanups

Hi,

These patches fix a useless check in ispstat as well as get rid of the GFP_DMA.

Sakari Ailus (2):
omap3isp: Remove useless NULL check in omap3isp_stat_config
omap3isp: Don't use GFP_DMA

 drivers/media/platform/omap3isp/ispstat.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
Signature · 1 line
2.11.0
#1 lore raw

PATCH 1/2 omap3isp: Remove useless NULL check in omap3isp_stat_config

The omap3isp driver checked whether the second argument (the new configuration) to the ISP statistics is NULL. This is the pointer to the user-given argument and is never NULL. Remove the check.

---
 drivers/media/platform/omap3isp/ispstat.c | 6 ------
 1 file changed, 6 deletions(-)
drivers/media/platform/omap3isp/ispstat.c +0 -6
index 529cd8fb29b1..34a91125da36 100644
@@ -542,12 +542,6 @@ int omap3isp_stat_config(struct ispstat *stat, void *new_conf)
 	struct ispstat_generic_config *user_cfg = new_conf;
 	u32 buf_size = user_cfg->buf_size;
 
-	if (!new_conf) {
-		dev_dbg(stat->isp->dev, "%s: configuration is NULL\n",
-			stat->subdev.name);
-		return -EINVAL;
-	}
-
 	mutex_lock(&stat->ioctl_lock);
 
 	dev_dbg(stat->isp->dev,
Signature · 1 line
2.11.0
Reviewed-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] omap3isp: Remove useless NULL check in omap3isp_stat_config

Hi Sakari,

Thank you for the patch.

Quoted 7 lines · On Monday, 7 May 2018 15:47:22 EEST Sakari Ailus wrote:

The omap3isp driver checked whether the second argument (the new configuration) to the ISP statistics is NULL. This is the pointer to the user-given argument and is never NULL. Remove the check.

Quoted 22 lines
---
 drivers/media/platform/omap3isp/ispstat.c | 6 ------
 1 file changed, 6 deletions(-)
(quoted diff) +0 -0

b/drivers/media/platform/omap3isp/ispstat.c index
529cd8fb29b1..34a91125da36 100644

drivers/media/platform/omap3isp/ispstat.c +0 -6
@@ -542,12 +542,6 @@ int omap3isp_stat_config(struct ispstat *stat, void
 *new_conf) struct ispstat_generic_config *user_cfg = new_conf;
 	u32 buf_size = user_cfg->buf_size;
 
-	if (!new_conf) {
-		dev_dbg(stat->isp->dev, "%s: configuration is NULL\n",
-			stat->subdev.name);
-		return -EINVAL;
-	}
-
 	mutex_lock(&stat->ioctl_lock);
 
 	dev_dbg(stat->isp->dev,
Signature · 3 lines
Regards,

Laurent Pinchart
#3 lore raw

PATCH 2/2 omap3isp: Don't use GFP_DMA

In reply to Sakari Ailus

The isp stat driver allocates memory for DMA and uses GFP_DMA flag for dev_alloc_coherent. The flag is no longer needed as the DMA mask is used for the purpose. Remove it.

---
 drivers/media/platform/omap3isp/ispstat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/omap3isp/ispstat.c +1 -1
index 34a91125da36..c68562189961 100644
@@ -371,7 +371,7 @@ static int isp_stat_bufs_alloc_one(struct device *dev,
 	int ret;
 
 	buf->virt_addr = dma_alloc_coherent(dev, size, &buf->dma_addr,
-					    GFP_KERNEL | GFP_DMA);
+					    GFP_KERNEL);
 	if (!buf->virt_addr)
 		return -ENOMEM;
 
Signature · 1 line
2.11.0
Reviewed-by on v1 2/2
#4 lore raw

Re: [PATCH 2/2] omap3isp: Don't use GFP_DMA

Hi Sakari,

Thank you for the patch.

Quoted 6 lines · On Monday, 7 May 2018 15:47:23 EEST Sakari Ailus wrote:

The isp stat driver allocates memory for DMA and uses GFP_DMA flag for dev_alloc_coherent. The flag is no longer needed as the DMA mask is used for the purpose. Remove it.

Quoted 17 lines
---
 drivers/media/platform/omap3isp/ispstat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
(quoted diff) +0 -0

b/drivers/media/platform/omap3isp/ispstat.c index
34a91125da36..c68562189961 100644

drivers/media/platform/omap3isp/ispstat.c +1 -1
@@ -371,7 +371,7 @@ static int isp_stat_bufs_alloc_one(struct device *dev,
 	int ret;
 
 	buf->virt_addr = dma_alloc_coherent(dev, size, &buf->dma_addr,
-					    GFP_KERNEL | GFP_DMA);
+					    GFP_KERNEL);
 	if (!buf->virt_addr)
 		return -ENOMEM;
Signature · 3 lines
Regards,

Laurent Pinchart