Skip to contentSkip to conversation

i2c: gpio/algo-bit: clean up headers

PATCH Applied Wolfram Sang 3 participants 8 messages Jan 19, 2019 – Feb 5, 2019

Subsystems (2)
lore
Share & tools
lore

Wolfram Sang

author maintainer
#0 lore raw

cover i2c: gpio/algo-bit: clean up headers

I wanted to sort headers in the i2c-gpio driver which produced a compile error. So, I had to fix i2c-algo-bit a little, too. Since there is a dependency between these patches, here is a small series.

Wolfram Sang (3):
i2c: algo-bit: include main i2c header
i2c: algo-bit: convert to SPDX header
i2c: gpio: sort includes

 drivers/i2c/algos/i2c-algo-bit.c | 25 ++++++++-----------------
 drivers/i2c/busses/i2c-gpio.c    | 10 +++++-----
 include/linux/i2c-algo-bit.h     | 33 ++++++++++-----------------------
 3 files changed, 23 insertions(+), 45 deletions(-)
Signature · 1 line
2.11.0
author maintainer
#1 lore raw

PATCH 1/3 i2c: algo-bit: include main i2c header

We are using symbols from it, so we should include it directly. Found after sorting includes in a driver.

---
 include/linux/i2c-algo-bit.h | 2 ++
 1 file changed, 2 insertions(+)
include/linux/i2c-algo-bit.h +2 -0
index 63904ba6887e..d64cebc6e65a 100644
@@ -25,6 +25,8 @@
 #ifndef _LINUX_I2C_ALGO_BIT_H
 #define _LINUX_I2C_ALGO_BIT_H
 
+#include <linux/i2c.h>
+
 /* --- Defines for bit-adapters ---------------------------------------	*/
 /*
  * This struct contains the hw-dependent functions of bit-style adapters to
Signature · 1 line
2.11.0
author maintainer
#3 lore raw

PATCH 2/3 i2c: algo-bit: convert to SPDX header

In reply to Wolfram Sang

And use kernel style for the remaining comments in the header.

---
 drivers/i2c/algos/i2c-algo-bit.c | 25 ++++++++-----------------
 include/linux/i2c-algo-bit.h     | 31 ++++++++-----------------------
 2 files changed, 16 insertions(+), 40 deletions(-)
drivers/i2c/algos/i2c-algo-bit.c +8 -17
index c33dcfb87993..5e5990a83da5 100644
@@ -1,21 +1,12 @@
-/* -------------------------------------------------------------------------
- * i2c-algo-bit.c i2c driver algorithms for bit-shift adapters
- * -------------------------------------------------------------------------
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * i2c-algo-bit.c: i2c driver algorithms for bit-shift adapters
+ *
  *   Copyright (C) 1995-2000 Simon G. Vogl
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
- * ------------------------------------------------------------------------- */
-
-/* With some changes from Frodo Looijaard <[email protected]>, Kyösti Mälkki
-   <[email protected]> and Jean Delvare <[email protected]> */
+ *
+ * With some changes from Frodo Looijaard <[email protected]>, Kyösti Mälkki
+ * <[email protected]> and Jean Delvare <[email protected]>
+ */
 
 #include <linux/kernel.h>
 #include <linux/module.h>
include/linux/i2c-algo-bit.h +8 -23
index d64cebc6e65a..69045df78e2d 100644
@@ -1,26 +1,11 @@
-/* ------------------------------------------------------------------------- */
-/* i2c-algo-bit.h i2c driver algorithms for bit-shift adapters               */
-/* ------------------------------------------------------------------------- */
-/*   Copyright (C) 1995-99 Simon G. Vogl
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-    MA 02110-1301 USA.							     */
-/* ------------------------------------------------------------------------- */
-
-/* With some changes from Kyösti Mälkki <[email protected]> and even
-   Frodo Looijaard <[email protected]> */
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * i2c-algo-bit.h: i2c driver algorithms for bit-shift adapters
+ *
+ *   Copyright (C) 1995-99 Simon G. Vogl
+ * With some changes from Kyösti Mälkki <[email protected]> and even
+ * Frodo Looijaard <[email protected]>
+ */
 
 #ifndef _LINUX_I2C_ALGO_BIT_H
 #define _LINUX_I2C_ALGO_BIT_H
Signature · 1 line
2.11.0
Reviewed-by on v1 2/3
#4 lore raw

Re: [PATCH 2/3] i2c: algo-bit: convert to SPDX header

Quoted 3 lines · Wolfram Sang

And use kernel style for the remaining comments in the header.

Quoted 81 lines
---
 drivers/i2c/algos/i2c-algo-bit.c | 25 ++++++++-----------------
 include/linux/i2c-algo-bit.h     | 31 ++++++++-----------------------
 2 files changed, 16 insertions(+), 40 deletions(-)
drivers/i2c/algos/i2c-algo-bit.c +8 -17
index c33dcfb87993..5e5990a83da5 100644
@@ -1,21 +1,12 @@
-/* -------------------------------------------------------------------------
- * i2c-algo-bit.c i2c driver algorithms for bit-shift adapters
- * -------------------------------------------------------------------------
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * i2c-algo-bit.c: i2c driver algorithms for bit-shift adapters
+ *
  *   Copyright (C) 1995-2000 Simon G. Vogl
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
- * ------------------------------------------------------------------------- */
-
-/* With some changes from Frodo Looijaard <[email protected]>, Kyösti Mälkki
-   <[email protected]> and Jean Delvare <[email protected]> */
+ *
+ * With some changes from Frodo Looijaard <[email protected]>, Kyösti Mälkki
+ * <[email protected]> and Jean Delvare <[email protected]>
+ */
 
 #include <linux/kernel.h>
 #include <linux/module.h>
include/linux/i2c-algo-bit.h +8 -23
index d64cebc6e65a..69045df78e2d 100644
@@ -1,26 +1,11 @@
-/* ------------------------------------------------------------------------- */
-/* i2c-algo-bit.h i2c driver algorithms for bit-shift adapters               */
-/* ------------------------------------------------------------------------- */
-/*   Copyright (C) 1995-99 Simon G. Vogl
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-    MA 02110-1301 USA.							     */
-/* ------------------------------------------------------------------------- */
-
-/* With some changes from Kyösti Mälkki <[email protected]> and even
-   Frodo Looijaard <[email protected]> */
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * i2c-algo-bit.h: i2c driver algorithms for bit-shift adapters
+ *
+ *   Copyright (C) 1995-99 Simon G. Vogl
+ * With some changes from Kyösti Mälkki <[email protected]> and even
+ * Frodo Looijaard <[email protected]>
+ */
 
 #ifndef _LINUX_I2C_ALGO_BIT_H
 #define _LINUX_I2C_ALGO_BIT_H
Signature · 1 line
2.11.0
author maintainer
#5 lore raw

PATCH 3/3 i2c: gpio: sort includes

In reply to Wolfram Sang

Less risk for duplications when adding new ones.

---
 drivers/i2c/busses/i2c-gpio.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/i2c/busses/i2c-gpio.c +5 -5
index b9d43bc2853f..d8205b56f243 100644
@@ -9,15 +9,15 @@
  */
 #include <linux/debugfs.h>
 #include <linux/delay.h>
-#include <linux/i2c.h>
+#include <linux/gpio/consumer.h>
 #include <linux/i2c-algo-bit.h>
-#include <linux/platform_data/i2c-gpio.h>
+#include <linux/i2c.h>
 #include <linux/init.h>
 #include <linux/module.h>
-#include <linux/slab.h>
-#include <linux/platform_device.h>
-#include <linux/gpio/consumer.h>
 #include <linux/of.h>
+#include <linux/platform_data/i2c-gpio.h>
+#include <linux/platform_device.h>
+#include <linux/slab.h>
 
 struct i2c_gpio_private_data {
 	struct gpio_desc *sda;
Signature · 1 line
2.11.0
Reviewed-by on v1 3/3
#6 lore raw

Re: [PATCH 3/3] i2c: gpio: sort includes

Quoted 3 lines · Wolfram Sang

Less risk for duplications when adding new ones.

Quoted 32 lines
---
 drivers/i2c/busses/i2c-gpio.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/i2c/busses/i2c-gpio.c +5 -5
index b9d43bc2853f..d8205b56f243 100644
@@ -9,15 +9,15 @@
  */
 #include <linux/debugfs.h>
 #include <linux/delay.h>
-#include <linux/i2c.h>
+#include <linux/gpio/consumer.h>
 #include <linux/i2c-algo-bit.h>
-#include <linux/platform_data/i2c-gpio.h>
+#include <linux/i2c.h>
 #include <linux/init.h>
 #include <linux/module.h>
-#include <linux/slab.h>
-#include <linux/platform_device.h>
-#include <linux/gpio/consumer.h>
 #include <linux/of.h>
+#include <linux/platform_data/i2c-gpio.h>
+#include <linux/platform_device.h>
+#include <linux/slab.h>
 
 struct i2c_gpio_private_data {
 	struct gpio_desc *sda;
Signature · 1 line
2.11.0
Applied
#7 lore raw
In reply to Wolfram Sang
Quoted 8 lines · Wolfram Sang

I wanted to sort headers in the i2c-gpio driver which produced a compile error. So, I had to fix i2c-algo-bit a little, too. Since there is a dependency between these patches, here is a small series.

Wolfram Sang (3):
i2c: algo-bit: include main i2c header
i2c: algo-bit: convert to SPDX header
i2c: gpio: sort includes

Applied to for-next, thanks!