* [PATCH] media/pci: Assign value when defining variables
@ 2021-03-17 3:08 zuoqilin1
2021-03-21 9:19 ` Hans Verkuil
0 siblings, 1 reply; 2+ messages in thread
From: zuoqilin1 @ 2021-03-17 3:08 UTC (permalink / raw)
To: tskd08, mchehab; +Cc: linux-media, linux-kernel, zuoqilin
From: zuoqilin <zuoqilin@yulong.com>
When defining variables and assigning values can be done at the same time.
Signed-off-by: zuoqilin <zuoqilin@yulong.com>
---
drivers/media/pci/pt1/pt1.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/media/pci/pt1/pt1.c b/drivers/media/pci/pt1/pt1.c
index 72b191c..f2aa368 100644
--- a/drivers/media/pci/pt1/pt1.c
+++ b/drivers/media/pci/pt1/pt1.c
@@ -334,8 +334,7 @@ static int pt1_sync(struct pt1 *pt1)
static u64 pt1_identify(struct pt1 *pt1)
{
int i;
- u64 id;
- id = 0;
+ u64 id = 0;
for (i = 0; i < 57; i++) {
id |= (u64)(pt1_read_reg(pt1, 0) >> 30 & 1) << i;
pt1_write_reg(pt1, 0, 0x00000008);
@@ -1122,8 +1121,7 @@ static int pt1_i2c_end(struct pt1 *pt1, int addr)
static void pt1_i2c_begin(struct pt1 *pt1, int *addrp)
{
- int addr;
- addr = 0;
+ int addr = 0;
pt1_i2c_emit(pt1, addr, 0, 0, 1, 1, addr /* itself */);
addr = addr + 1;
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] media/pci: Assign value when defining variables
2021-03-17 3:08 [PATCH] media/pci: Assign value when defining variables zuoqilin1
@ 2021-03-21 9:19 ` Hans Verkuil
0 siblings, 0 replies; 2+ messages in thread
From: Hans Verkuil @ 2021-03-21 9:19 UTC (permalink / raw)
To: zuoqilin1, tskd08, mchehab; +Cc: linux-media, linux-kernel, zuoqilin
Hi zuoqilin,
On 17/03/2021 04:08, zuoqilin1@163.com wrote:
> From: zuoqilin <zuoqilin@yulong.com>
>
> When defining variables and assigning values can be done at the same time.
For future reference: add the name of the driver to the prefix. Saying
'media/pci:' suggests that you patch multiple PCI drivers in that directory.
But 'media/pci/pt1:' indicates that you patch only the pt1 driver.
I've updated the subject, so no need to repost, but remember this for next
time :-)
Regards,
Hans
>
> Signed-off-by: zuoqilin <zuoqilin@yulong.com>
> ---
> drivers/media/pci/pt1/pt1.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/media/pci/pt1/pt1.c b/drivers/media/pci/pt1/pt1.c
> index 72b191c..f2aa368 100644
> --- a/drivers/media/pci/pt1/pt1.c
> +++ b/drivers/media/pci/pt1/pt1.c
> @@ -334,8 +334,7 @@ static int pt1_sync(struct pt1 *pt1)
> static u64 pt1_identify(struct pt1 *pt1)
> {
> int i;
> - u64 id;
> - id = 0;
> + u64 id = 0;
> for (i = 0; i < 57; i++) {
> id |= (u64)(pt1_read_reg(pt1, 0) >> 30 & 1) << i;
> pt1_write_reg(pt1, 0, 0x00000008);
> @@ -1122,8 +1121,7 @@ static int pt1_i2c_end(struct pt1 *pt1, int addr)
>
> static void pt1_i2c_begin(struct pt1 *pt1, int *addrp)
> {
> - int addr;
> - addr = 0;
> + int addr = 0;
>
> pt1_i2c_emit(pt1, addr, 0, 0, 1, 1, addr /* itself */);
> addr = addr + 1;
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-03-21 9:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-17 3:08 [PATCH] media/pci: Assign value when defining variables zuoqilin1
2021-03-21 9:19 ` Hans Verkuil
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.