linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [media] tw686x: add a missing newline when printing parameter 'dma_mode'
@ 2020-05-11  8:43 Xiongfeng Wang
  2020-05-13 19:32 ` Ezequiel Garcia
  0 siblings, 1 reply; 4+ messages in thread
From: Xiongfeng Wang @ 2020-05-11  8:43 UTC (permalink / raw)
  To: ezequiel, mchehab; +Cc: linux-media, linux-kernel, wangxiongfeng2

When I cat module parameter 'dma_mode' by sysfs, it displays as follows.
It is better to add a newline for easy reading.

[root@hulk-202 ~]# cat /sys/module/tw686x/parameters/dma_mode
memcpy[root@hulk-202 ~]#

Signed-off-by: Xiongfeng Wang <wangxiongfeng2@huawei.com>
---
 drivers/media/pci/tw686x/tw686x-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/pci/tw686x/tw686x-core.c b/drivers/media/pci/tw686x/tw686x-core.c
index 74ae4f0..bfc61da 100644
--- a/drivers/media/pci/tw686x/tw686x-core.c
+++ b/drivers/media/pci/tw686x/tw686x-core.c
@@ -71,7 +71,7 @@ static const char *dma_mode_name(unsigned int mode)
 
 static int tw686x_dma_mode_get(char *buffer, const struct kernel_param *kp)
 {
-	return sprintf(buffer, "%s", dma_mode_name(dma_mode));
+	return sprintf(buffer, "%s\n", dma_mode_name(dma_mode));
 }
 
 static int tw686x_dma_mode_set(const char *val, const struct kernel_param *kp)
-- 
1.7.12.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] [media] tw686x: add a missing newline when printing parameter 'dma_mode'
  2020-05-11  8:43 [PATCH] [media] tw686x: add a missing newline when printing parameter 'dma_mode' Xiongfeng Wang
@ 2020-05-13 19:32 ` Ezequiel Garcia
  2020-05-14  1:32   ` Xiongfeng Wang
  0 siblings, 1 reply; 4+ messages in thread
From: Ezequiel Garcia @ 2020-05-13 19:32 UTC (permalink / raw)
  To: Xiongfeng Wang
  Cc: Mauro Carvalho Chehab, linux-media, Linux Kernel Mailing List

On Mon, 11 May 2020 at 05:49, Xiongfeng Wang <wangxiongfeng2@huawei.com> wrote:
>
> When I cat module parameter 'dma_mode' by sysfs, it displays as follows.
> It is better to add a newline for easy reading.
>
> [root@hulk-202 ~]# cat /sys/module/tw686x/parameters/dma_mode
> memcpy[root@hulk-202 ~]#
>
> Signed-off-by: Xiongfeng Wang <wangxiongfeng2@huawei.com>

I don't mind this change, but I don't think this is standard.
The lack of newline follows what other drivers are doing.

# hexdump -c /sys/module/acpi/parameters/ec_event_clearing
0000000   q   u   e   r   y
0000005

Is it really an issue for you?

Thanks,
Ezequiel

> ---
>  drivers/media/pci/tw686x/tw686x-core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/media/pci/tw686x/tw686x-core.c b/drivers/media/pci/tw686x/tw686x-core.c
> index 74ae4f0..bfc61da 100644
> --- a/drivers/media/pci/tw686x/tw686x-core.c
> +++ b/drivers/media/pci/tw686x/tw686x-core.c
> @@ -71,7 +71,7 @@ static const char *dma_mode_name(unsigned int mode)
>
>  static int tw686x_dma_mode_get(char *buffer, const struct kernel_param *kp)
>  {
> -       return sprintf(buffer, "%s", dma_mode_name(dma_mode));
> +       return sprintf(buffer, "%s\n", dma_mode_name(dma_mode));
>  }
>
>  static int tw686x_dma_mode_set(const char *val, const struct kernel_param *kp)
> --
> 1.7.12.4
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] [media] tw686x: add a missing newline when printing parameter 'dma_mode'
  2020-05-13 19:32 ` Ezequiel Garcia
@ 2020-05-14  1:32   ` Xiongfeng Wang
  2020-05-14 12:54     ` Ezequiel Garcia
  0 siblings, 1 reply; 4+ messages in thread
From: Xiongfeng Wang @ 2020-05-14  1:32 UTC (permalink / raw)
  To: Ezequiel Garcia
  Cc: Mauro Carvalho Chehab, linux-media, Linux Kernel Mailing List

Hi Ezequiel,

Thanks for your reply !

On 2020/5/14 3:32, Ezequiel Garcia wrote:
> On Mon, 11 May 2020 at 05:49, Xiongfeng Wang <wangxiongfeng2@huawei.com> wrote:
>>
>> When I cat module parameter 'dma_mode' by sysfs, it displays as follows.
>> It is better to add a newline for easy reading.
>>
>> [root@hulk-202 ~]# cat /sys/module/tw686x/parameters/dma_mode
>> memcpy[root@hulk-202 ~]#
>>
>> Signed-off-by: Xiongfeng Wang <wangxiongfeng2@huawei.com>
> 
> I don't mind this change, but I don't think this is standard.
> The lack of newline follows what other drivers are doing.
> 
> # hexdump -c /sys/module/acpi/parameters/ec_event_clearing
> 0000000   q   u   e   r   y
> 0000005
> 
> Is it really an issue for you?

It's not an issue for me. It's just that if the result is in a separate line, it
reads more easily. I am also planning to fix the parameters below
'/sys/module/acpi/parameters'.

Thanks,
Xiongfeng

> 
> Thanks,
> Ezequiel
> 
>> ---
>>  drivers/media/pci/tw686x/tw686x-core.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/media/pci/tw686x/tw686x-core.c b/drivers/media/pci/tw686x/tw686x-core.c
>> index 74ae4f0..bfc61da 100644
>> --- a/drivers/media/pci/tw686x/tw686x-core.c
>> +++ b/drivers/media/pci/tw686x/tw686x-core.c
>> @@ -71,7 +71,7 @@ static const char *dma_mode_name(unsigned int mode)
>>
>>  static int tw686x_dma_mode_get(char *buffer, const struct kernel_param *kp)
>>  {
>> -       return sprintf(buffer, "%s", dma_mode_name(dma_mode));
>> +       return sprintf(buffer, "%s\n", dma_mode_name(dma_mode));
>>  }
>>
>>  static int tw686x_dma_mode_set(const char *val, const struct kernel_param *kp)
>> --
>> 1.7.12.4
>>
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] [media] tw686x: add a missing newline when printing parameter 'dma_mode'
  2020-05-14  1:32   ` Xiongfeng Wang
@ 2020-05-14 12:54     ` Ezequiel Garcia
  0 siblings, 0 replies; 4+ messages in thread
From: Ezequiel Garcia @ 2020-05-14 12:54 UTC (permalink / raw)
  To: Xiongfeng Wang
  Cc: Mauro Carvalho Chehab, linux-media, Linux Kernel Mailing List

On Wed, 13 May 2020 at 22:32, Xiongfeng Wang <wangxiongfeng2@huawei.com> wrote:
>
> Hi Ezequiel,
>
> Thanks for your reply !
>
> On 2020/5/14 3:32, Ezequiel Garcia wrote:
> > On Mon, 11 May 2020 at 05:49, Xiongfeng Wang <wangxiongfeng2@huawei.com> wrote:
> >>
> >> When I cat module parameter 'dma_mode' by sysfs, it displays as follows.
> >> It is better to add a newline for easy reading.
> >>
> >> [root@hulk-202 ~]# cat /sys/module/tw686x/parameters/dma_mode
> >> memcpy[root@hulk-202 ~]#
> >>
> >> Signed-off-by: Xiongfeng Wang <wangxiongfeng2@huawei.com>
> >
> > I don't mind this change, but I don't think this is standard.
> > The lack of newline follows what other drivers are doing.
> >
> > # hexdump -c /sys/module/acpi/parameters/ec_event_clearing
> > 0000000   q   u   e   r   y
> > 0000005
> >
> > Is it really an issue for you?
>
> It's not an issue for me. It's just that if the result is in a separate line, it
> reads more easily. I am also planning to fix the parameters below
> '/sys/module/acpi/parameters'.
>

If you don't have a real reason behind this, such as a documented
expectation or something breaking due to this, but just readability,
then I don't think it's worth going through _all_ the module parameters
fixing this.

While I appreciate your effort, this cleanup exceeds the level
of nitpicking I care for.

Thanks!
Ezequiel

> Thanks,
> Xiongfeng
>
> >
> > Thanks,
> > Ezequiel
> >
> >> ---
> >>  drivers/media/pci/tw686x/tw686x-core.c | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/drivers/media/pci/tw686x/tw686x-core.c b/drivers/media/pci/tw686x/tw686x-core.c
> >> index 74ae4f0..bfc61da 100644
> >> --- a/drivers/media/pci/tw686x/tw686x-core.c
> >> +++ b/drivers/media/pci/tw686x/tw686x-core.c
> >> @@ -71,7 +71,7 @@ static const char *dma_mode_name(unsigned int mode)
> >>
> >>  static int tw686x_dma_mode_get(char *buffer, const struct kernel_param *kp)
> >>  {
> >> -       return sprintf(buffer, "%s", dma_mode_name(dma_mode));
> >> +       return sprintf(buffer, "%s\n", dma_mode_name(dma_mode));
> >>  }
> >>
> >>  static int tw686x_dma_mode_set(const char *val, const struct kernel_param *kp)
> >> --
> >> 1.7.12.4
> >>
> >
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-05-14 12:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-11  8:43 [PATCH] [media] tw686x: add a missing newline when printing parameter 'dma_mode' Xiongfeng Wang
2020-05-13 19:32 ` Ezequiel Garcia
2020-05-14  1:32   ` Xiongfeng Wang
2020-05-14 12:54     ` Ezequiel Garcia

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).