Skip to contentSkip to conversation

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

PATCH Andy Shevchenko 4 participants 5 messages Oct 29, 2020 – Oct 30, 2020 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw
Quoted 3 lines · Bingbu Cao

Andy, thanks for your patch.

Thanks!

Quoted 10 lines · Andy Shevchenko

Review

Quoted 6 lines
(quoted diff) +2 -3
-	entry[1].second_entry.last_page_available_bytes =
-			(remaining & ~PAGE_MASK) ?
-				(remaining & ~PAGE_MASK) - 1 : PAGE_SIZE - 1;
+	remaining = offset_in_page(remaining);
+	entry[1].second_entry.last_page_available_bytes = (remaining ?: PAGE_SIZE) - 1;

Not really about this change, is there some coding style update? This line obviously over 80 chars, but the latest script did not report warning.

There is a relaxation in the script, but now it's ambiguous with the documentation. I just realized I can rewrite this as:

	remaining = offset_in_page(remaining) ?: PAGE_SIZE;
	entry[1].second_entry.last_page_available_bytes = remaining - 1;

Would it work for you?

Quoted 3 lines
Quoted 3 lines
(quoted diff) +0 -0
 	/* Fill FBPT */
 	remaining = length;
 	i = 0;
Signature · 2 lines
With Best Regards,
Andy Shevchenko
#1 lore raw

Hi Andy,

Quoted 18 lines · Andy Shevchenko
Quoted 3 lines · Bingbu Cao

Andy, thanks for your patch.

Thanks!

Quoted 10 lines · Andy Shevchenko

Review

Quoted 6 lines
(quoted diff) +2 -3
-	entry[1].second_entry.last_page_available_bytes =
-			(remaining & ~PAGE_MASK) ?
-				(remaining & ~PAGE_MASK) - 1 : PAGE_SIZE - 1;
+	remaining = offset_in_page(remaining);
+	entry[1].second_entry.last_page_available_bytes = (remaining ?: PAGE_SIZE) - 1;

Not really about this change, is there some coding style update? This line obviously over 80 chars, but the latest script did not report warning.

Quoted 1 line

There is a relaxation in the script, but now it's ambiguous with the documentation.

This line is over 80 characters. :-o

It's not ambibuous btw.; the documentation says:

The preferred limit on the length of a single line is 80 columns.

I understand that as a preference to stay below that limit. It's not a strict rule. Or... did you mean it didn't say whether this was upper or lower limit? :-)

Quoted 6 lines

I just realized I can rewrite this as:

	remaining = offset_in_page(remaining) ?: PAGE_SIZE;
	entry[1].second_entry.last_page_available_bytes = remaining - 1;

Would it work for you?

Looks good to me.

Signature · 3 lines
Regards,

Sakari Ailus
#2 lore raw
Quoted 2 lines · Sakari Ailus
Quoted 1 line · Andy Shevchenko

On Wed, Oct 28, 2020 at 04:11:05PM +0800, Bingbu Cao wrote:

...

Quoted 8 lines
Quoted 6 lines

I just realized I can rewrite this as:

      remaining = offset_in_page(remaining) ?: PAGE_SIZE;
      entry[1].second_entry.last_page_available_bytes = remaining - 1;

Would it work for you?

Looks good to me.

Have you got v2?

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#3 lore raw
Quoted 9 lines · Andy Shevchenko
Quoted 2 lines · Sakari Ailus
Quoted 1 line · Andy Shevchenko

On Wed, Oct 28, 2020 at 04:11:05PM +0800, Bingbu Cao wrote:

...

Quoted 2 lines
Quoted 2 lines

I just realized I can rewrite this as:

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
      remaining = offset_in_page(remaining) ?: PAGE_SIZE;
      entry[1].second_entry.last_page_available_bytes = remaining - 1;

Would it work for you?

Looks good to me.

Have you got v2?

Yes, in fact. I'll check it tomorrow / some time next week.

Signature · 1 line
Sakari Ailus
#4 lore raw
In reply to Andy Shevchenko
Quoted 18 lines · Andy Shevchenko
Quoted 3 lines · Bingbu Cao

Andy, thanks for your patch.

Thanks!

Quoted 10 lines · Andy Shevchenko

Review

Quoted 6 lines
(quoted diff) +2 -3
-	entry[1].second_entry.last_page_available_bytes =
-			(remaining & ~PAGE_MASK) ?
-				(remaining & ~PAGE_MASK) - 1 : PAGE_SIZE - 1;
+	remaining = offset_in_page(remaining);
+	entry[1].second_entry.last_page_available_bytes = (remaining ?: PAGE_SIZE) - 1;

Not really about this change, is there some coding style update? This line obviously over 80 chars, but the latest script did not report warning.

Quoted 7 lines

There is a relaxation in the script, but now it's ambiguous with the documentation. I just realized I can rewrite this as:

	remaining = offset_in_page(remaining) ?: PAGE_SIZE;
	entry[1].second_entry.last_page_available_bytes = remaining - 1;

Would it work for you?

Yes, looks good for me, thanks.

Quoted 5 lines
Quoted 4 lines
Quoted 4 lines
(quoted diff) +0 -0
 	/* Fill FBPT */
 	remaining = length;
 	i = 0;
Signature · 2 lines
Best regards,
Bingbu Cao