media: ipu3-cio2: Use macros from mm.h
Subsystems (2)
PATCH v2 1/1 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 Andy Shevchenko <[email protected]>
Reviewed-by Bingbu Cao <[email protected]>
---
v2: rewrote to make it short and neat (Bingbu), added Rb tag (Bingbu)
drivers/media/pci/intel/ipu3/ipu3-cio2.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/media/pci/intel/ipu3/ipu3-cio2.c +3 -3
@@ -15,6 +15,7 @@#include <linux/delay.h> #include <linux/interrupt.h> #include <linux/iopoll.h> +#include <linux/mm.h> #include <linux/module.h> #include <linux/pci.h> #include <linux/pfn.h>
@@ -190,9 +191,8 @@ static void cio2_fbpt_entry_init_buf(struct cio2_device *cio2,* 4095 (PAGE_SIZE - 1) means every single byte in the last page * is available for DMA transfer. */ - entry[1 ].second_entry.last_page_available_bytes = - (remaining & ~PAGE_MASK ) ? - (remaining & ~PAGE_MASK ) -1 :PAGE_SIZE -1 ; + remaining =offset_in_page (remaining) ?:PAGE_SIZE ; + entry[1 ].second_entry.last_page_available_bytes = remaining -1 ;/* Fill FBPT */ remaining = length; i =0 ;
Signature · 1 line
2.28.0
Quoted 4 lines · Andy Shevchenko
There are few nice macros in
mm.h, some of which we may use here.Signed-off-by Andy Shevchenko <[email protected]>Reviewed-by Bingbu Cao <[email protected]>
If there is no further comments, can it be applied?
Quoted 32 lines
---
v2: rewrote to make it short and neat (Bingbu), added Rb tag (Bingbu)drivers/media/pci/intel/ipu3/ipu3-cio2.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/media/pci/intel/ipu3/ipu3-cio2.c +3
-3@@ -15,6 +15,7 @@#include <linux/delay.h> #include <linux/interrupt.h> #include <linux/iopoll.h> +#include <linux/mm.h> #include <linux/module.h> #include <linux/pci.h> #include <linux/pfn.h> @@ -190,9 +191,8 @@ static void cio2_fbpt_entry_init_buf(struct cio2_device *cio2,* 4095 (PAGE_SIZE - 1) means every single byte in the last page * is available for DMA transfer. */ - entry[1 ].second_entry.last_page_available_bytes = - (remaining & ~PAGE_MASK ) ? - (remaining & ~PAGE_MASK ) -1 :PAGE_SIZE -1 ; + remaining =offset_in_page (remaining) ?:PAGE_SIZE ; + entry[1 ].second_entry.last_page_available_bytes = remaining -1 ;/* Fill FBPT */ remaining = length; i =0 ;Signature · 1 line
2.28.0
Signature · 2 lines
With Best Regards, Andy Shevchenko
Sakari Ailus
maintainerQuoted 7 lines · Andy Shevchenko
Quoted 4 lines · Andy Shevchenko
There are few nice macros in
mm.h, some of which we may use here.Signed-off-by Andy Shevchenko <[email protected]>Reviewed-by Bingbu Cao <[email protected]>If there is no further comments, can it be applied?
It's in my latest pull request, but not in media tree master yet.
Signature · 1 line
Sakari Ailus