hwmon: (occ) Start sequence number at one
authorEddie James <eajames@linux.ibm.com>
Tue, 9 Feb 2021 17:12:34 +0000 (11:12 -0600)
committerJoel Stanley <joel@jms.id.au>
Fri, 4 Jun 2021 04:59:58 +0000 (14:29 +0930)
Initialize the sequence number at one, rather than zero, in order
to prevent false matches with the zero-initialized OCC SRAM
buffer before the OCC is fully initialized.

Signed-off-by: Eddie James <eajames@linux.ibm.com>
Acked-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20210209171235.20624-4-eajames@linux.ibm.com
Signed-off-by: Joel Stanley <joel@jms.id.au>
drivers/hwmon/occ/common.c

index f1ac153d0b568a94c771af555569f9517bab248e..7e73418ee0ad800ed76fee190ec38ebd347697c3 100644 (file)
@@ -1151,6 +1151,8 @@ int occ_setup(struct occ *occ, const char *name)
 {
        int rc;
 
+       /* start with 1 to avoid false match with zero-initialized SRAM buffer */
+       occ->seq_no = 1;
        mutex_init(&occ->lock);
        occ->groups[0] = &occ->group;