From nobody Thu Oct 2 10:49:34 2025 Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9AB8932BC17 for ; Wed, 17 Sep 2025 13:36:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758116195; cv=none; b=oNwlpEYGMxnjAPfTgxpahL38ptKzt+gyYHFfsjYqhbtva4/qO2lEiYWMY0lueLcis/NWz0buA6S5wH6QePRhHo2pDFrxzgG3HEZAVsRj9lbRTUG3EkDDOv10Eaes6mx05vlMaB5+u8GmO7I2N4tsRGkgosPCg1zU+auDTdZzjCY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758116195; c=relaxed/simple; bh=gWMmpxO3/QyySBmyRF9UaNZFqybtXo64CSoJ0E1jRmY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QXmRq0C2qorlpCYpgys4PoJJHrV55YhU92bH1fBmdfSkE+Pfo5CbjHQfOlgNSHZFe/xsM9FaS1CvuTotOsJUCRuk85plkSiLn1weBd7UHuZ8ITyZGizJDiJOYHGyJ8u1p8FFmRwEnmHrgvYbuPyQNWsYeYv1CHYG6WlawkoPdNM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=UYF8otPY; arc=none smtp.client-ip=209.85.128.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="UYF8otPY" Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-45dd505a1dfso51977405e9.2 for ; Wed, 17 Sep 2025 06:36:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1758116192; x=1758720992; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=VSoCVcELFMldoX3y3Du2YUF3k7DlmnQItruU/P14Jd4=; b=UYF8otPYX4EcGx1GUcbiqykrIIKP6VPcWQyn8zjMNfmfiE22WZTfnIDqi/gIG3BXUz Ve2JCX5yNr/fTkQzTBCZp4Ud+0Uih+4GHtoYVEkV1qMZPVZQ5cW5eAXCb+oIFyBlMkAi sIQhOMdhN7/mff9qLxjPqdo6g15vx982ow0ib/kV/9JDfSQLngeia9yGciqCl7MLOose qgLTt9oNoD3JpWa1TOGYM/0HiJXvryH9o1tvpU+7u/CUvxGZyMmDSsVSP89lMhJ0axhv yg29hEpuTWpT0qhyv8HcRK3RGKsNaKJ+iFvLJ/LIzpZrBqsuOxAEFHVv76DIeUQYSsOM Os7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1758116192; x=1758720992; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VSoCVcELFMldoX3y3Du2YUF3k7DlmnQItruU/P14Jd4=; b=tStRcp9tqKScG6cF7TZAUMQfTUPKbwhQoxjJKCCiPouydfbV6Gpg4UCRTNi62gkWMr sPawFBbNrGm2rmg61T4E76MXYetSzOYWlmEMBrKiE4HGamM+rOYvYd5mcJtnUd9Gp4q+ 97+NmkY7TcXPGag/O6IN607vZl8LCqaGv3k0woNYWk/1LOQf61ZNh5uZzwN/5C/gFhux e5v7ac/ddVIm7jkJPK1WTYk8nG2VzuftdayyqUkVdqW6jFfAvkDzKpa6jMnt6IIYxzno oMBYfy0x/NpLPyNDzPKiWerfBjtOMev2Gey00IH19p9HeIilouY0WVWqEgPF4no+sNef vsyw== X-Forwarded-Encrypted: i=1; AJvYcCU6xtEfAX5UYi1FtCtu4sxfy5gSRRG4pWOVge4oY/BDLETDPBLXaICcw2Wv80gS1ctatYCUGsjoFtyHVQQ=@vger.kernel.org X-Gm-Message-State: AOJu0YxSKwuJnH/sWfLkdzhsW/2ZT1U7jUXuJpPK/iVbu68XGds6qiaH ryoq3Wj/t4lj+QZNXgGmy5IUmusKBjT5RNOGtqgBw9ZIVdv+Sp4OaxZ+ X-Gm-Gg: ASbGnctMDyzoqDpwIWJcAkeXUtHRKoHvVO6BWHYNmB8dR48jbI6VWxp4ZZOXlK9R2ds 3EIOAwMRUtzOB3ABGf7WdLQ8Btdg0jLKEJIllT9u8299PaM7AYLmzI50Rybe1Rs72AhPf4O4kqr gPhBCn3EFPyEyUiOBzdXidAylBf/Ha0Bm8OawQAMK5/+PuTWrlKxRSD35HR6wsV20KzSa0ncTnG Kkmkhh9Jz+4sGlzJrCiC+R0sNvyZuxmYGAK7HdWk8IUN9qf4X/6RVIEU2bFiWx9KFBJv2OmDMj8 kyAAlRbAt1iV+2uBRm8DyclrNWZob7yBsTP+WogRPRPiPpUlM+PxtcDCcNGsmb67rUsj2J4qgFs ccZDTQFGtITCqdrnzGUKGoGCbaGERtsRX0y283maB X-Google-Smtp-Source: AGHT+IGXv7lCvSiC5jwcu15TTnkjthCUCqYkUi8gYvCV4k6lcJVuvHccVU1DUXs4EAeskxxTkOh/sA== X-Received: by 2002:a05:600c:4f86:b0:450:d37d:7c with SMTP id 5b1f17b1804b1-46206842450mr18528565e9.21.1758116191764; Wed, 17 Sep 2025 06:36:31 -0700 (PDT) Received: from hangmanPC.. ([86.124.200.102]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-46139ab391bsm38198075e9.21.2025.09.17.06.36.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Sep 2025 06:36:31 -0700 (PDT) From: Cezar Chiru To: andi.shyti@kernel.org Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Cezar Chiru Subject: [PATCH v4 1/3] i2c: pcf8584: Fix debug macros defines of if statements Date: Wed, 17 Sep 2025 16:35:22 +0300 Message-ID: <20250917133524.85063-2-chiru.cezar.89@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250917133524.85063-1-chiru.cezar.89@gmail.com> References: <20250907114557.15453-1-chiru.cezar.89@gmail.com> <20250917133524.85063-1-chiru.cezar.89@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Enclose 'if' statements debug macros defines in do - while loops. Fix inconsistent macro usage ending ';', which caused build errors in some cases. Enforce errors fixing based on checkpatch.pl output on file. Signed-off-by: Cezar Chiru --- drivers/i2c/algos/i2c-algo-pcf.c | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/drivers/i2c/algos/i2c-algo-pcf.c b/drivers/i2c/algos/i2c-algo-= pcf.c index fd563e845d4b..3fc4b5080a32 100644 --- a/drivers/i2c/algos/i2c-algo-pcf.c +++ b/drivers/i2c/algos/i2c-algo-pcf.c @@ -23,10 +23,19 @@ #include "i2c-algo-pcf.h" =20 =20 -#define DEB2(x) if (i2c_debug >=3D 2) x -#define DEB3(x) if (i2c_debug >=3D 3) x /* print several statistical value= s */ -#define DEBPROTO(x) if (i2c_debug >=3D 9) x; - /* debug the protocol by showing transferred bits */ +#define DEB2(x) do { \ + if (i2c_debug >=3D 2) \ + x; \ + } while (0) +#define DEB3(x) do { \ + if (i2c_debug >=3D 3) \ + x; /* print several statistical values */ \ + } while (0) +#define DEBPROTO(x) do { \ + if (i2c_debug >=3D 9) \ + x; \ + /* debug the protocol by showing transferred bits */ \ + } while (0) #define DEF_TIMEOUT 16 =20 /* @@ -308,7 +317,7 @@ static int pcf_xfer(struct i2c_adapter *i2c_adap, timeout =3D wait_for_bb(adap); if (timeout) { DEB2(printk(KERN_ERR "i2c-algo-pcf.o: " - "Timeout waiting for BB in pcf_xfer\n");) + "Timeout waiting for BB in pcf_xfer\n")); i =3D -EIO; goto out; } @@ -318,7 +327,7 @@ static int pcf_xfer(struct i2c_adapter *i2c_adap, =20 DEB2(printk(KERN_DEBUG "i2c-algo-pcf.o: Doing %s %d bytes to 0x%02x - %d= of %d messages\n", str_read_write(pmsg->flags & I2C_M_RD), - pmsg->len, pmsg->addr, i + 1, num);) + pmsg->len, pmsg->addr, i + 1, num)); =20 ret =3D pcf_doAddress(adap, pmsg); =20 @@ -336,7 +345,7 @@ static int pcf_xfer(struct i2c_adapter *i2c_adap, } i2c_stop(adap); DEB2(printk(KERN_ERR "i2c-algo-pcf.o: Timeout waiting " - "for PIN(1) in pcf_xfer\n");) + "for PIN(1) in pcf_xfer\n")); i =3D -EREMOTEIO; goto out; } @@ -344,13 +353,13 @@ static int pcf_xfer(struct i2c_adapter *i2c_adap, /* Check LRB (last rcvd bit - slave ack) */ if (status & I2C_PCF_LRB) { i2c_stop(adap); - DEB2(printk(KERN_ERR "i2c-algo-pcf.o: No LRB(1) in pcf_xfer\n");) + DEB2(printk(KERN_ERR "i2c-algo-pcf.o: No LRB(1) in pcf_xfer\n")); i =3D -EREMOTEIO; goto out; } =20 DEB3(printk(KERN_DEBUG "i2c-algo-pcf.o: Msg %d, addr=3D0x%x, flags=3D0x%= x, len=3D%d\n", - i, msgs[i].addr, msgs[i].flags, msgs[i].len);) + i, msgs[i].addr, msgs[i].flags, msgs[i].len)); =20 if (pmsg->flags & I2C_M_RD) { ret =3D pcf_readbytes(i2c_adap, pmsg->buf, pmsg->len, --=20 2.43.0 From nobody Thu Oct 2 10:49:34 2025 Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B227D1A9F9F for ; Wed, 17 Sep 2025 13:36:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758116197; cv=none; b=cSEXNXCVHBSU3Acnx6n1RpLGADLa4lWGSRIvKoso5OoSV6F2eYD1S4X4/hmDFCKb9Okr0JBtQ47b7wJ/Z4zEkl//87nct0YbR200OcQsQafkGEYWQdo0sQUvkCKyz/iNyMN/HL4wjOT7LudJgZ8mK1xM+8cIr6l/2erk0fwM9Wk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758116197; c=relaxed/simple; bh=weuJ2MwlJxBeJO+3XDOOSJC+wXIGaL1+YZNafT+N/Mc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=omgQXiJRoXTEE4154NRKnF1m7l67nZn0aBX4AOON1S7CKgQ/HzX62phNVP1EZ82v4bXwJJlVXWr5yLym98FfMGzX6NdIDGgVDNgzMz9swlkqikYHrXd2JqaXAWwoFEF6gTpeJmYZW8joZW3ZzC9OI6cymd+zgfcw4yY9QSLx+zo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=bSXkvAxL; arc=none smtp.client-ip=209.85.128.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bSXkvAxL" Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-45e03730f83so32219885e9.0 for ; Wed, 17 Sep 2025 06:36:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1758116194; x=1758720994; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=d+llRWMjZnfsGeESVFG4qICneYksOTb64WbcBHPF4Fo=; b=bSXkvAxL3sOye9sHUhR/L07JqaUoXTRp0X803v7fle/Ilzd7oFMxw2Q9K777tMS0RV s/kr8cOwsAO4cnI/81tWE4kzSDhoTFmmWZk/PT+ygm1dj88Uw+JXJbKjS7uTee7Fxke1 RlOhg0lRJnpcIhDIBCfakEyqKyWp78U5nPOebBC60tVWmeOx438klGFdWZcEjZ7FlQPD za/rHte7ZpNXtR2oYYJsGbaNbdxdNdONysTaWNDAHrAdtFS6s04J9glINJT6v4dJjEx8 ujxsLfnPMhk7hPxsCNH8avoE0ujB9bXI+IxnYR7P2aaVT0pwYtZJM6WFPlxbAekI/2O/ yFcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1758116194; x=1758720994; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=d+llRWMjZnfsGeESVFG4qICneYksOTb64WbcBHPF4Fo=; b=g8KHtdnpRYn4A1J2vQ/qx1RDGsHsNLlhSXceDLtoK/Nq+L6CLvaJH6zME3Jjn5Cj8I z/hxTAMpMl0pHrmP8WpgIkd9dVHFXoUsXpWMxKdpB0lKgCRL1wRH5AVyErJps5QNCHKz wSJCPoSOScBQOSb5XfQMcSg+4D0c4vKgNzpMzOp61Z+IGTmZu+Wy0ymJiiDWDEqRH26D /mN5cbBj1+ceo+zHJl2tCptEYV+dUqNPMJthNs9MSi+LXasB6HO7WXKbkbT0W1MUiLa1 LY9etS3tQIHO76A/qvuFVeZ1KUIOArUDN7pNdTINtYVEr0+6dPpCs3rRwbi0B6CszPPV ZeKA== X-Forwarded-Encrypted: i=1; AJvYcCVpH38vfy5wQ1QqgBszsUPBje5I9+wNpeb9fz9wbavtysiODu2WDCxcnfmqPnf8jFtn1rUpXQC2osm6QaI=@vger.kernel.org X-Gm-Message-State: AOJu0YwfzNbthtOeO6v5gYrOBvTSVGlB56V19tq5nJTjjcXdfl3SmsrZ 6IWlSbE3/tt+cuZdF52gsze2xOly85s0qGvvIaa/C+FTZ86sdqpJhd0V0cGVbg== X-Gm-Gg: ASbGnctWp3jYax9Cg1vegGIiU2a0NUDhq6eAqg89wLTf0E6X9SnKCRR615YbU8B9+U7 p8TBKuAGcyRcglk2G69rCioy1sWs4Uxj879ilmo8QvN/yNcGKhZDzOfpnEIMpBIWvapSZUbdpgD b5BSiCp86yjSlBzMrM7igP059ltayBuQjZ8emFAPDm8abNmROlzwsyNC4suefAnn9VCVm3Uk11e ZOXS7HR4ZMpr5t4BlqqGBNajJXC/OdkZWJCAxRRVMk6Uu7ytMTOj+hEAVcHgd9MkDqdyBMZ84N0 Q9hZjAkpoHrlWlxrdDAt6+FrNqlG1d0Ug3V139uzUr4ompBZZDSwaNOKigebQESaRWubd6tHUOv TlFH1pqY3HCnU1/dRqMRdbwlQzePz+A== X-Google-Smtp-Source: AGHT+IFJI8G7cdnWUw/QiXu4qHdTrxEzX22AW0w1LeHd0HI1xhxL8mn88vmRE381tEEksdN7lr43VA== X-Received: by 2002:a05:600c:4690:b0:45b:8b51:b1dd with SMTP id 5b1f17b1804b1-462072d6e38mr21707515e9.32.1758116193979; Wed, 17 Sep 2025 06:36:33 -0700 (PDT) Received: from hangmanPC.. ([86.124.200.102]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-46139ab391bsm38198075e9.21.2025.09.17.06.36.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Sep 2025 06:36:33 -0700 (PDT) From: Cezar Chiru To: andi.shyti@kernel.org Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Cezar Chiru Subject: [PATCH v4 2/3] i2c: pcf8584: Fix do not use assignment inside if conditional Date: Wed, 17 Sep 2025 16:35:23 +0300 Message-ID: <20250917133524.85063-3-chiru.cezar.89@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250917133524.85063-1-chiru.cezar.89@gmail.com> References: <20250907114557.15453-1-chiru.cezar.89@gmail.com> <20250917133524.85063-1-chiru.cezar.89@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Assign inside of 'if' conditional is not allowed. Move assignment from inside 'if' conditional, to one line before each 'if'conditional statement that caused errors. Enforce errors fixing based on checkpatch.pl output on file. Signed-off-by: Cezar Chiru --- drivers/i2c/algos/i2c-algo-pcf.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/drivers/i2c/algos/i2c-algo-pcf.c b/drivers/i2c/algos/i2c-algo-= pcf.c index 3fc4b5080a32..598bf000bf4a 100644 --- a/drivers/i2c/algos/i2c-algo-pcf.c +++ b/drivers/i2c/algos/i2c-algo-pcf.c @@ -169,7 +169,8 @@ static int pcf_init_8584 (struct i2c_algo_pcf_data *ada= p) * check to see S1 now used as R/W ctrl - * PCF8584 does that when ESO is zero */ - if (((temp =3D get_pcf(adap, 1)) & 0x7f) !=3D (0)) { + temp =3D get_pcf(adap, 1); + if ((temp & 0x7f) !=3D (0)) { DEB2(printk(KERN_ERR "i2c-algo-pcf.o: PCF detection failed -- can't sele= ct S0 (0x%02x).\n", temp)); return -ENXIO; /* definitely not PCF8584 */ } @@ -177,7 +178,8 @@ static int pcf_init_8584 (struct i2c_algo_pcf_data *ada= p) /* load own address in S0, effective address is (own << 1) */ i2c_outb(adap, get_own(adap)); /* check it's really written */ - if ((temp =3D i2c_inb(adap)) !=3D get_own(adap)) { + temp =3D i2c_inb(adap); + if (temp !=3D get_own(adap)) { DEB2(printk(KERN_ERR "i2c-algo-pcf.o: PCF detection failed -- can't set = S0 (0x%02x).\n", temp)); return -ENXIO; } @@ -185,7 +187,8 @@ static int pcf_init_8584 (struct i2c_algo_pcf_data *ada= p) /* S1=3D0xA0, next byte in S2 */ set_pcf(adap, 1, I2C_PCF_PIN | I2C_PCF_ES1); /* check to see S2 now selected */ - if (((temp =3D get_pcf(adap, 1)) & 0x7f) !=3D I2C_PCF_ES1) { + temp =3D get_pcf(adap, 1); + if ((temp & 0x7f) !=3D I2C_PCF_ES1) { DEB2(printk(KERN_ERR "i2c-algo-pcf.o: PCF detection failed -- can't sele= ct S2 (0x%02x).\n", temp)); return -ENXIO; } @@ -193,7 +196,8 @@ static int pcf_init_8584 (struct i2c_algo_pcf_data *ada= p) /* load clock register S2 */ i2c_outb(adap, get_clock(adap)); /* check it's really written, the only 5 lowest bits does matter */ - if (((temp =3D i2c_inb(adap)) & 0x1f) !=3D get_clock(adap)) { + temp =3D i2c_inb(adap); + if ((temp & 0x1f) !=3D get_clock(adap)) { DEB2(printk(KERN_ERR "i2c-algo-pcf.o: PCF detection failed -- can't set = S2 (0x%02x).\n", temp)); return -ENXIO; } @@ -202,7 +206,8 @@ static int pcf_init_8584 (struct i2c_algo_pcf_data *ada= p) set_pcf(adap, 1, I2C_PCF_IDLE); =20 /* check to see PCF is really idled and we can access status register */ - if ((temp =3D get_pcf(adap, 1)) !=3D (I2C_PCF_PIN | I2C_PCF_BB)) { + temp =3D get_pcf(adap, 1); + if (temp !=3D (I2C_PCF_PIN | I2C_PCF_BB)) { DEB2(printk(KERN_ERR "i2c-algo-pcf.o: PCF detection failed -- can't sele= ct S1` (0x%02x).\n", temp)); return -ENXIO; } @@ -255,7 +260,8 @@ static int pcf_readbytes(struct i2c_adapter *i2c_adap, = char *buf, /* increment number of bytes to read by one -- read dummy byte */ for (i =3D 0; i <=3D count; i++) { =20 - if ((wfp =3D wait_for_pin(adap, &status))) { + wfp =3D wait_for_pin(adap, &status); + if (wfp) { if (wfp =3D=3D -EINTR) return -EINTR; /* arbitration lost */ =20 @@ -415,7 +421,8 @@ int i2c_pcf_add_bus(struct i2c_adapter *adap) /* register new adapter to i2c module... */ adap->algo =3D &pcf_algo; =20 - if ((rval =3D pcf_init_8584(pcf_adap))) + rval =3D pcf_init_8584(pcf_adap); + if (rval) return rval; =20 rval =3D i2c_add_adapter(adap); --=20 2.43.0 From nobody Thu Oct 2 10:49:34 2025 Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AEB4532E75B for ; Wed, 17 Sep 2025 13:36:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758116200; cv=none; b=lb6MR8edK2DzzXMPdQpZB/l4rEG8t+d2wL64T52PoFbmjWd+qwJ+ZSFzAxd5JhQ5xgQsypOsm6GzQ/xKk62XfI7PyuKZ584cBxHVLgnJIGuC0Wb3IkBa8ho6L9RZebcEfbAVpdf2LYl4zDaXdgJmJqTA0fQ3RpGKcxvJAt/lpRU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758116200; c=relaxed/simple; bh=Zz0IopogDoMvhYvB0P75k7TloLTRPPBtZlmYSUPEptE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Xo1JHE4czflUU5Dz7wtWushrOxD9X+KTnIevGWkIo+X/UrGMXgs729dBTyJoJnof3GyLyw2wqmewwFrz5xIiC6yQVzaie6La9Rm0HgP0EiO8izkpkz/tKjnGRLvOATNyyBwCNn/Hqa5aQ4VCWkNGYbTDPiRpmjbu7PiC56zTqm4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ICoWZToB; arc=none smtp.client-ip=209.85.128.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ICoWZToB" Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-45f2c4c3853so18842815e9.2 for ; Wed, 17 Sep 2025 06:36:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1758116197; x=1758720997; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ze5DP8lBOEWJ8GFCJ1XOs6/oD1a6usgeVZS8cBMdDlE=; b=ICoWZToBYDCAl+zMhnOt/WiH8CL3oiK+Qfx/kS2WrLK83RWBUchroX7CMXddFIYmI/ JkHWCc7dFUi+ULftShy229CzGZWrS+ubP5/KHFqY1nNxqmyBw7wHHwHvnoEoFDGrxho8 imfB4ZDC+ARdLlq+tJtXHFeoH4fMYC54Q/Lki/RUfqvi84YKY/Uz5LuLJ6QRoDBwoGIn +K7SdOt4gAYjab/d10fYFfLlgC4InLlBFw8fzScFcV4nuTSU9qbvJyxzmoZ0tD8zvNob p9rbokNQlL3U9RfwvgWoWgw6itSJ4qcoPjEOrMWTBiNxZsik1CJptFsdD1olTG3XVMUI CISQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1758116197; x=1758720997; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ze5DP8lBOEWJ8GFCJ1XOs6/oD1a6usgeVZS8cBMdDlE=; b=xBWVmMyqc5ymc5Z37sz/5c9kE1RGX4cpjadYnW6tUm10U8j+WN7MwhkOJiq3ViXCOZ MHF4r4koy8R+38s/LjlYkDQuKPEg4FWxhhu9lJAdt8beyxT4RQYYe5JXaKxMLBZuuIr1 opiubV66eSYTDsBwZNmdx3nYYgydM/j8Rp3KI6zL2W78GOr2aTNlwlGK/vUDVabQZxjy fcqDHFtJNzdsu+LM7epQj9L4Rl9sjhnqIUv79MvekDvcic/2FK6y8iE04OLN9XSDOK1o nuSJ9JZwWJkn1J6DK4shAxDiwokDpsXJ1wvWru6KazYISrJw4bzVnsL17SUctTxSkuRF nPUg== X-Forwarded-Encrypted: i=1; AJvYcCVqihYhIPm+AQplpoJj1k94pMpibs0x4CRTlyebiXZiRTH15u3JUsp/TOD5QEBfgFEib773ph2Bz0JH4I8=@vger.kernel.org X-Gm-Message-State: AOJu0YyOXW/p8if4D2VDkz6LwDSJB6FxHCBvKbNb0Sq01SVKC82VHZVE iVw6YozjkQFgJw6Aro2NIjfUVXynRmXhaLtY7OupLVt0IT/T9nEC+FzJ X-Gm-Gg: ASbGncuTBgeOKkcmvWcat0M5f1Er0v6QiyRDlD3Np74UbrY7/V5hhHXH0f1Ws3b1UCp WHPTP3xkO3edaEysxHdr/yJbTjYXuhUVi2Q3qn6k/BD83wQepzZV5sAnVcjPgHPqI8nJM/rbbst MxP491ywFngAQloTkI5otvKBJuzndFP9We/+WcrJczdoM5HH1T+i7/L4tDvpzIIdkrkQ+9v6/SO 76TCq3dB6B5VtIWVQUWav7EDVbcwJaw1k3ar2Gy5UwdtxJ3vzBB0gYxPd4SOlWF5X7slQLTtP68 jDlrT/QRyZc1uT9bj1Xm5bQQkBXZuazdI2ARYY0rFAC8ZmtngIZRL1ggEMDTwY/T6XD563dqpB+ UbnvOWzwc3XCKB69HQdJxLl665916dA== X-Google-Smtp-Source: AGHT+IEgHr69wasYUN/vjySljN+1+rUxqFqFWAPOwJ+y4oYduihftX6FWrGrruJItBCX9veOlg7bpw== X-Received: by 2002:a05:600c:1d12:b0:45d:d291:5dc1 with SMTP id 5b1f17b1804b1-46202a0e8dbmr22930955e9.15.1758116196764; Wed, 17 Sep 2025 06:36:36 -0700 (PDT) Received: from hangmanPC.. ([86.124.200.102]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-46139ab391bsm38198075e9.21.2025.09.17.06.36.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Sep 2025 06:36:36 -0700 (PDT) From: Cezar Chiru To: andi.shyti@kernel.org Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Cezar Chiru Subject: [PATCH v4 3/3] i2c: pcf8584: Fix space(s) required before or after different operators Date: Wed, 17 Sep 2025 16:35:24 +0300 Message-ID: <20250917133524.85063-4-chiru.cezar.89@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250917133524.85063-1-chiru.cezar.89@gmail.com> References: <20250907114557.15453-1-chiru.cezar.89@gmail.com> <20250917133524.85063-1-chiru.cezar.89@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Require spaces around or before or after '=3D', ';', '<' and ','. Add space(s) around or before or after binary and ternary operators and punctuation marks. Enforce errors fixing based on checkpatch.pl output on file. Signed-off-by: Cezar Chiru --- drivers/i2c/algos/i2c-algo-pcf.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/i2c/algos/i2c-algo-pcf.c b/drivers/i2c/algos/i2c-algo-= pcf.c index 598bf000bf4a..3439b7387a54 100644 --- a/drivers/i2c/algos/i2c-algo-pcf.c +++ b/drivers/i2c/algos/i2c-algo-pcf.c @@ -223,7 +223,7 @@ static int pcf_sendbytes(struct i2c_adapter *i2c_adap, = const char *buf, struct i2c_algo_pcf_data *adap =3D i2c_adap->algo_data; int wrcount, status, timeout; =20 - for (wrcount=3D0; wrcountdev, "i2c_write: writing %2.2X\n", buf[wrcount] & 0xff)); i2c_outb(adap, buf[wrcount]); @@ -314,7 +314,7 @@ static int pcf_xfer(struct i2c_adapter *i2c_adap, struct i2c_algo_pcf_data *adap =3D i2c_adap->algo_data; struct i2c_msg *pmsg; int i; - int ret=3D0, timeout, status; + int ret =3D 0, timeout, status; =20 if (adap->xfer_begin) adap->xfer_begin(adap->data); @@ -328,7 +328,7 @@ static int pcf_xfer(struct i2c_adapter *i2c_adap, goto out; } =20 - for (i =3D 0;ret >=3D 0 && i < num; i++) { + for (i =3D 0; ret >=3D 0 && i < num; i++) { pmsg =3D &msgs[i]; =20 DEB2(printk(KERN_DEBUG "i2c-algo-pcf.o: Doing %s %d bytes to 0x%02x - %d= of %d messages\n", @@ -373,9 +373,9 @@ static int pcf_xfer(struct i2c_adapter *i2c_adap, =20 if (ret !=3D pmsg->len) { DEB2(printk(KERN_DEBUG "i2c-algo-pcf.o: fail: " - "only read %d bytes.\n",ret)); + "only read %d bytes.\n", ret)); } else { - DEB2(printk(KERN_DEBUG "i2c-algo-pcf.o: read %d bytes.\n",ret)); + DEB2(printk(KERN_DEBUG "i2c-algo-pcf.o: read %d bytes.\n", ret)); } } else { ret =3D pcf_sendbytes(i2c_adap, pmsg->buf, pmsg->len, @@ -383,9 +383,9 @@ static int pcf_xfer(struct i2c_adapter *i2c_adap, =20 if (ret !=3D pmsg->len) { DEB2(printk(KERN_DEBUG "i2c-algo-pcf.o: fail: " - "only wrote %d bytes.\n",ret)); + "only wrote %d bytes.\n", ret)); } else { - DEB2(printk(KERN_DEBUG "i2c-algo-pcf.o: wrote %d bytes.\n",ret)); + DEB2(printk(KERN_DEBUG "i2c-algo-pcf.o: wrote %d bytes.\n", ret)); } } } --=20 2.43.0