diff mbox

[v4,09/10] arm/uart: Rename dt-uart.c to arm-uart.c

Message ID 1452920477-13916-10-git-send-email-zhaoshenglong@huawei.com (mailing list archive)
State New, archived
Headers show

Commit Message

Shannon Zhao Jan. 16, 2016, 5:01 a.m. UTC
From: Shannon Zhao <shannon.zhao@linaro.org>

Since we will add ACPI initialization for UART in this file later,
rename it with a generic name.

Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
---
v4: split the original patch to renaming this and adding ACPI parts.
---
 MAINTAINERS                 |   2 +-
 xen/drivers/char/Makefile   |   2 +-
 xen/drivers/char/arm-uart.c | 107 ++++++++++++++++++++++++++++++++++++++++++++
 xen/drivers/char/dt-uart.c  | 107 --------------------------------------------
 4 files changed, 109 insertions(+), 109 deletions(-)
 create mode 100644 xen/drivers/char/arm-uart.c
 delete mode 100644 xen/drivers/char/dt-uart.c

Comments

Jan Beulich Jan. 18, 2016, 10:40 a.m. UTC | #1
>>> On 16.01.16 at 06:01, <zhaoshenglong@huawei.com> wrote:
> From: Shannon Zhao <shannon.zhao@linaro.org>
> 
> Since we will add ACPI initialization for UART in this file later,
> rename it with a generic name.
> 
> Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
> ---
> v4: split the original patch to renaming this and adding ACPI parts.
> ---
>  MAINTAINERS                 |   2 +-
>  xen/drivers/char/Makefile   |   2 +-
>  xen/drivers/char/arm-uart.c | 107 ++++++++++++++++++++++++++++++++++++++++++++
>  xen/drivers/char/dt-uart.c  | 107 --------------------------------------------
>  4 files changed, 109 insertions(+), 109 deletions(-)
>  create mode 100644 xen/drivers/char/arm-uart.c
>  delete mode 100644 xen/drivers/char/dt-uart.c

Looks like this really is a rename with little actual changes to
the file, in which case this should be reflected as such in the
presentation of the patch.

Jan
Shannon Zhao Jan. 19, 2016, 3:36 a.m. UTC | #2
On 2016/1/18 18:40, Jan Beulich wrote:
>>>> On 16.01.16 at 06:01, <zhaoshenglong@huawei.com> wrote:
>> > From: Shannon Zhao <shannon.zhao@linaro.org>
>> > 
>> > Since we will add ACPI initialization for UART in this file later,
>> > rename it with a generic name.
>> > 
>> > Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
>> > ---
>> > v4: split the original patch to renaming this and adding ACPI parts.
>> > ---
>> >  MAINTAINERS                 |   2 +-
>> >  xen/drivers/char/Makefile   |   2 +-
>> >  xen/drivers/char/arm-uart.c | 107 ++++++++++++++++++++++++++++++++++++++++++++
>> >  xen/drivers/char/dt-uart.c  | 107 --------------------------------------------
>> >  4 files changed, 109 insertions(+), 109 deletions(-)
>> >  create mode 100644 xen/drivers/char/arm-uart.c
>> >  delete mode 100644 xen/drivers/char/dt-uart.c
> Looks like this really is a rename with little actual changes to
> the file, 
Yes, but the only change to this file is also to change its name because
it's mentioned in the file header. This intends to make that consistent.

+ * xen/drivers/char/arm-uart.c

Thanks,
Jan Beulich Jan. 19, 2016, 8:39 a.m. UTC | #3
>>> On 19.01.16 at 04:36, <zhaoshenglong@huawei.com> wrote:

> 
> On 2016/1/18 18:40, Jan Beulich wrote:
>>>>> On 16.01.16 at 06:01, <zhaoshenglong@huawei.com> wrote:
>>> > From: Shannon Zhao <shannon.zhao@linaro.org>
>>> > 
>>> > Since we will add ACPI initialization for UART in this file later,
>>> > rename it with a generic name.
>>> > 
>>> > Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
>>> > ---
>>> > v4: split the original patch to renaming this and adding ACPI parts.
>>> > ---
>>> >  MAINTAINERS                 |   2 +-
>>> >  xen/drivers/char/Makefile   |   2 +-
>>> >  xen/drivers/char/arm-uart.c | 107 ++++++++++++++++++++++++++++++++++++++++++++
>>> >  xen/drivers/char/dt-uart.c  | 107 --------------------------------------------
>>> >  4 files changed, 109 insertions(+), 109 deletions(-)
>>> >  create mode 100644 xen/drivers/char/arm-uart.c
>>> >  delete mode 100644 xen/drivers/char/dt-uart.c
>> Looks like this really is a rename with little actual changes to
>> the file, 
> Yes, but the only change to this file is also to change its name because
> it's mentioned in the file header. This intends to make that consistent.
> 
> + * xen/drivers/char/arm-uart.c

I understand that, but without using git's ability to represent the
rename such that the diff between the files is visible it is hard to
tell what exactly you changed in the file.

Jan
Shannon Zhao Jan. 19, 2016, 8:43 a.m. UTC | #4
On 2016/1/19 16:39, Jan Beulich wrote:
>>>> On 19.01.16 at 04:36, <zhaoshenglong@huawei.com> wrote:
>> > 
>> > On 2016/1/18 18:40, Jan Beulich wrote:
>>>>>> >>>>> On 16.01.16 at 06:01, <zhaoshenglong@huawei.com> wrote:
>>>>> >>> > From: Shannon Zhao <shannon.zhao@linaro.org>
>>>>> >>> > 
>>>>> >>> > Since we will add ACPI initialization for UART in this file later,
>>>>> >>> > rename it with a generic name.
>>>>> >>> > 
>>>>> >>> > Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
>>>>> >>> > ---
>>>>> >>> > v4: split the original patch to renaming this and adding ACPI parts.
>>>>> >>> > ---
>>>>> >>> >  MAINTAINERS                 |   2 +-
>>>>> >>> >  xen/drivers/char/Makefile   |   2 +-
>>>>> >>> >  xen/drivers/char/arm-uart.c | 107 ++++++++++++++++++++++++++++++++++++++++++++
>>>>> >>> >  xen/drivers/char/dt-uart.c  | 107 --------------------------------------------
>>>>> >>> >  4 files changed, 109 insertions(+), 109 deletions(-)
>>>>> >>> >  create mode 100644 xen/drivers/char/arm-uart.c
>>>>> >>> >  delete mode 100644 xen/drivers/char/dt-uart.c
>>> >> Looks like this really is a rename with little actual changes to
>>> >> the file, 
>> > Yes, but the only change to this file is also to change its name because
>> > it's mentioned in the file header. This intends to make that consistent.
>> > 
>> > + * xen/drivers/char/arm-uart.c
> I understand that, but without using git's ability to represent the
> rename such that the diff between the files is visible it is hard to
> tell what exactly you changed in the file.
Yes, from the git diffstat it's hard to tell the truth. I will add some
words in the commit message.

Thanks,
Jan Beulich Jan. 19, 2016, 8:50 a.m. UTC | #5
>>> On 19.01.16 at 09:43, <zhaoshenglong@huawei.com> wrote:

> 
> On 2016/1/19 16:39, Jan Beulich wrote:
>>>>> On 19.01.16 at 04:36, <zhaoshenglong@huawei.com> wrote:
>>> > 
>>> > On 2016/1/18 18:40, Jan Beulich wrote:
>>>>>>> >>>>> On 16.01.16 at 06:01, <zhaoshenglong@huawei.com> wrote:
>>>>>> >>> > From: Shannon Zhao <shannon.zhao@linaro.org>
>>>>>> >>> > 
>>>>>> >>> > Since we will add ACPI initialization for UART in this file later,
>>>>>> >>> > rename it with a generic name.
>>>>>> >>> > 
>>>>>> >>> > Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
>>>>>> >>> > ---
>>>>>> >>> > v4: split the original patch to renaming this and adding ACPI parts.
>>>>>> >>> > ---
>>>>>> >>> >  MAINTAINERS                 |   2 +-
>>>>>> >>> >  xen/drivers/char/Makefile   |   2 +-
>>>>>> >>> >  xen/drivers/char/arm-uart.c | 107 
> ++++++++++++++++++++++++++++++++++++++++++++
>>>>>> >>> >  xen/drivers/char/dt-uart.c  | 107 --------------------------------------------
>>>>>> >>> >  4 files changed, 109 insertions(+), 109 deletions(-)
>>>>>> >>> >  create mode 100644 xen/drivers/char/arm-uart.c
>>>>>> >>> >  delete mode 100644 xen/drivers/char/dt-uart.c
>>>> >> Looks like this really is a rename with little actual changes to
>>>> >> the file, 
>>> > Yes, but the only change to this file is also to change its name because
>>> > it's mentioned in the file header. This intends to make that consistent.
>>> > 
>>> > + * xen/drivers/char/arm-uart.c
>> I understand that, but without using git's ability to represent the
>> rename such that the diff between the files is visible it is hard to
>> tell what exactly you changed in the file.
> Yes, from the git diffstat it's hard to tell the truth. I will add some
> words in the commit message.

That's not the point; the point is that if you already use git to
create the patch, you should also use the needed option to
make git represent the patch in a way the change-and-rename
gets reflected suitably. If you weren't using git to create the
patch I'd be fine with the actual change(s) just being mentioned
in the commit message.

Jan
diff mbox

Patch

diff --git a/MAINTAINERS b/MAINTAINERS
index 09fe823..5d2b354 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -133,7 +133,7 @@  S:	Supported
 L:	xen-devel@lists.xen.org
 F:	xen/arch/arm/
 F:	xen/include/asm-arm/
-F:	xen/drivers/char/dt-uart.c
+F:	xen/drivers/char/arm-uart.c
 F:	xen/drivers/char/exynos4210-uart.c
 F:	xen/drivers/char/omap-uart.c
 F:	xen/drivers/char/pl011.c
diff --git a/xen/drivers/char/Makefile b/xen/drivers/char/Makefile
index aa620fc..aa169d7 100644
--- a/xen/drivers/char/Makefile
+++ b/xen/drivers/char/Makefile
@@ -6,5 +6,5 @@  obj-$(CONFIG_HAS_EXYNOS4210) += exynos4210-uart.o
 obj-$(CONFIG_HAS_OMAP) += omap-uart.o
 obj-$(CONFIG_HAS_SCIF) += scif-uart.o
 obj-$(CONFIG_HAS_EHCI) += ehci-dbgp.o
-obj-$(CONFIG_ARM) += dt-uart.o
+obj-$(CONFIG_ARM) += arm-uart.o
 obj-y += serial.o
diff --git a/xen/drivers/char/arm-uart.c b/xen/drivers/char/arm-uart.c
new file mode 100644
index 0000000..883e615
--- /dev/null
+++ b/xen/drivers/char/arm-uart.c
@@ -0,0 +1,107 @@ 
+/*
+ * xen/drivers/char/arm-uart.c
+ *
+ * Generic uart retrieved via the device tree
+ *
+ * Julien Grall <julien.grall@linaro.org>
+ * Copyright (c) 2013 Linaro Limited.
+ *
+ * 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.
+ */
+
+#include <asm/device.h>
+#include <asm/types.h>
+#include <xen/console.h>
+#include <xen/device_tree.h>
+#include <xen/serial.h>
+#include <xen/errno.h>
+
+/*
+ * Configure UART port with a string:
+ * path:options
+ *
+ * @path: full path used in the device tree for the UART. If the path
+ * doesn't start with '/', we assuming that it's an alias.
+ * @options: UART speficic options (see in each UART driver)
+ */
+static char __initdata opt_dtuart[256] = "";
+string_param("dtuart", opt_dtuart);
+
+void __init dt_uart_init(void)
+{
+    struct dt_device_node *dev;
+    int ret;
+    const char *devpath = opt_dtuart;
+    char *options;
+
+    if ( !console_has("dtuart") )
+        return; /* Not for us */
+
+    if ( !strcmp(opt_dtuart, "") )
+    {
+        const struct dt_device_node *chosen = dt_find_node_by_path("/chosen");
+
+        if ( chosen )
+        {
+            const char *stdout;
+
+            ret = dt_property_read_string(chosen, "stdout-path", &stdout);
+            if ( ret >= 0 )
+            {
+                printk("Taking dtuart configuration from /chosen/stdout-path\n");
+                if ( strlcpy(opt_dtuart, stdout, sizeof(opt_dtuart))
+                     >= sizeof(opt_dtuart) )
+                    printk("WARNING: /chosen/stdout-path too long, truncated\n");
+            }
+            else if ( ret != -EINVAL /* Not present */ )
+                printk("Failed to read /chosen/stdout-path (%d)\n", ret);
+        }
+    }
+
+    if ( !strcmp(opt_dtuart, "") )
+    {
+        printk("No dtuart path configured\n");
+        return;
+    }
+
+    options = strchr(opt_dtuart, ':');
+    if ( options != NULL )
+        *(options++) = '\0';
+    else
+        options = "";
+
+    printk("Looking for dtuart at \"%s\", options \"%s\"\n", devpath, options);
+    if ( *devpath == '/' )
+        dev = dt_find_node_by_path(devpath);
+    else
+        dev = dt_find_node_by_alias(devpath);
+
+    if ( !dev )
+    {
+        printk("Unable to find device \"%s\"\n", devpath);
+        return;
+    }
+
+    ret = device_init(dev, DEVICE_SERIAL, options);
+
+    if ( ret )
+        printk("Unable to initialize dtuart: %d\n", ret);
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/drivers/char/dt-uart.c b/xen/drivers/char/dt-uart.c
deleted file mode 100644
index d599322..0000000
--- a/xen/drivers/char/dt-uart.c
+++ /dev/null
@@ -1,107 +0,0 @@ 
-/*
- * xen/drivers/char/dt-uart.c
- *
- * Generic uart retrieved via the device tree
- *
- * Julien Grall <julien.grall@linaro.org>
- * Copyright (c) 2013 Linaro Limited.
- *
- * 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.
- */
-
-#include <asm/device.h>
-#include <asm/types.h>
-#include <xen/console.h>
-#include <xen/device_tree.h>
-#include <xen/serial.h>
-#include <xen/errno.h>
-
-/*
- * Configure UART port with a string:
- * path:options
- *
- * @path: full path used in the device tree for the UART. If the path
- * doesn't start with '/', we assuming that it's an alias.
- * @options: UART speficic options (see in each UART driver)
- */
-static char __initdata opt_dtuart[256] = "";
-string_param("dtuart", opt_dtuart);
-
-void __init dt_uart_init(void)
-{
-    struct dt_device_node *dev;
-    int ret;
-    const char *devpath = opt_dtuart;
-    char *options;
-
-    if ( !console_has("dtuart") )
-        return; /* Not for us */
-
-    if ( !strcmp(opt_dtuart, "") )
-    {
-        const struct dt_device_node *chosen = dt_find_node_by_path("/chosen");
-
-        if ( chosen )
-        {
-            const char *stdout;
-
-            ret = dt_property_read_string(chosen, "stdout-path", &stdout);
-            if ( ret >= 0 )
-            {
-                printk("Taking dtuart configuration from /chosen/stdout-path\n");
-                if ( strlcpy(opt_dtuart, stdout, sizeof(opt_dtuart))
-                     >= sizeof(opt_dtuart) )
-                    printk("WARNING: /chosen/stdout-path too long, truncated\n");
-            }
-            else if ( ret != -EINVAL /* Not present */ )
-                printk("Failed to read /chosen/stdout-path (%d)\n", ret);
-        }
-    }
-
-    if ( !strcmp(opt_dtuart, "") )
-    {
-        printk("No dtuart path configured\n");
-        return;
-    }
-
-    options = strchr(opt_dtuart, ':');
-    if ( options != NULL )
-        *(options++) = '\0';
-    else
-        options = "";
-
-    printk("Looking for dtuart at \"%s\", options \"%s\"\n", devpath, options);
-    if ( *devpath == '/' )
-        dev = dt_find_node_by_path(devpath);
-    else
-        dev = dt_find_node_by_alias(devpath);
-
-    if ( !dev )
-    {
-        printk("Unable to find device \"%s\"\n", devpath);
-        return;
-    }
-
-    ret = device_init(dev, DEVICE_SERIAL, options);
-
-    if ( ret )
-        printk("Unable to initialize dtuart: %d\n", ret);
-}
-
-/*
- * Local variables:
- * mode: C
- * c-file-style: "BSD"
- * c-basic-offset: 4
- * tab-width: 4
- * indent-tabs-mode: nil
- * End:
- */