[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210317030804.963-1-zuoqilin1@163.com>
Date: Wed, 17 Mar 2021 11:08:04 +0800
From: zuoqilin1@....com
To: tskd08@...il.com, mchehab@...nel.org
Cc: linux-media@...r.kernel.org, linux-kernel@...r.kernel.org,
zuoqilin <zuoqilin@...ong.com>
Subject: [PATCH] media/pci: Assign value when defining variables
From: zuoqilin <zuoqilin@...ong.com>
When defining variables and assigning values can be done at the same time.
Signed-off-by: zuoqilin <zuoqilin@...ong.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
Powered by blists - more mailing lists