From nobody Wed Sep 10 02:04:12 2025 Received: from mail-ed1-f42.google.com (mail-ed1-f42.google.com [209.85.208.42]) (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 458FC31329D; Mon, 8 Sep 2025 18:00:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757354404; cv=none; b=g8oaSVms/ejJfmYE8h4F759+HYJpc9xWYIG6B4BZVbTa9qq5Ey1rEiZA+LIIPlTm+VbKXOqkVnKbWk1OLFtVjaK49xIIwQfiFaJvurX8S3N3FWU9EE1zmWoSyg6tkYKRChoo0aG6gmxH3loPhzIMzKYwppDr8FBjlbeg8tqjaQM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757354404; c=relaxed/simple; bh=kLmU7PnySJjlrWYEOK9K0Vd041chXOxcwIRGUOfFjxk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uTiW27Krznt9p994QZiDonkBy3/uF0B6ktqfeV7oC66xMEwxq2o551tAUSvoZaf2w1/Efxm9z9CtmnKef2qTMivpzSBqrvM07Co9ufHlSQv+AWMB9VdnDl5VK6Atz4ydCzWMclxezJFfPqEu809nuSoUNCXXgus3YEU8jRCTVrE= 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=Zykdy6IS; arc=none smtp.client-ip=209.85.208.42 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="Zykdy6IS" Received: by mail-ed1-f42.google.com with SMTP id 4fb4d7f45d1cf-628caee5ba2so2262134a12.1; Mon, 08 Sep 2025 11:00:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1757354400; x=1757959200; 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=bB0gmaGzRVK2a/rhpRBhMoWc+VsLO+KbeDGysRyoDig=; b=Zykdy6ISOehHxSNCcfLXNHgE9uAJJ6dpBJnzv80Qdthxdn3rGCqavHn7UUqiJ+2wjG E4Y59NDQYI0AS5d/SjqOtn0//t644TY3q6N/ZP3xsawJls70FWOHWiHY6kuuHJlhWSP9 pYLvnPwJ1U/wKF0ESVoj7WQs9b/5qvQF0Rm8bWS9X9M0BqC0Fa3RezlWv04Krbe+7piC 5C5tfq0iPw2eEJPrukSZ7MgqVE0G2G8WKZyqz4pqO7kQQcl8YpxhxQ5Rs+1vA1LKQzdX haFNwP9d81OdHte7Q4MxKDmCcIGXXRXue+9P0BDLjbKtun0ujnH1cM1nOAtP+gFit647 2lrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757354400; x=1757959200; 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=bB0gmaGzRVK2a/rhpRBhMoWc+VsLO+KbeDGysRyoDig=; b=PjNx6hj5OLQhWEJ3Hl77Q3GI5alkx4Np3K13pKzf4tMoSUVFWHu1lJIwGH04bLCl/O ZnNH8hZkhg6DWWEf8FHdtWnUNr7/h/SJufv+zSwYw5utahcbfQrQz3GYveZEpVKKCGhy UC1P4qMbSh/jpjo8NuaFln+kGMTNr/MU2x9R1uGls91mdcCSo0d1q5Q8PgHM/F643D7E ScLosDHcjSWlnyUa9T5adzvVbV/33Fp+r0Ds1SxAcvwVsW9JR+knyfCB+QCsxOYdPDP8 5ChrvEY9P5M4tg7BI1+2kIBfs85Bm5PVEAEKA0ilxUrFhhXyFwDMM3Qx6LUTj+eA3PQp fQEw== X-Forwarded-Encrypted: i=1; AJvYcCUnZNxWUjVReOSt+g7P0H6WqGVW0MJ59BJwQjQNQKerPq9bp/f80tpO9yJsmGUDOKKpq5hyAOgr49dvbx8=@vger.kernel.org X-Gm-Message-State: AOJu0YzP2XYaoq/urkKDJHtBb5X6E+ISVazGIvpi2CkAJtjYEHfO/mDp ZLoQK2MNim+bWEiHEI0Ub9Aucpwa+TAglbNF6IyAnzJP1MpMENJY/r/Q0IA8EA== X-Gm-Gg: ASbGnctSdkId8I5ZZbt9LyNgZWrlG4nzkbbQrk16jwFxsMig4rTYDyCYc2Jp+luBB6l PotozgCRjAhFJ6/llfueMviG1C4fuF+KpN8tL9WccBOWDlLAjXM8u1soOB5Ez+6BzMpDiwYqB4u dhUoEJjrr+BdUSoiJWKGKdWzrSPlVWD2uVr4of8aY5XW8jUlL5EwGCyGcUq2gvPosZ7AakXg5O+ iz1QJ41xo1RXiYZ0T4K3yATdgWtl4+SrXKg5vQrbv+a8GUOYDrc7jUmph1xfdFR13UgOf5FUcbx bgfaueoToX88QqeDgUyfmf2wfgMQWr6A8j4sIRsTEgQ6dZYEsOpzYuQWiWf6OydudRDO6cPUQUC JcUPO5gh9obYmUR7NtuTnYcaINBl30Q== X-Google-Smtp-Source: AGHT+IEH4Qm9AP7+NHeYfdWtK9pBuj2LSPpwn+4k06/SOhpZ+3A1susz/ZhLEwfvy25zFmLYpWXAmA== X-Received: by 2002:a17:907:1c15:b0:b04:2214:9499 with SMTP id a640c23a62f3a-b04b1dfa8fcmr883911766b.8.1757354400301; Mon, 08 Sep 2025 11:00:00 -0700 (PDT) Received: from hangmanPC.. ([86.124.200.102]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b041565ca98sm2158185966b.86.2025.09.08.10.59.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Sep 2025 10:59:59 -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 v3 1/3] i2c: PCF8584: Fix debug macros defines of if statements Date: Mon, 8 Sep 2025 20:59:00 +0300 Message-ID: <20250908175902.214066-2-chiru.cezar.89@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250908175902.214066-1-chiru.cezar.89@gmail.com> References: <207f485f-df06-43a6-b91d-8153b8922089@web.de> <20250908175902.214066-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" macros: Enclose 'if' statements debug macros defines in do - while loops. Fix inconsistent macro usage ending ';', which caused build errors in some cases. Signed-off-by: Cezar Chiru --- v1->v2: - Removed space between [subsystem] and ':' in subject line. - Attempted to change commit message to imperative mood but I didn't understood how. v2->v3: - Formulated again the commit message to be at imperative mood. - Wrapped commit message to 75 columns per line. 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 02:04:12 2025 Received: from mail-ej1-f42.google.com (mail-ej1-f42.google.com [209.85.218.42]) (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 AEADB31329D; Mon, 8 Sep 2025 18:00:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757354410; cv=none; b=CNdFDuAtQZTenNAeo/pUF8WewiB57eQ+YS9OaH4tPaadlW52yZkDBYaahRPJU0aOueQyJFS8hqGCoNhwZh0lOdWiPXcPH7l911HjUPdq7eBOa30rptdm4kBs6aUne8cYSnMhVFc9spw6PbIfv6ErhBPHLkjdItxSDuLxk+4IfAM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757354410; c=relaxed/simple; bh=nbnLe17BewysZAff4eVCMKt7iSKn1+GYCNzSzRcSIS4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NEC6udW6udvKLRsIb52PdzirselSplcEyjvfDVYz2/49e/XDf0snTtWIelR02V26MGewIwhHyYNb1wD1Sax3sJ9rzH7li6B1a+JbtbCOw6eXJdDQUqr5vFN9eXLiJYW1FFfyM6o3pcWQns0LGQJJ4xVxMssg6lXnt+GVm4kI9v8= 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=DeaJlZpU; arc=none smtp.client-ip=209.85.218.42 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="DeaJlZpU" Received: by mail-ej1-f42.google.com with SMTP id a640c23a62f3a-b02c719a117so844091266b.1; Mon, 08 Sep 2025 11:00:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1757354407; x=1757959207; 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=ElkM4V1kYHxPpAH9h+TJiBnv91qoqyKJAB8yx+IWnd8=; b=DeaJlZpU15OjiSajyRSIQw/RdsoUJpEojg54v/ZCB3a9CTEGm75JCbPlAXK9tUPeup mUtWoqNipflEeQIngiVHPTLMNe41q3YMfwNvy0CYfoIxDj6+E5PGkliYKtqDoN0xwqFb f+T9zFx5CrIe5UbQ9MENcK9YPIlu/xqKDqoLeMvxhxx+TGB9Bn/mUGvMFmUaf1O8VSxK b+t9XnjX/fMz+F1LUmZ5qaPRTimy/O5x2EfjYJBwm5iuL1j8zsR52n/Etac0ThjhJ5dq JUFqT4IarueyGAoGH/sjkevLzt/npgvLYHH3GJ2tSCZ4FfqjZ/yXiAdD7om253dL0TWf +grA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757354407; x=1757959207; 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=ElkM4V1kYHxPpAH9h+TJiBnv91qoqyKJAB8yx+IWnd8=; b=lTQC8lO/XiKo0VA4uzhV3TQsc4lFruG4DUlMvl5/Q6TngGhXcb5hSUdufxZiJXGStp kTf4gJhsN/zAGZ6jTwwZepLNsgPTAEWGBoMtKK3fK2WJp2WFZG0xVLmYWRxp/c4HGCE2 RmRsle5zv60HKlkGT4tTTiBDbARAFRKa0BxZ90j7mVBpXrDM2y1KH/ozk1DQ1QqYbM5S 8L4z/NafoVy1WYzVnlt5Hxq8wYjJNP4AxoXT9SuEqVU3uAYmDVepVkvXhPK+rd8AxH6+ 6ki5ku68IelUt4IZ42g2tpwUjIVTLikeeZ5Z1ofI3rL1uFNWVRSnpak2HIqqq3KyekWQ yiNQ== X-Forwarded-Encrypted: i=1; AJvYcCVcBRePdf+I6w9RmlylMrUrkyKLeQZgCc6rPjTMvx1C1Ejd57F9Jy7W+QADvD13lb6QOFCiZ9jnDJtY8aY=@vger.kernel.org X-Gm-Message-State: AOJu0YxE0PRUnIJDC4//Ztdest/GKFOZXl9gkdz4bX+RquahzJMs6DLv 1oxePBWrqJLp4zqGDHKQVRuDAfg7KoOsz0ual45iYFfo94Ec0K2N48SC X-Gm-Gg: ASbGncveL9em+fMihahhLRfvCNNH3MFifMFSO6Vxf07OocrA44kHvUuIGCpy2rredsi I4ZpVTeipikJGrXvtx/L+9UA5TvLb2GCzWDwOGlQP9fdot77jNl8IFyjghYo0zBNWG5LkPAMkgt ihkyeo9CKPJZTHzJz7jYoCPsBk4pqsRh+LK/IR5qHoDzpyK/F0InQqdZ+2H90KqVA4dkt0JViAO XMUeIvamO06in+BV7OdFm2/aY9mU5VRvnVpqGg2hu0ComelUlrVniq45YWhxTVCFGGBbeH+CRkr ZAK0BUnh169PVwrgayklbQuYeuKycotlhKuWqY4dZtwU/0+jJrrg1APPP8XnBh4q7PvnUmNeB0S StEqCm0FX2XoqpfoBuAgJQ0IGqv4FKrGW6hg/89z2 X-Google-Smtp-Source: AGHT+IEFyFGvmHlwmLPffn6yEnCWPOlDOGImY85Hbmjn11b8E7v6Lhox+Zq5t1N+NSxWazwNdTzlkA== X-Received: by 2002:a17:906:4783:b0:b04:80c5:685c with SMTP id a640c23a62f3a-b04b1687e66mr873911366b.35.1757354406758; Mon, 08 Sep 2025 11:00:06 -0700 (PDT) Received: from hangmanPC.. ([86.124.200.102]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b041565ca98sm2158185966b.86.2025.09.08.11.00.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Sep 2025 11:00:06 -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 v3 2/3] i2c: PCF8584: Fix do not use assignment in if conditional Date: Mon, 8 Sep 2025 20:59:01 +0300 Message-ID: <20250908175902.214066-3-chiru.cezar.89@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250908175902.214066-1-chiru.cezar.89@gmail.com> References: <207f485f-df06-43a6-b91d-8153b8922089@web.de> <20250908175902.214066-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" if statement: Use of assignment inside of 'if' conditional is not allowed. Move assignment from inside 'if' conditional, to one line before each 'if' conditional statement that caused errors. Signed-off-by: Cezar Chiru --- v1->v2: - Removed space between [subsystem] and ':' in subject line. - Attempted to change commit message to imperative mood but I didn't understood how. v2->v3: - Formulated again the commit message to imperative mood. - Wrapped commit message to 75 columns per line. - Removed '' from subject line of patch 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 02:04:12 2025 Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com [209.85.218.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 25735314B77; Mon, 8 Sep 2025 18:00:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757354419; cv=none; b=own5+JWBIBoYyjnjJpvDoFc2Tm8+Au5ZBJmFKW3KyBFA2MC3iQVUc7sbGH7HWGneIL/aT/22Oy6UU2Tcf+gTMNKqhyQFG1+R2T8wNx5FKZ4QGwecNzDuZq2yocadY/Pjl4RdM23k+tFSWuO68HW4Hn/b/yCX43tUQXOvGKUW2To= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757354419; c=relaxed/simple; bh=c3CLTRu0keerVDXxScL4MPXF/RzwAi06iMw25dy2vD0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bxvGLIXeKNbVqcxmA9cdkOLbgkDkNBnxeb5w6Zy/kp06nig8ynLhLUtEpVd0+POMsRDqWXSZMCxvU6VFMHjZRSEGegxlcWNHKFqRu3sXzXeJch+XkYilIYdFdaRgEa6Um6kRU2n6XAmVlK1WXeg2q080ttYu6rTeLv75GNlUSuA= 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=lhU4VGlZ; arc=none smtp.client-ip=209.85.218.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="lhU4VGlZ" Received: by mail-ej1-f43.google.com with SMTP id a640c23a62f3a-b043a33b060so744658166b.1; Mon, 08 Sep 2025 11:00:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1757354416; x=1757959216; 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=Gxls2EHYjPxxhdiOjpth02s9db2rJFVFZtqLIMQlq5w=; b=lhU4VGlZLi68rEELeo0dvNJCDZa9+mZF/oO0aBArI+3ktO2x9yRcUP4UpsPXvY7mPt +mp/QbhMp1MFgpgRNpAALjO1zivERjTFV97VLwexPlmQQdcdRDpoRSudBUff0+iaHuQE MCzc93UdchCzr8nZVy9d9M6ai6Cf0WeVL84Dg8jtMOOj06/LAqWcCcpPSTNL5jJIMnvQ WDK/OA+AqbO28pOn9nIE4FcUSThSjRGGTJcRpu1CPqt8Px1026PFN2HM05ytnVNNTJl8 8l7PTaG/rs/RWhZXEfuLr8t+m3FvJx1MbefoGC0JhhZIt6oJhEq6xoUDB/LHZVxPMSDH kFWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757354416; x=1757959216; 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=Gxls2EHYjPxxhdiOjpth02s9db2rJFVFZtqLIMQlq5w=; b=EsXPbsQeemQKyqVayApN4FBhebNrAIaQ99vn16L5VaFrX2SY0gmDjvYwYfa1FGR+J3 14a/29F7PHKxgqacgKZ6rs0E2sx+ZgBytM0ODO3NjfitKE4XNLermMYC+VXYHhO/tu/q AiUPPkEInHjteH04soAbYO8C8V7qpFianwyClIRTCQ5djOjI9zxvCewvlQqgcM2DZrAC xxymoD0ir4fQkf+K7QPV70jtKnOvcwYYtGzT/I93i7rYDhQcxgxtEdJEokwccCWYuQ6P s+cTUmHDYyZAbeUUyzYprTc6aIcerWcnJw7Mqs8uiJENbSpd1iQtBZe91IbYJeHZZzZM RbXg== X-Forwarded-Encrypted: i=1; AJvYcCWgXrfZLeCFT3aIY5+N8k2Ef5W0mDju/yfzJUYnnDQ8uW0IoiFPRjfpiRi2pdT6HgEuuTezprihgs/FcXg=@vger.kernel.org X-Gm-Message-State: AOJu0Yx4LHqoUKxIxOlfltP9FkDXM8xd7Xu7XVhADbuyUFMAtjd0dKsB EGo9V5BHp68noJIWBYm9G72ObVzw0fvv0PKMxVteNgqECQ/Bru/L+O5V X-Gm-Gg: ASbGnct7+b0ihqNRkaPAWHVfB1LkdR3Vvofr+UIpLW8+NjvF+yagwV0sCzuUEyvRnhJ NBEqpxXMGu7Xq/sSflQXaljRVus7qVQigN2jaMLH6Ii7hvwCt7GurRpEZWZJh29uWs65HnMgq86 9acmzJ7XsW23Bw0paGnHi4UHdFX24+6+7HPjDoWsa0/jupHlGB86yJx6TsvXsVnQAhUF4N0LuOX ifPojHjzNTsuHo+pI+mNCDNear9obHgckGkiKieo7eAKT/dyDg6TabyYXhxhDx6wuIAq1lZGg1S AK5T/MyM8caihZIXZcKroojnk3fmCWgSN8/A2nZMd7lHHnjfPIaP/LIrFeMPtJa7wIhotUAHNZ0 E7xgtXqft13v+fm3Ldp/7QsqQdYmkSybjYxs/+pop X-Google-Smtp-Source: AGHT+IHFEMaJLE1CEX8SL7Z5xYZVh6yct8N6dbiU6ZOkNHy9CTsMFnVSWf4yFWdjV3EayIwo8/EYOA== X-Received: by 2002:a17:907:9414:b0:b04:a852:4f41 with SMTP id a640c23a62f3a-b04b1687cd0mr909967266b.31.1757354416154; Mon, 08 Sep 2025 11:00:16 -0700 (PDT) Received: from hangmanPC.. ([86.124.200.102]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b041565ca98sm2158185966b.86.2025.09.08.11.00.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Sep 2025 11:00:15 -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 v3 3/3] i2c: PCF8584: Fix space(s) required before or after different operators Date: Mon, 8 Sep 2025 20:59:02 +0300 Message-ID: <20250908175902.214066-4-chiru.cezar.89@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250908175902.214066-1-chiru.cezar.89@gmail.com> References: <207f485f-df06-43a6-b91d-8153b8922089@web.de> <20250908175902.214066-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" operators: Require spaces around or before or after '=3D', ';', '<' and ','. Add space(s) around or before or after different operators. Signed-off-by: Cezar Chiru --- v1->v2: - Removed space between [subsystem] and ':' in subject line. - Attempted to change commit message to imperative mood but I didn't understood how. v2->v3: - Formulated again the commit message to imperative mood. - Wrapped commit message to 75 columns per line. - Changed subject line of patch 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