]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
media: media/pci/pt1: Assign value when defining variables
authorzuoqilin <zuoqilin@yulong.com>
Wed, 17 Mar 2021 03:08:04 +0000 (04:08 +0100)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Mon, 22 Mar 2021 12:04:05 +0000 (13:04 +0100)
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>
drivers/media/pci/pt1/pt1.c

index 72b191cfeb5483351d425f7ed68bb5763f0ea266..f2aa36814fbac4c4a430b8a38bb5ce5a85cb6b1e 100644 (file)
@@ -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;