Skip to contentSkip to conversation

media: i2c: st-vgxy61: Use asm intead of asm-generic

PATCH In review Andy Shevchenko 2 participants 4 messages Jan 3, 2023 – Jan 4, 2023 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 media: i2c: st-vgxy61: Use asm intead of asm-generic

There is no point to specify asm-generic for the unaligned.h. Drop the 'generic' suffix and move the inclusion to be after the non-media linux/* ones.

---
 drivers/media/i2c/st-vgxy61.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/media/i2c/st-vgxy61.c +3 -1
index 826baf4e064d..5dcabee6677d 100644
@@ -5,7 +5,6 @@
  * Copyright (C) 2022 STMicroelectronics SA
  */
 
-#include <asm-generic/unaligned.h>
 #include <linux/clk.h>
 #include <linux/delay.h>
 #include <linux/gpio/consumer.h>
@@ -15,6 +14,9 @@
 #include <linux/pm_runtime.h>
 #include <linux/regulator/consumer.h>
 #include <linux/units.h>
+
+#include <asm/unaligned.h>
+
 #include <media/mipi-csi2.h>
 #include <media/v4l2-async.h>
 #include <media/v4l2-ctrls.h>
Signature · 1 line
2.35.1
#1 lore raw

Hi Andy,

Thank you for your patch.

Quoted 23 lines · Andy Shevchenko

There is no point to specify asm-generic for the unaligned.h. Drop the 'generic' suffix and move the inclusion to be after the non-media linux/* ones.

---
 drivers/media/i2c/st-vgxy61.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/media/i2c/st-vgxy61.c +0 -1
index 826baf4e064d..5dcabee6677d 100644
@@ -5,7 +5,6 @@
  * Copyright (C) 2022 STMicroelectronics SA
  */
 
-#include <asm-generic/unaligned.h>
 #include <linux/clk.h>
 #include <linux/delay.h>
 #include <linux/gpio/consumer.h>

drivers/media/i2c/st-vgxy61.c line 19

Quoted 6 lines
drivers/media/i2c/st-vgxy61.c +3 -0
@@ -15,6 +14,9 @@
 #include <linux/pm_runtime.h>
 #include <linux/regulator/consumer.h>
 #include <linux/units.h>
+
+#include <asm/unaligned.h>
+

Any particular reason not to keep the alphabetical sort ?

Quoted 3 lines
drivers/media/i2c/st-vgxy61.c +0 -0
 #include <media/mipi-csi2.h>
 #include <media/v4l2-async.h>
 #include <media/v4l2-ctrls.h>
Signature · 3 lines
Regards,

Benjamin
#2 lore raw
Quoted 1 line · Benjamin Mugnier

On 1/3/23 15:52, Andy Shevchenko wrote:

...

Quoted 4 lines
Quoted 4 lines

-#include <asm-generic/unaligned.h>
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/gpio/consumer.h>

Quoted 8 lines

drivers/media/i2c/st-vgxy61.c line 18

Quoted 6 lines
drivers/media/i2c/st-vgxy61.c +2 -0
@@ -15,6 +14,9 @@
 #include <linux/pm_runtime.h>
 #include <linux/regulator/consumer.h>
 #include <linux/units.h>
+
+#include <asm/unaligned.h>

Any particular reason not to keep the alphabetical sort ?

It's kept in an order in each of the groups of headers.

The main rule here is to go from most generic headers to the particular ones. asm/* are definitely more particular than linux/* ones.

Quoted 3 lines
Quoted 3 lines
drivers/media/i2c/st-vgxy61.c +0 -0
 #include <media/mipi-csi2.h>
 #include <media/v4l2-async.h>
 #include <media/v4l2-ctrls.h>
Signature · 2 lines
With Best Regards,
Andy Shevchenko
Reviewed-by
#3 lore raw
Quoted 18 lines · Andy Shevchenko
Quoted 1 line · Benjamin Mugnier

On 1/3/23 15:52, Andy Shevchenko wrote:

...

Quoted 4 lines
Quoted 4 lines

-#include <asm-generic/unaligned.h>
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/gpio/consumer.h>

Quoted 8 lines

drivers/media/i2c/st-vgxy61.c line 18

Quoted 6 lines
drivers/media/i2c/st-vgxy61.c +2 -0
@@ -15,6 +14,9 @@
 #include <linux/pm_runtime.h>
 #include <linux/regulator/consumer.h>
 #include <linux/units.h>
+
+#include <asm/unaligned.h>

Any particular reason not to keep the alphabetical sort ?

Quoted 5 lines

It's kept in an order in each of the groups of headers.

The main rule here is to go from most generic headers to the particular ones. asm/* are definitely more particular than linux/* ones.

Thank you for your explanation.

Quoted 4 lines
Quoted 3 lines
Quoted 3 lines
drivers/media/i2c/st-vgxy61.c +0 -0
 #include <media/mipi-csi2.h>
 #include <media/v4l2-async.h>
 #include <media/v4l2-ctrls.h>
Signature · 3 lines
Regards,

Benjamin