From nobody Wed Oct 1 22:37: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 194D9158545 for ; Sat, 27 Sep 2025 04:15:18 +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=1758946521; cv=none; b=s0n/jY4Gkq6TiV0Mc1LkWdjZDqXBTH2cnXKjyjPUs4nRHP4PpwvrklVu3jZ7Xck3osS3NgfXiuKrwX435nGxV19ONEATmjjCqHXEEqEm2ainnWqJkmDadq7t+qjqU0IPUorpBH1hJ7gWeD4R2iPCLBEFfESGcs13v6j+tTwv9lw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758946521; c=relaxed/simple; bh=CAhmlVpNgjfXOj8lSkUQjgUpSSdRvC/yRyLgyFGBUv4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GcZwWy2AgYZIhMxrIVns+jyK8d5xvZvbjmNzZt1JcPUJQYwZyozYoRKT8QkI8UVnM7F93qVfI5IyWXUHykU6WC+nSrGVEsZVSB2l39t8VLY4OKUacn2DwHMQQlpUXiA6wM6fl+v3+/T1luCf3kYtPrLjJxGGZtL+QNnEQhhPnow= 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=I4/paOX1; 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="I4/paOX1" Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-46e384dfde0so25935025e9.2 for ; Fri, 26 Sep 2025 21:15:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1758946517; x=1759551317; 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=XsjCaRuVjABsOrX7YYvRpKJqzHL0cubRF6Hom6jKdNU=; b=I4/paOX193anl4+objMT7p7JjIvynp8etVhg33dnK363NdfAONY9qnMoCY2AAFVYQM jg/MvPyNgNIM8CgJWsZyfwhtsCuNqoLjcXXtLBAEOuZGR6xJ4oY/CjinJDwW56Hi0H7a yZS+SzPj6pDhuGhXcuu61pUGGnunFB4dBAcVG0RyLx4SxX4RjDI/p171UQDgLv+AJ7f+ qAj2/TNdnBct9fhMwKscQfsiGckTODsSNMASK4rfV4i3xJH3YbHRbH+npMc4yJMRhWnu eAM9AkcxnqDXWXLXHMmEewJc3gsq/ktUHEnX7lQ18AcMUZaOaMUw5LpuEunjB+Duc4/m l19g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1758946517; x=1759551317; 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=XsjCaRuVjABsOrX7YYvRpKJqzHL0cubRF6Hom6jKdNU=; b=VeRkoqIswE/bMADi0pcRf/fBjdEbfj3BZwv6BXvaITOwlGwiBD1thBCdI1YMj4MuNo S9n4fUJgD6ze8R7mQQQ37rz4J5X8wMPfhfg9rTABaDhwIjfrsWIxsJkDxjn1N7YKQUMA fUMbsJJydSJcXjdmiFvc8ZjngtTWepFhGlRk51Loj8ndBnfDt8/pPGaoenSdvT+HxX0R i8eLMjHV0LO7Ev0E3v2IoeZa2GH91H9HJ505BT6ECHezNCb8YZpDohcWjbyULebTjW+y Y5SaHN3/hpm7xoVMbvy5qtE8GLYZgK+mbsSsu6ih+fdiEPgA7dSZLuqqHtQqJo+o/SZf 2F6g== X-Forwarded-Encrypted: i=1; AJvYcCXz2kYcUg6kvXv5Ay8No1attUYRqG2S7o8KE9jQlnpc7xJjeieiDe1kRHfewTmWgKNPYxBxbc3TD40on7o=@vger.kernel.org X-Gm-Message-State: AOJu0YwCIlDFzUMd1hDLJdmRNWLBwyCO8RtVIXXOmEnXuvw31xSebavG brZ43HceflV5euEdDIrZNMdM6foVgOAHkyDQt8Kzl05z9uBvC5DL++pv X-Gm-Gg: ASbGncvtq4uonLi9sZdIwrQxqEVyE3wuu7Qp/MShXWvGHnNyRdXvhbVd4ldcEVRSA7j y750UjVpOucFooO7EWkz5u6Md5A+vCDuK4vdjOmyjA5cjNdOrXWiV0dmdwJ4rn43h2AAC2ms08m MmdIa3id4nC8pV1nyiZWWMEoQY7Jo5deCy/yJTeC0xjxlGIfMy92cygCUy0heqZj+JsD+MmVYSx VcysJaYFehHwBtEBBXAUl1xbJANb11Gner7lA7nfsrC2uEOpw5ejY2NCgfi/gr8yUeYawPyOt0K 0E7L3S9UZ4odqpGGhPZiNxK9eIYZppMHlBk4Zk3iT149MRQFJtNpn7JUYpwS92YtHXbshZyAIUO Xtbh9ZvTTHBxyNbUp1bwyXZppwIRBgg== X-Google-Smtp-Source: AGHT+IEPcTCyqVHiaP3/xNF/dla38CK58yAcvJfn7hE3rAnPGiZrQiLP4KgDRmqBXjwsRnQ8sbA6PQ== X-Received: by 2002:a05:600c:4508:b0:46e:3e72:a56 with SMTP id 5b1f17b1804b1-46e3e720b94mr37653005e9.1.1758946517224; Fri, 26 Sep 2025 21:15:17 -0700 (PDT) Received: from hangmanPC.. ([86.124.200.102]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-46e33105e0bsm50386665e9.5.2025.09.26.21.15.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Sep 2025 21:15:16 -0700 (PDT) From: Cezar Chiru To: wsa+renesas@sang-engineering.com, andi.shyti@kernel.org Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Cezar Chiru Subject: [PATCH v6 1/3] i2c: pcf8584: Remove debug macros from i2c-algo-pcf.c Date: Sat, 27 Sep 2025 07:13:58 +0300 Message-ID: <20250927041400.172949-2-chiru.cezar.89@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250927041400.172949-1-chiru.cezar.89@gmail.com> References: <20250927041400.172949-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" Remove debug macros and printk and dev_debg function calls from file as no change was done for 16 years. Request by I2C SUBSYSTEM maintainer Wolfram Sang. Signed-off-by: Cezar Chiru --- drivers/i2c/algos/i2c-algo-pcf.c | 59 -------------------------------- 1 file changed, 59 deletions(-) diff --git a/drivers/i2c/algos/i2c-algo-pcf.c b/drivers/i2c/algos/i2c-algo-= pcf.c index fd563e845d4b..7e2d8ff33d75 100644 --- a/drivers/i2c/algos/i2c-algo-pcf.c +++ b/drivers/i2c/algos/i2c-algo-pcf.c @@ -23,17 +23,8 @@ #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 DEF_TIMEOUT 16 =20 -/* - * module parameters: - */ -static int i2c_debug; - /* setting states on the bus with the right timing: */ =20 #define set_pcf(adap, ctl, val) adap->setpcf(adap->data, ctl, val) @@ -47,27 +38,21 @@ static int i2c_debug; =20 static void i2c_start(struct i2c_algo_pcf_data *adap) { - DEBPROTO(printk(KERN_DEBUG "S ")); set_pcf(adap, 1, I2C_PCF_START); } =20 static void i2c_repstart(struct i2c_algo_pcf_data *adap) { - DEBPROTO(printk(" Sr ")); set_pcf(adap, 1, I2C_PCF_REPSTART); } =20 static void i2c_stop(struct i2c_algo_pcf_data *adap) { - DEBPROTO(printk("P\n")); set_pcf(adap, 1, I2C_PCF_STOP); } =20 static void handle_lab(struct i2c_algo_pcf_data *adap, const int *status) { - DEB2(printk(KERN_INFO - "i2c-algo-pcf.o: lost arbitration (CSR 0x%02x)\n", - *status)); /* * Cleanup from LAB -- reset and enable ESO. * This resets the PCF8584; since we've lost the bus, no @@ -88,9 +73,6 @@ static void handle_lab(struct i2c_algo_pcf_data *adap, co= nst int *status) if (adap->lab_mdelay) mdelay(adap->lab_mdelay); =20 - DEB2(printk(KERN_INFO - "i2c-algo-pcf.o: reset LAB condition (CSR 0x%02x)\n", - get_pcf(adap, 1))); } =20 static int wait_for_bb(struct i2c_algo_pcf_data *adap) @@ -151,9 +133,6 @@ static int pcf_init_8584 (struct i2c_algo_pcf_data *ada= p) { unsigned char temp; =20 - DEB3(printk(KERN_DEBUG "i2c-algo-pcf.o: PCF state 0x%02x\n", - get_pcf(adap, 1))); - /* S1=3D0x80: S0 selected, serial interface off */ set_pcf(adap, 1, I2C_PCF_PIN); /* @@ -161,7 +140,6 @@ static int pcf_init_8584 (struct i2c_algo_pcf_data *ada= p) * PCF8584 does that when ESO is zero */ if (((temp =3D get_pcf(adap, 1)) & 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 */ } =20 @@ -169,7 +147,6 @@ static int pcf_init_8584 (struct i2c_algo_pcf_data *ada= p) i2c_outb(adap, get_own(adap)); /* check it's really written */ if ((temp =3D i2c_inb(adap)) !=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; } =20 @@ -177,7 +154,6 @@ static int pcf_init_8584 (struct i2c_algo_pcf_data *ada= p) 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) { - DEB2(printk(KERN_ERR "i2c-algo-pcf.o: PCF detection failed -- can't sele= ct S2 (0x%02x).\n", temp)); return -ENXIO; } =20 @@ -185,7 +161,6 @@ static int pcf_init_8584 (struct i2c_algo_pcf_data *ada= p) 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)) { - DEB2(printk(KERN_ERR "i2c-algo-pcf.o: PCF detection failed -- can't set = S2 (0x%02x).\n", temp)); return -ENXIO; } =20 @@ -194,7 +169,6 @@ static int pcf_init_8584 (struct i2c_algo_pcf_data *ada= p) =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)) { - DEB2(printk(KERN_ERR "i2c-algo-pcf.o: PCF detection failed -- can't sele= ct S1` (0x%02x).\n", temp)); return -ENXIO; } =20 @@ -210,8 +184,6 @@ static int pcf_sendbytes(struct i2c_adapter *i2c_adap, = const char *buf, int wrcount, status, timeout; =20 for (wrcount=3D0; wrcountdev, "i2c_write: writing %2.2X\n", - buf[wrcount] & 0xff)); i2c_outb(adap, buf[wrcount]); timeout =3D wait_for_pin(adap, &status); if (timeout) { @@ -307,8 +279,6 @@ static int pcf_xfer(struct i2c_adapter *i2c_adap, /* Check for bus busy */ timeout =3D wait_for_bb(adap); if (timeout) { - DEB2(printk(KERN_ERR "i2c-algo-pcf.o: " - "Timeout waiting for BB in pcf_xfer\n");) i =3D -EIO; goto out; } @@ -316,10 +286,6 @@ static int pcf_xfer(struct i2c_adapter *i2c_adap, 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", - str_read_write(pmsg->flags & I2C_M_RD), - pmsg->len, pmsg->addr, i + 1, num);) - ret =3D pcf_doAddress(adap, pmsg); =20 /* Send START */ @@ -335,8 +301,6 @@ static int pcf_xfer(struct i2c_adapter *i2c_adap, goto out; } i2c_stop(adap); - DEB2(printk(KERN_ERR "i2c-algo-pcf.o: Timeout waiting " - "for PIN(1) in pcf_xfer\n");) i =3D -EREMOTEIO; goto out; } @@ -344,34 +308,17 @@ 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");) 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);) =20 if (pmsg->flags & I2C_M_RD) { ret =3D pcf_readbytes(i2c_adap, pmsg->buf, pmsg->len, (i + 1 =3D=3D num)); - - if (ret !=3D pmsg->len) { - DEB2(printk(KERN_DEBUG "i2c-algo-pcf.o: fail: " - "only read %d bytes.\n",ret)); - } else { - DEB2(printk(KERN_DEBUG "i2c-algo-pcf.o: read %d bytes.\n",ret)); - } } else { ret =3D pcf_sendbytes(i2c_adap, pmsg->buf, pmsg->len, (i + 1 =3D=3D num)); - - if (ret !=3D pmsg->len) { - DEB2(printk(KERN_DEBUG "i2c-algo-pcf.o: fail: " - "only wrote %d bytes.\n",ret)); - } else { - DEB2(printk(KERN_DEBUG "i2c-algo-pcf.o: wrote %d bytes.\n",ret)); - } } } =20 @@ -401,8 +348,6 @@ int i2c_pcf_add_bus(struct i2c_adapter *adap) struct i2c_algo_pcf_data *pcf_adap =3D adap->algo_data; int rval; =20 - DEB2(dev_dbg(&adap->dev, "hw routines registered.\n")); - /* register new adapter to i2c module... */ adap->algo =3D &pcf_algo; =20 @@ -418,7 +363,3 @@ EXPORT_SYMBOL(i2c_pcf_add_bus); MODULE_AUTHOR("Hans Berglund "); MODULE_DESCRIPTION("I2C-Bus PCF8584 algorithm"); MODULE_LICENSE("GPL"); - -module_param(i2c_debug, int, S_IRUGO | S_IWUSR); -MODULE_PARM_DESC(i2c_debug, - "debug level - 0 off; 1 normal; 2,3 more verbose; 9 pcf-protocol"); --=20 2.43.0 From nobody Wed Oct 1 22:37: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 54A1D223DE8 for ; Sat, 27 Sep 2025 04:15:25 +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=1758946528; cv=none; b=fWozA/W1eIh3yHI/yiNgWLrVQ67/7hODGNI5rsT2KHDp8o/2gBvCkxPQxF8NN5sncKnM4DPB1Of5oRBgpFWAQ804WOg5vx+/4fPEPkp9N33Lw7tjgOztwN7ZoRO31NPMAoh2JqtogvHB7FkmNxsft4FFCuQpMLD67u9CPzZW6uw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758946528; c=relaxed/simple; bh=LHZjH2UMXa92SxXhNcHHvMGpkdxmO+gWMcsE10ROlWg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dRYP+XKS2dSYThkWUcHxMY9enIVmGoNko3H/1TK84Fn4yY64s8k9vPWMydZ5uhIb2QyhyMawS2WhPKGtO4y3CtqHNgRZ5fPd0kTpgwxIDeGoXZpRj+F6uiMA1nj7BWlELRjnJQF0w0KznfOZuK6Zio6iNw0kvPZusM0uLD7A7pU= 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=DFOMOzfl; 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="DFOMOzfl" Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-46b7bf21fceso21431855e9.3 for ; Fri, 26 Sep 2025 21:15:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1758946523; x=1759551323; 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=XH2k5qkD7Z3u1A48Y16IYSnGNDzLTVrlHvL80g4n3eU=; b=DFOMOzflpOL2I9f9ydLSwBOWHMIPZIQ2lRdiy7KYaV8p2cK/Zd+LFde4dofzfV3DEa PXnP+OI6Wv464/c6Ir4S03DEtfMvOn6tX3VwowqC73vBArm6mnXXhbpe7rVCauNwr6GD bU5lBjNtgCJulKvxPJhg/WkTKwMKXfeH+z9nK1wtGwwmbU4PGn29bKQvonorwJ8cUJ23 rEiiqvj8SlP1zweDsFUNVIUPk43UanFdaPhEWCcWQE2XNULFgqWlLbs+5ECDDJPn0aIl s7zajiR4s9gTFRYRIG1I7sJ+wNW3v53BB7UGWHcKUO+5KuMO0mrCt+36+/Tq5LH5Jrlj fdAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1758946523; x=1759551323; 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=XH2k5qkD7Z3u1A48Y16IYSnGNDzLTVrlHvL80g4n3eU=; b=RsLOgNXPWgfeu00cgd/jwJf6GPVuJAyn91d1ee6qk43Sx0BKN0qWMbuZILrrt9U/kW wf6BA2OL17VVO9DNwkusUh+sEhcbQKnaQLf/R0xwLPz6VDKOnTQaujaSnrGTbWO0733H ITzBpUwluQaEehSqpNasNuAJwOe7l7OhG8M0WvhbYUKMKbe/4yNwTCLfu06MvvDzgPXF uIPUvmK5zXx3thYMZ4RvVOF21pXUdi/ihV8AVYizCLr/joKyNIBEEnhoOciXiP26wOuG AHnYBH6VA0pIKDQZALuS6iwVXEPeX9yKozvCBLSIG0viNs23FJl2K2K9VPhnPdQz6MjM XWMQ== X-Forwarded-Encrypted: i=1; AJvYcCU0fl7nEA+C3hPxN0ZOyMwQL3fuhUhqj6yLI5lzQjU1GF4Cd9DA9quHfezC3iTw8uCeuve/Z+mPLDUClog=@vger.kernel.org X-Gm-Message-State: AOJu0YyiTtdksbRXhwwTi4hWnq6Nc7YhwvLvJYCoLA/WzOmvn7qLUSZZ KztkRlRBjO3wTqpWzKHv2RkjhLy096O1lhpZcQ9kTb3S2Un1tT6MADiY X-Gm-Gg: ASbGncuVQMY3rYnmF/dwHJbcE+2ah//q76iT2p3xHUVT47V0EJ0SnCOF2v8fiwmJ03E yFiqiath8/hYaVwCvsjEfTxdQTbYuKkAaJgbhq0djUzuyBWHITZfMmv+ksHIihHqtfsmIDUX6mX Dhvp96UBAsIxFXv5uKmluaAzR715+kUme+PjWMZ4nnweq4X+3ilwKX8DQOKxNo0G82OVEVO0d9a RWjxdFxP2RMTaK5fWWD7sk1lSdOndYfY+ktd/L8nD7lEGZ0PdKbUFFmCbFpU7Z2ZkBuK3PlBJ9W s1KGuJLxXwj8SdW6IWjJ7BL6ZP9i3K0WKzE4j9UHKIwo00ZuQquchzVIEBxlgM0iWLSbAUb7JS2 SbPT2u01+vLSQ5CAWEET8vD9ktKakxQ== X-Google-Smtp-Source: AGHT+IGpgauRDhsn4t5aFPP/pywj6JmzreFMpe4unJ8Z4K0kyhGOeKDXwdcaIKv1nQ+6SGVgZR2YTg== X-Received: by 2002:a05:600c:3e86:b0:46e:4784:cdf5 with SMTP id 5b1f17b1804b1-46e4784d03cmr2607185e9.15.1758946523514; Fri, 26 Sep 2025 21:15:23 -0700 (PDT) Received: from hangmanPC.. ([86.124.200.102]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-46e33105e0bsm50386665e9.5.2025.09.26.21.15.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Sep 2025 21:15:22 -0700 (PDT) From: Cezar Chiru To: wsa+renesas@sang-engineering.com, andi.shyti@kernel.org Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Cezar Chiru Subject: [PATCH v6 2/3] i2c: pcf8584: Fix do not use assignment inside if conditional Date: Sat, 27 Sep 2025 07:13:59 +0300 Message-ID: <20250927041400.172949-3-chiru.cezar.89@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250927041400.172949-1-chiru.cezar.89@gmail.com> References: <20250927041400.172949-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 | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/drivers/i2c/algos/i2c-algo-pcf.c b/drivers/i2c/algos/i2c-algo-= pcf.c index 7e2d8ff33d75..41a81d37e880 100644 --- a/drivers/i2c/algos/i2c-algo-pcf.c +++ b/drivers/i2c/algos/i2c-algo-pcf.c @@ -129,7 +129,7 @@ static int wait_for_pin(struct i2c_algo_pcf_data *adap,= int *status) * * vdovikin: added detect code for PCF8584 */ -static int pcf_init_8584 (struct i2c_algo_pcf_data *adap) +static int pcf_init_8584(struct i2c_algo_pcf_data *adap) { unsigned char temp; =20 @@ -139,38 +139,38 @@ static int pcf_init_8584 (struct i2c_algo_pcf_data *a= dap) * 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) return -ENXIO; /* definitely not PCF8584 */ - } =20 /* 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)) return -ENXIO; - } =20 /* 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) return -ENXIO; - } =20 /* 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)) return -ENXIO; - } =20 /* Enable serial interface, idle, S0 selected */ 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)) return -ENXIO; - } =20 printk(KERN_DEBUG "i2c-algo-pcf.o: detected and initialized PCF8584.\n"); =20 @@ -218,7 +218,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 @@ -351,7 +352,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 Oct 1 22:37: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 D2D528248B for ; Sat, 27 Sep 2025 04:15:31 +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=1758946533; cv=none; b=NerMSFuErlIAqaHgrgh9DDYFiUUxdwOoCtCWA8dlVyxY3JyX0IrH6XmwolglgpBA4GR2HaEwa2+bVOdTECN447QEZcrvVY7bHqu7E5i0X/yXO4DVEmQScCFTeGGbmWiLplGj35ktIMRUUsFnoMlIN2Z+i2ScP/cc9ykqseOwOoo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758946533; c=relaxed/simple; bh=1S7qkacQtOJLn4B5dSDEdf4PQhZDBi/JrvSfER614yc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WrD4zd6EPxRj3vwePSpPhnFmLT4X9SzUIwacIShCw2Pln+TK2VCzTfmzBz1ZV+mgivqtrHLOYW/DFBOW9Ml0ixq/5YW/PqL/H7hddAlvvjFx3zT6UGliwON5YW9itSJUkdXw24F423r7QbReIxHtz6XVWn3VawsOkI4K6oyvUP0= 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=TxH+Ebd/; 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="TxH+Ebd/" Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-46e23a6617dso28759595e9.0 for ; Fri, 26 Sep 2025 21:15:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1758946530; x=1759551330; 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=IQ5MmPkHxZioIeQfPFm5x4+gWD/pC2wMeHLaiRdBbYA=; b=TxH+Ebd/wfXSrcLxUmPbl+DDKzRyM+RLb7nNFfyfwo/vKj9UAThW/A9cK3eFa3fYOa QOKIDwbFlJDk/eaWHe/St26GBFfym6skNoznrbSGr/QG6L9NFIJqbxTHTwrWbNo9HZ1N HGbootu6KcU5YrumDKwMQbGolILgHvkcubwgyo4Rn4Ii9mswUpfbuVnBB4qJ0fhx6ETU DhFSUwmMT/rad8J0OKW4MsLGJGb1YqeaU3oBXzC2emxyHBhBs3rPmFcmk0ZVdNpP1f8r tFPKr/2oUr1NahuGQ4Pwg0aA1vUQq+NSx0vR8mYMmxv8BOw47DSt7tv7RdZmf8XjzYmZ A5CA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1758946530; x=1759551330; 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=IQ5MmPkHxZioIeQfPFm5x4+gWD/pC2wMeHLaiRdBbYA=; b=ixO25h3nD6mum7g5V0r1ucaDryrwpvlM4MXqwN+tmRb4zXQ0IJqSBHaRMI+NxwR0Dw /BpKtODtqdF3VvuTKLVDpSwr1KEzpadg+k9jncMT17GpbZG6T5tL+lJoplxho4rzKIe4 XxGOuNQD6hwvX/5Tfz3duSyIN5+j94D5wl/AVNbAD7liX3F1SFNBMOxeIWu/47MqUXq3 o8gF62luwGXvnyH5MFYVZPawdzm0HT+KJe1Ski+u2YaF4BPYI8RqiCS/xS4sOQ8QIdgR BKld0K8nBUZaC7jsh1vM1bqz1T8xIMlVPMHncVTUS8Y5e2H5FAoOEv7XVn/eQBzJ5exm NDLQ== X-Forwarded-Encrypted: i=1; AJvYcCXgLIBCIaW+pEmc7iBRpLD6LD8WwsYnDtTdtvDUkC+vaUqgaup0oVZpR5F5oURZTg9i+7eagiUhAyH+tWg=@vger.kernel.org X-Gm-Message-State: AOJu0YwARqjPKLawWW6t6DArLzkBWPjpfkV3DwgNHzWdpxxtYYl1Y23y KOmNw1brK03QfZ0Yz759HN2/pdXeAO5OnEcjJ1eY10EGiCnQYsRYd0CHsED61A== X-Gm-Gg: ASbGncsMNfkuC0vcnA3Le4DRq0dIVNDjy6DYpZq7EtnQH5SnNVmeDDTvW/x3gGvQzu1 willN8mK2wNoaSbYWiLMxt+b8MrHdHtlyYOaJ4TmjtSH1ZS/bmGK8bKeCThn2vVHtQEJa9wTsKu Z9eFPJsqllv6rXv7viI6TOkrPDsveUy9syvCqY9KmG0WiLDeP1Bw3JvLm3Iw2S1mhgVA3YGQD4K xdMhDaq5INIMI67cy7HauiOz2BdFJ6ahqjWv+neQdxHsJ2u0zkU9oYriTWxLuf1nZOm5R4KG/NO +/wlysHrkgNIgmNyRrcZeT/y9bMVLHWp/hMToQJ7uk/faA7B3d/PLYtlH5BymoN+9RrrUgJg6oA pmVUgporVw09AFSCwvHM1v1wKkxUY4ivtufO2Qqg6 X-Google-Smtp-Source: AGHT+IHNltIrUty9L1vjsZ4/Hwqq3Wgf3VB8CTDHf03NWXIxmr7SHAgznCOWO2DvuwbAOd1ynDRO+w== X-Received: by 2002:a05:600c:4e8b:b0:46e:38cc:d3e2 with SMTP id 5b1f17b1804b1-46e38ccd4dbmr47800515e9.22.1758946530076; Fri, 26 Sep 2025 21:15:30 -0700 (PDT) Received: from hangmanPC.. ([86.124.200.102]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-46e33105e0bsm50386665e9.5.2025.09.26.21.15.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Sep 2025 21:15:29 -0700 (PDT) From: Cezar Chiru To: wsa+renesas@sang-engineering.com, andi.shyti@kernel.org Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Cezar Chiru Subject: [PATCH v6 3/3] i2c: pcf8584: Fix space(s) required before or after different operators Date: Sat, 27 Sep 2025 07:14:00 +0300 Message-ID: <20250927041400.172949-4-chiru.cezar.89@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250927041400.172949-1-chiru.cezar.89@gmail.com> References: <20250927041400.172949-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 '=3D', '>' and '<'. Add space(s) around binary operators. Enforce errors fixing based on checkpatch.pl output on file. Signed-off-by: Cezar Chiru --- drivers/i2c/algos/i2c-algo-pcf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/i2c/algos/i2c-algo-pcf.c b/drivers/i2c/algos/i2c-algo-= pcf.c index 41a81d37e880..d675d484fe66 100644 --- a/drivers/i2c/algos/i2c-algo-pcf.c +++ b/drivers/i2c/algos/i2c-algo-pcf.c @@ -183,7 +183,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; wrcountalgo_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); @@ -284,7 +284,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 ret =3D pcf_doAddress(adap, pmsg); --=20 2.43.0