From nobody Wed Sep 10 01:34:22 2025 Received: from mail-ej1-f52.google.com (mail-ej1-f52.google.com [209.85.218.52]) (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 9A41B2FB086; Mon, 8 Sep 2025 11:14:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757330077; cv=none; b=UPhsDaElRFVT/FZU3CBIirCngA2dO0cZFobRxdH4/HwGzaY8lW0ztkYYAnUX+bF7MS+BG3Ber2afaEimm+4Z0CpUZgqxMPaAxL93FXY3r/eUw8fKmcltHIjlN8p3qBA8cm9xl+j6BQ1/Gy9PufbFOeto0/Ae+93Awe6yMOOg9VY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757330077; c=relaxed/simple; bh=zwJ8JDEORxaEloNkd2011Tl41jMGzKOxBviSW5BKmUY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UOOeTkMfuVdAxWv+w6m063lLyRnAtk4E8I+KIupxzcmwltp6Y2pisGFTtjSPK0CDMv2GpoWCgAUsYAVZEVDlqfRBG1eb7XQqnVlxUQrivYUZrF+uFOQKtZGWkafcXuq3LZ0XUnJjyepF5fUeVA/U5Mu4dAEnhwzb2KWvD+8RNVw= 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=FGe4rHX6; arc=none smtp.client-ip=209.85.218.52 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="FGe4rHX6" Received: by mail-ej1-f52.google.com with SMTP id a640c23a62f3a-b0428b537e5so692967966b.3; Mon, 08 Sep 2025 04:14:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1757330074; x=1757934874; 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=cdek4x6pVHM+wAcANZi2JUDszGyqCUsdSgJyjHlowQw=; b=FGe4rHX6EbiOeoxjFlKkpjDiv9tJR1RTBPuBsvp4/NGzJnfHEQJSu33M7AvHoyKCde Darr/8sYeZEZLVe0o2TMtJP3rfnaZXG8rqG3IJMXKcqmLlu6bBjaAP0nx4SpmUMITWez p3+O3qraSU9t+Fi8Z9DWUEhY4xXao9x3qf0nnNjLyVezox/w4TL7tuszuS1wSuZaK56r ssIMM0Tq3d4viEKFnbZsV14mGqP1g03HNRo0vo2/0mKSAMjfiZuhS3FtSPQqh72ZP+nU cCNA0QMb7obK4MmMRXRsBAmOG/TTRHoct+heb/Cu94uD9XTaO0X0Mxe47yYdH6okkXRK po1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757330074; x=1757934874; 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=cdek4x6pVHM+wAcANZi2JUDszGyqCUsdSgJyjHlowQw=; b=Mr109SgX/o5F+wtSC0xv86eJMRP913vRCbP+hNKB9ueQLgOIQJ47XFziKwG46I2Fsw VgO1kk7cSPceq8EJGOLVAEUwrc34M4yYjvRudNzJSbiFuOdo0rdF/8ZRU7qw2vBcA0Yb UC4c24dDmMnipiFCVkri4PactuionMyFSwOTzDO3N19+3Xldxeo7AKdeEJH/tRNeUm1R dT/fK3cla97xfToreHCH4wswjqc7Hw28ReOZpJdNRI090xNdNkOr9K5I3xejlbSmeMj9 JZpRiKgEy+2+uc8LfhWiclvSR60d+xVmQ+kVXKtWwcHI1NEMnjUIM9fX+GEKybajZGLN dvUQ== X-Forwarded-Encrypted: i=1; AJvYcCWropMKkaLN16NaFEuo7uyzsANhlxjojUSxpXx9gfWLi7XBzfDxlnmpJDYitX+SOMAy0vcgOz/HGZzSc8g=@vger.kernel.org X-Gm-Message-State: AOJu0Yx21fY6OYqqMdzc5Gcgw/E4ydSQx444mKQwJe8lj7mot8h0qDqM zwYYcoQOuO3TzVNZTQxntvytXBW+Y8xtPLTob4YLeTtnrH6WTesdqcqn X-Gm-Gg: ASbGncsc8s2KxyotA9d+wZOIhr/GWjldJ3EPgwRs2xFZzJ0uWYS0/0bwNS+eyl8qFoX VLBiUpEYhS0OQtdplRyxgoFcJv1SM96kZgHLrBQVtQx7Rnj2kM4xULGuVGcI3VUu7ikGTggyTSE 3lv55yiHEKg8Vx35IP5AgB0GBRcNOVmV6jHpbEr+PxXlfLpFGFWmYpLminozW9GBBqLyqbHj1ip l4wcEzBgZKG8Cduxde7QbLGIBXmKC8I4wMB2vdYNmOEk17O5HNK7LiVwXGVh0vYHF0m5d8iiYbC YKxDy1ekA+GMdlq58Vu0K03FplnnH0FUF7OIOPfoQJqAscOhHyEStPMI/kJkA3PBAADMGk+XST5 GuPlkBfsveSNncON69U38+F32l3JWci+750l4Z5as X-Google-Smtp-Source: AGHT+IHi+tpNbXt9zkMG3Oh7LI3UtY4qbqzf0/c4YuJoJ6HywSF4OLWjuxs2AwUAb0EpClbwCz9nYw== X-Received: by 2002:a17:907:3f94:b0:afe:63ec:6938 with SMTP id a640c23a62f3a-b04b13cc99dmr759164066b.7.1757330073868; Mon, 08 Sep 2025 04:14:33 -0700 (PDT) Received: from hangmanPC.. ([86.124.200.102]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b0470f11088sm1211333966b.111.2025.09.08.04.14.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Sep 2025 04:14:33 -0700 (PDT) From: Cezar Chiru To: andi.shyti@kernel.org, Markus.Elfring@web.de Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Cezar Chiru Subject: [PATCH 1/3] i2c : pcf8584 : Fix debug macros defines of if statements Date: Mon, 8 Sep 2025 14:13:53 +0300 Message-ID: <20250908111355.79222-2-chiru.cezar.89@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250908111355.79222-1-chiru.cezar.89@gmail.com> References: <20250908111355.79222-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" The issue was that macros starting with 'if' should be enclosed by do - while loop. Revealed by checkpatch.pl. The patch fixes this and is necessary because by enclosure possible if/else logic defects are avoided . Also fixed inconsistent macro usage ending ';', which caused build error with the macro defines enclosure in some cases. 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 Wed Sep 10 01:34:22 2025 Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.50]) (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 B4EEF2FB086; Mon, 8 Sep 2025 11:14:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757330086; cv=none; b=OqcKRkXQp9J25EHcu/cVg8iLQwrg9QM6mf+t9oeq7k4E9vu5ydv2Aowy1sBIMBb1e26Ls7IM9vJed9j/msPxZwQAFHY5Y/RN5PCj7KEB2vRuY5UGrhGbHtltC2ykefhqsPakVeZ2DjBG45xpxfFp69i3yeJlN7XILYLWe9aeaps= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757330086; c=relaxed/simple; bh=QVdNreyj/j6+OBeT5n5Odn09eL8RXcI6GMyfGx53hLw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=D42n3UIOSnYlukued1yspArXygxBIW48WGbz6OvNNszbu4AGi5sxZ2XGk8tsdgpk5EELYJZDKOVzec8t5rCRkWJVop79ZvRCgS1CpQzEUaTADU2L37G7lwBZX3nXOjNOLNEekfUm6+HOMfve1jwmNx1HnIun8Nhg0NePleqsLHU= 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=HRDUkYcg; arc=none smtp.client-ip=209.85.218.50 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="HRDUkYcg" Received: by mail-ej1-f50.google.com with SMTP id a640c23a62f3a-b0475ce7f41so755604266b.1; Mon, 08 Sep 2025 04:14:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1757330083; x=1757934883; 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=66U13vMoKlAR6KyBLgh704oM98OhgpU0LOQXWOT4YKE=; b=HRDUkYcgF2EjDKUBS1Tl8uWOW/3oQ3oJUmRHVKJbw8dIzum+0Qw66pLubdOnP47LlL 1mKD6exyQVSiV1XOvv7/Uj2G5yhj5/OjWTmhxtcZg7yka13geuX+oOMOgEwz//dkw5Q5 QxS0049fA3fiYwskhA2a+njvPXIyuoXTcPMCQsMlAHV2FwHW/uEFjhsvxJyDjL6uxEjN sH1D2w/nFpICZrLCrNinFyV8VDBpY9hd5aONW5GHoMrKNFhuCePvQl9eFCSnLsvnG/tH rPORd4V+SpJ7HR2rFoB9y0+wwXteNZh24ZzsMriCFYAV3+zj/6p6WJihClSKZYF4/gxb hfNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757330083; x=1757934883; 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=66U13vMoKlAR6KyBLgh704oM98OhgpU0LOQXWOT4YKE=; b=khuzsM6wZyQ3QJ4ni8/ArBND3hGGMlSaIgIyQZP8a7X7KHcxHW+zW80AdQbGrD4fHH MMANRx85YEILgS5Ll98bkEgMph6D4DuJq9B9p61PkLIiSdqVYEYTxKPdGovkhyy1o84L 6zVlfAu5rkQINUfgtQSAa5dkHX2CKY3x+YJBn85kzAtRFASHgMceQ570B8e28eSwhdfo Rge25JQKYwH4/KU3qqjjhmjnqbFKiGG3ablaNJCyT4guAwG6t6NHgKJ5d2TJtTRTSGSw A3vDk1ibslA2DZeEQ4nhX12yX+mikXoX1yEqOlcNrAD2VCdaLy6lGhOBPQ0JjX2EGyoY HOmg== X-Forwarded-Encrypted: i=1; AJvYcCX7V9bIKHLQH8qxEKAkrVmlvsz/v53rBm35k44Xzcry95PjO3v45IkVCtQ/VerB0/DFLx4PIhAV43ayaUs=@vger.kernel.org X-Gm-Message-State: AOJu0YzEcXg73v0dKDofFO9Q2UdVkvqo9nmesE3njC4mgQiWLRsfgm4t wILPOoEqZKIe9/WJd8BlKwW9z/CikIE1EYdL/7R9zYaq6DQj33O2jnAn X-Gm-Gg: ASbGncsdYkHy7kcixtLkyggqjQObjpUfGO0l/gIa2ALn9J0AyS+xtZKkkQLxXPJBNHM 4+qaJnBZzE/CmMeZV3Mk/ioZIpJScwaKX0Ws1yfdRQbSQ3q7pwNcWpKPXXNKFnwaeN7+Vf9/1e2 ya4dXyMPlmGSHDv2g5dmTeYXZT5qtvZmwLNADQ2LfzuaMIfePCdFekbOqgxiQLGye78GNAZhym8 r1aJqPxf0rD4OD+vMOvVZ6zF+txGtWkYZjqOs8PnE7CJswz196QiMWgNK+NyZiJea1d8Qo0MzS4 zSqLtXbgPHwPD5iwhTuT+dW1OEwQbdaHyONvjEFx16t3kt71hmq+iYOfNFRHwzs+IKdqKeuvZFN ZajTpQBcuaWvAWLw0HHLTMd+zWo0l9sflLLhM2KNn X-Google-Smtp-Source: AGHT+IEohxXdFrMXghDMqya4r3GJDnxAJjIsW5bwjZzKjXzMyMJqLnPF4XZFHF/d9W+QmiqCzC5FUg== X-Received: by 2002:a17:907:7f28:b0:af9:d80f:645d with SMTP id a640c23a62f3a-b04b16d44admr827433866b.57.1757330082872; Mon, 08 Sep 2025 04:14:42 -0700 (PDT) Received: from hangmanPC.. ([86.124.200.102]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b0470f11088sm1211333966b.111.2025.09.08.04.14.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Sep 2025 04:14:42 -0700 (PDT) From: Cezar Chiru To: andi.shyti@kernel.org, Markus.Elfring@web.de Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Cezar Chiru Subject: [PATCH 2/3] i2c : PCF8584 : Fix do not use assignment in 'if' conditional Date: Mon, 8 Sep 2025 14:13:54 +0300 Message-ID: <20250908111355.79222-3-chiru.cezar.89@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250908111355.79222-1-chiru.cezar.89@gmail.com> References: <20250908111355.79222-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" Fixed errors usage of assignment inside of 'if' conditional statements. Revealed by checkpatch.pl. Fixed by moving assignment from inside 'if' to 1 line before each if conditional statement that caused errors. 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 Wed Sep 10 01:34:22 2025 Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com [209.85.218.51]) (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 AE7A03019AA; Mon, 8 Sep 2025 11:14:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757330100; cv=none; b=m3j05M9XB3YNw3rXa8LeuPukEq/Tic8VjsNZStSRQPULz6tpZ3IdsKrsuIclKVMqBjyrhOr2xiMuPUwjCoRMpxuPPHGvwhCPIOU0LjiEh/5dD+YoeiBlwK3U3CDmSJN5xMpMI5Tl0ATy1QPMjhnR7Y9H/oc+xId9Q7YyBqjLE9U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757330100; c=relaxed/simple; bh=TfP6W/TnH/0OzJl7LMSUfZKB4S/i2gT2uKhKlDTtDHs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DPKwBqu6cCe6Qyz6jMsDomUEVRKEQYjnJGtXjZmzp3+2a7cZu2tVjJmgMlcSU+9UZxLl962VF6Yt0QkWY+41L5boRpDy+HVeMyeCXY48ft6y1sh84A9UAsSLz8J9yypV4bI2As1LA8Ff4g+lgE8vtE7j+xVUjUhZkbzdFvxuI7c= 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=MVw0q6r5; arc=none smtp.client-ip=209.85.218.51 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="MVw0q6r5" Received: by mail-ej1-f51.google.com with SMTP id a640c23a62f3a-b0449b1b56eso618693866b.1; Mon, 08 Sep 2025 04:14:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1757330097; x=1757934897; 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=TBUgKZx8CWWM1fLAgdONFmjWGDp8QxAQMW41bDl4PYE=; b=MVw0q6r5lBjy5pHK4Mb3EA7bAzbFW6IWhtwhCt2l4Bj4iEG2RvRx51Oq8AiVk0ErvF nLE2AhOajv8+sgb7RRda/FUBQEpyF90R5ILIkev4JzUtxAEiYXRdTEcqdHCCIkzJd9rq 3Jzf4MVEzBxDiLQpUo/sHSfFNa/L3wapSEG3jMIFzEWWUIxKscRAgbdPFBfQOud/Kf/v qho11XgokfLqZe2ewlGG+6lUwzVlPoJURmDvzu0SXQVav9meDQxOO5qWmYvy3gHAu++T qdJc9N3Y11Apf+M4UhPQLoYCvEIkdcR4RSnqIfFFGgmHLmst8I7QiptKxQoDP7wdfN78 Ygcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757330097; x=1757934897; 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=TBUgKZx8CWWM1fLAgdONFmjWGDp8QxAQMW41bDl4PYE=; b=aHt/kRruryMl3pJ3msGmNnNbArwYONYuOoegCsvpNGD7Gc9uNp7nnrRK2AstH9A6cK F8GMUuZaJmLabTfjDaqDydpyLBM+OgpG0HaQItedDepvKBulWGUWKJr7CQcxo3vvCpIe uXdvdzMvCM8bTJjzFbFQQSjC/wIRFZHpuZ0LDoY1/34XY2j0+4wS50c2c7eFExcUT43w M1tIsmZ1Ue22ogNZRmxdwZAt8329Gi2TrzU073Jmyc0jCJ7QTeiN/jNXm7om1U6I31Vo ibWiWW55ZK7EJP0pojRZ94Wnep7+rsmsmzyIRfX6a1Yg25cXACWx3CR/FavgQ/tZsL6o TT1A== X-Forwarded-Encrypted: i=1; AJvYcCU+FLVHUeHgP9uLYoSoyCku/Ade6P6i88YtT1v/GF324S6gRG287bKUmTt+NRjLOICKECtho+QrdzTTs2E=@vger.kernel.org X-Gm-Message-State: AOJu0Yypa9BMzm3lYu4eCUcjAoKDApmvBCe+qvjd1pRaczw7JY1guK8d CFALeZCu47GJaa+pDQu4hqgycZKWZKgEgN+b73kUcH9uAXOTKNhnR0r3 X-Gm-Gg: ASbGncvaigUmXtst7TPjVpQ2OQGZrtwXpK+MnwjEU1ah3GDW5A2uk+sZyF1s4umRLFm cXNcGsuOebbI8ZnMAc6RVvjd8aH5CqbRNerFdcpTTP/SJWextgq2oWH58RzMAzacK3Sq9fY4JHI dHMmKaJJolvRz5TpYIcs8V7WvG9wnSDBcH4ZrEObImnaJ2cQyiPaK6dEwfGfcOyOqKONw/wgm3g EeyTSS+eFT+O9TyXe4gQwwFVmVgNRMZ/VSl3tPk4LOGnBVxBERvPDsVpcll94DoM1LqKd4+b72o JFlpOHDK7+62B74swMukjthiosCawD6yWUrVdjnz4NlM1JnL5cR8IUM7meuEH2CWw5rcg2xdY+v Lo+ZIt+/il8oQ0+rNetp+NlHsqBsWs7op3EvMPR1O X-Google-Smtp-Source: AGHT+IE3JlJNXgpxX8j5r4zjDm5+NI53Htj/P0EpXbcWtw77dZIT/GXtwNLca3686j8M+Jcn8rSTSA== X-Received: by 2002:a17:906:6a0c:b0:afe:e7f1:289d with SMTP id a640c23a62f3a-b04b1818f57mr615278166b.62.1757330096936; Mon, 08 Sep 2025 04:14:56 -0700 (PDT) Received: from hangmanPC.. ([86.124.200.102]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b0470f11088sm1211333966b.111.2025.09.08.04.14.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Sep 2025 04:14:56 -0700 (PDT) From: Cezar Chiru To: andi.shyti@kernel.org, Markus.Elfring@web.de Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Cezar Chiru Subject: [PATCH 3/3] i2c : PCF8584 : Fixed space required after different operators Date: Mon, 8 Sep 2025 14:13:55 +0300 Message-ID: <20250908111355.79222-4-chiru.cezar.89@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250908111355.79222-1-chiru.cezar.89@gmail.com> References: <20250908111355.79222-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" The error was: spaces required around or before or after '=3D', ';', '<' and ',' operators. Fixed by adding space(s) around or before or after different operators. 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