linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1 linux-next] staging: media: atomisp: kmap() can't fail
@ 2017-04-25 18:10 Fabian Frederick
  2017-04-25 18:35 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 2+ messages in thread
From: Fabian Frederick @ 2017-04-25 18:10 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Greg Kroah-Hartman, Alan Cox; +Cc: linux-kernel, fabf

Remove NULL test on kmap()

Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
 drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm.c | 19 ++-----------------
 1 file changed, 2 insertions(+), 17 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm.c b/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm.c
index 151abf0..7d2f8d9 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm.c
@@ -328,15 +328,7 @@ static int load_and_flush_by_kmap(ia_css_ptr virt, void *data, unsigned int byte
 		idx = (virt - bo->start) >> PAGE_SHIFT;
 		offset = (virt - bo->start) - (idx << PAGE_SHIFT);
 
-		src = (char *)kmap(bo->page_obj[idx].page);
-		if (!src) {
-			dev_err(atomisp_dev,
-				    "kmap buffer object page failed: "
-				    "pg_idx = %d\n", idx);
-			return -EINVAL;
-		}
-
-		src += offset;
+		src = (char *)kmap(bo->page_obj[idx].page) + offset;
 
 		if ((bytes + offset) >= PAGE_SIZE) {
 			len = PAGE_SIZE - offset;
@@ -533,14 +525,7 @@ int hmm_set(ia_css_ptr virt, int c, unsigned int bytes)
 		idx = (virt - bo->start) >> PAGE_SHIFT;
 		offset = (virt - bo->start) - (idx << PAGE_SHIFT);
 
-		des = (char *)kmap(bo->page_obj[idx].page);
-		if (!des) {
-			dev_err(atomisp_dev,
-				    "kmap buffer object page failed: "
-				    "pg_idx = %d\n", idx);
-			return -EINVAL;
-		}
-		des += offset;
+		des = (char *)kmap(bo->page_obj[idx].page) + offset;
 
 		if ((bytes + offset) >= PAGE_SIZE) {
 			len = PAGE_SIZE - offset;
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1 linux-next] staging: media: atomisp: kmap() can't fail
  2017-04-25 18:10 [PATCH 1/1 linux-next] staging: media: atomisp: kmap() can't fail Fabian Frederick
@ 2017-04-25 18:35 ` Greg Kroah-Hartman
  0 siblings, 0 replies; 2+ messages in thread
From: Greg Kroah-Hartman @ 2017-04-25 18:35 UTC (permalink / raw)
  To: Fabian Frederick; +Cc: Mauro Carvalho Chehab, Alan Cox, linux-kernel

On Tue, Apr 25, 2017 at 08:10:19PM +0200, Fabian Frederick wrote:
> Remove NULL test on kmap()

That says _what_ you did, which is obvious if you read the patch.  You
need to say _why_ you are doing what you are doing in this patch in the
changelog description.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-04-25 18:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-25 18:10 [PATCH 1/1 linux-next] staging: media: atomisp: kmap() can't fail Fabian Frederick
2017-04-25 18:35 ` Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).