summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzuoqilin <zuoqilin@yulong.com>2021-03-17 04:08:04 +0100
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2021-03-22 13:04:05 +0100
commit79f382b9a9d84cd099b79cf92aa9f73d0aa64481 (patch)
tree7efc223199ee6765b0769329043c1f63dd835f7e
parent1a77d4fd3b1e232d556939f67206865c802e7ec5 (diff)
downloadlinux-79f382b9a9d84cd099b79cf92aa9f73d0aa64481.tar.bz2
media: media/pci/pt1: Assign value when defining variables
When defining variables and assigning values can be done at the same time. Signed-off-by: zuoqilin <zuoqilin@yulong.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
-rw-r--r--drivers/media/pci/pt1/pt1.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/media/pci/pt1/pt1.c b/drivers/media/pci/pt1/pt1.c
index 72b191cfeb54..f2aa36814fba 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;