Commit a25ba102 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Mauro Carvalho Chehab

media: ipu3-cio2: Use macros from mm.h

There are few nice macros in mm.h, some of which we may use here.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: default avatarBingbu Cao <bingbu.cao@intel.com>
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 9463e07d
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/iopoll.h> #include <linux/iopoll.h>
#include <linux/mm.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/pfn.h> #include <linux/pfn.h>
...@@ -194,9 +195,8 @@ static void cio2_fbpt_entry_init_buf(struct cio2_device *cio2, ...@@ -194,9 +195,8 @@ static void cio2_fbpt_entry_init_buf(struct cio2_device *cio2,
* 4095 (PAGE_SIZE - 1) means every single byte in the last page * 4095 (PAGE_SIZE - 1) means every single byte in the last page
* is available for DMA transfer. * is available for DMA transfer.
*/ */
entry[1].second_entry.last_page_available_bytes = remaining = offset_in_page(remaining) ?: PAGE_SIZE;
(remaining & ~PAGE_MASK) ? entry[1].second_entry.last_page_available_bytes = remaining - 1;
(remaining & ~PAGE_MASK) - 1 : PAGE_SIZE - 1;
/* Fill FBPT */ /* Fill FBPT */
remaining = length; remaining = length;
i = 0; i = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment