From nobody Wed Oct 1 22:37:09 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 65459223DFF for ; Fri, 26 Sep 2025 15:46:21 +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=1758901583; cv=none; b=ADZTJqQSBWhvMgZ+OozKFkHUjo6MLe9gQ1gwyx3ZoV1YzcirlqJBLiwY4LZ7yKQNbTMABJj8hk4zoFdAXxMcR4UMuqv5yzJ1oF40o8WK/cDahpCCrrY1SyTU/Tw4cSIcYJ9jzepn9mbKtkC9D2xyVeINNTl0kyj9AMmBtAi+kNY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758901583; c=relaxed/simple; bh=G6JEcT8G2/8sDchY2PsdInwUeTIGTLznNgglrJII2ho=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Bx8XEt4MsV0lBi5epUD7y/Y36Q4k+zvTrm+s/txVGJiVbGXjuoBdXU0qB66ZS1WgDSS0/9vBuM3pTxyAoKQ22LEOFD/xUytdfKGWEK/w2MfzeTJO//bAr10zUg30O+/LYH/J6hbiRAte8P0djFBXdRK7DxLv7JbYdkoY638RO5Q= 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=Zeg3gkqR; 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="Zeg3gkqR" Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-46e2e6a708fso13999405e9.0 for ; Fri, 26 Sep 2025 08:46:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1758901580; x=1759506380; 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=jVSoAzHry56rTyovTSJD65Fgy8GO0QeGApGj/x7GoPI=; b=Zeg3gkqRMTMoreyEJPeYHpD2/suLxYajRGoJIJrsVINZDoyKhQEb1p1XyNlDh+xpw/ wjH0T0NrjhhW9ovhDUOvYgUgKPMK9VUrVnEGXqEMr2H88W9QZoEdY1/uR5IyuiPy7awG VzY5M1ecfysDT9ZHc0Ewj/oQphoBkM3rQuG+sb2twq87M4n5pfrfrLdLsOXSU6WFNZZv FRhfYTQF8TG4uwiXg4883cKp/mqe4zlBCyHzRHpQwj4ec0R1QO3EtUIO5EUirWAHc3yV gD0PC/SyKXYxtFVXl+Pjd3hF0YtKJzectbiog3mHIBjJ51SGr+vLKjMktSJuKpAv/0do 6s9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1758901580; x=1759506380; 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=jVSoAzHry56rTyovTSJD65Fgy8GO0QeGApGj/x7GoPI=; b=HTRoDBLJfhQLBIlsmocAHU/onLSF61K1VUWP3F3MQSaozcRzpKkIenC4dx2I1rzvt3 JA4A2ZUoZOmmoFDTSps0NDRZPBrrLj8uDHOHtzC6idfjTrfz2nrYRV58LGNQa6nQwBw4 h1AkQQYunqp581mnO7oYYzYcTeymXFxjMsSGt89LCLPhvFkjZrKId3l5R/+TKTCvVQv3 /WbShkWMqahcuNmykjgTo5rdqintAFxjeM3j+tNnuHC1JTRddLxzpxS+swZ5i6bBzalj Y0Hd3QRgfp6pO108kZwHuFt6fYvNDN4nO3aV7YttMTorIeeZV3Brrjch9AsHY9PQi8a3 9Wmw== X-Forwarded-Encrypted: i=1; AJvYcCX+Xsd4OEK/pIfArbVWi9cnYhfRBIhOYsCNdp1M6Z/6Esbu8xJ9quAO3btgUu77o3E9CJmIK3l9Q7tGhtQ=@vger.kernel.org X-Gm-Message-State: AOJu0YzRr+S+7UKIFqWSWsF3EFsjjrY7FTJldRNGwI2r14iQ9Z1F45V+ qQ4EjP1HaHbS67a8NKt6fmiSZJ9XoSFLylY8dvYwuz6cVslcFAHhJWIA X-Gm-Gg: ASbGncs1ZtjR21HKic5uc0WYonMjlBNGVtTn0YQy5NdynANM9T59IL3ClhW0nw1w5ZA 0cZNjleEcvYRArgYcmDaSE7+9EidpT5zWsDNp0axOenuD2bXkgvvWs4ssgpRX6vjyPvcromIh4N okfwHK835kD2SDOifj1lKm71puA11Zs1yUUAdgLBxvfeGPl9PELvwmmXOt2hP+sQq+ekjZ2sAJR vm4qCdr3GgexxFOcC6VViam8sbj8r5nZeUtDVVIY9Ux0iCUUymlxUZO90mm9R31q78+TMHNQOKp R9hRMBK1n/01YQ6M/+kGl/0HhmjCFWohuIDmr1DTpjt6iOSoo6J9uwhTCJiS5cjwD9LvWHm3/cB rmDJs+PN4kmocrnLGpQeBXY39OKXKGYx3efpQw6fhHH1W25f5HDI= X-Google-Smtp-Source: AGHT+IHC9MzVHOVrOCsaJR8/rfIdxDy/QNivNBbF5FndmQsqyI42tzg0tECR+wZ3LOdRwgLs/ROPUg== X-Received: by 2002:a05:600c:190e:b0:458:c059:7db1 with SMTP id 5b1f17b1804b1-46e329fca6emr93350875e9.30.1758901579551; Fri, 26 Sep 2025 08:46:19 -0700 (PDT) Received: from hangmanPC.. ([86.124.200.102]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-46e32bcd016sm41680005e9.1.2025.09.26.08.46.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Sep 2025 08:46:19 -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 v5 1/3] i2c: pcf8584: Remove debug macros from i2c-algo-pcf.c Date: Fri, 26 Sep 2025 18:45:18 +0300 Message-ID: <20250926154520.40583-2-chiru.cezar.89@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250926154520.40583-1-chiru.cezar.89@gmail.com> References: <20250926154520.40583-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 from file as no change was done for 16 years. Request by I2C SUBSYSTEM maintainer Wolfram Sang. Enforce errors fixing based on checkpatch.pl output on file. Signed-off-by: Cezar Chiru --- drivers/i2c/algos/i2c-algo-pcf.c | 78 +++++++++++++------------------- 1 file changed, 31 insertions(+), 47 deletions(-) diff --git a/drivers/i2c/algos/i2c-algo-pcf.c b/drivers/i2c/algos/i2c-algo-= pcf.c index fd563e845d4b..d4d82f3729d3 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,26 @@ static int i2c_debug; =20 static void i2c_start(struct i2c_algo_pcf_data *adap) { - DEBPROTO(printk(KERN_DEBUG "S ")); + 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 ")); + printk(" Sr "); set_pcf(adap, 1, I2C_PCF_REPSTART); } =20 static void i2c_stop(struct i2c_algo_pcf_data *adap) { - DEBPROTO(printk("P\n")); + 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)); + 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 +78,8 @@ 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))); + 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,8 +140,7 @@ 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))); + printk(KERN_DEBUG "i2c-algo-pcf.o: PCF state 0x%02x\n", get_pcf(adap, 1)); =20 /* S1=3D0x80: S0 selected, serial interface off */ set_pcf(adap, 1, I2C_PCF_PIN); @@ -161,7 +149,7 @@ 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)); + printk(KERN_ERR "i2c-algo-pcf.o: PCF detection failed -- can't select S0= (0x%02x).\n", temp); return -ENXIO; /* definitely not PCF8584 */ } =20 @@ -169,7 +157,7 @@ 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)); + printk(KERN_ERR "i2c-algo-pcf.o: PCF detection failed -- can't set S0 (0= x%02x).\n", temp); return -ENXIO; } =20 @@ -177,7 +165,7 @@ 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)); + printk(KERN_ERR "i2c-algo-pcf.o: PCF detection failed -- can't select S2= (0x%02x).\n", temp); return -ENXIO; } =20 @@ -185,7 +173,7 @@ 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)); + printk(KERN_ERR "i2c-algo-pcf.o: PCF detection failed -- can't set S2 (0= x%02x).\n", temp); return -ENXIO; } =20 @@ -194,7 +182,7 @@ 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)); + printk(KERN_ERR "i2c-algo-pcf.o: PCF detection failed -- can't select S1= ` (0x%02x).\n", temp); return -ENXIO; } =20 @@ -210,8 +198,8 @@ 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)); + dev_dbg(&i2c_adap->dev, "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 +295,8 @@ 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");) + printk(KERN_ERR "i2c-algo-pcf.o: " + "Timeout waiting for BB in pcf_xfer\n"); i =3D -EIO; goto out; } @@ -316,9 +304,9 @@ 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", + 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 @@ -335,8 +323,8 @@ 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");) + printk(KERN_ERR "i2c-algo-pcf.o: Timeout waiting " + "for PIN(1) in pcf_xfer\n"); i =3D -EREMOTEIO; goto out; } @@ -344,33 +332,33 @@ 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");) + 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);) + printk(KERN_DEBUG "i2c-algo-pcf.o: Msg %d, addr=3D0x%x, flags=3D0x%x, le= n=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)); =20 if (ret !=3D pmsg->len) { - DEB2(printk(KERN_DEBUG "i2c-algo-pcf.o: fail: " - "only read %d bytes.\n",ret)); + 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)); + 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)); =20 if (ret !=3D pmsg->len) { - DEB2(printk(KERN_DEBUG "i2c-algo-pcf.o: fail: " - "only wrote %d bytes.\n",ret)); + 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)); + printk(KERN_DEBUG "i2c-algo-pcf.o: wrote %d bytes.\n",ret); } } } @@ -401,7 +389,7 @@ 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")); + dev_dbg(&adap->dev, "hw routines registered.\n"); =20 /* register new adapter to i2c module... */ adap->algo =3D &pcf_algo; @@ -418,7 +406,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:09 2025 Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (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 5708C22B8B0 for ; Fri, 26 Sep 2025 15:46:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758901603; cv=none; b=kbmcuEZmLAian8SJGvwM0HNNVGnTBAlV0qD1hODlDR/h1kOOZWvzDMA3gZ0Qe3u/YXe1pRjtHSviQ2L8M6GL9OA1rl2q2bFIOUN0DIobEB7o8Ld8y19jTI8u48IxsSyQfFIMzerwYiJIxNRp7WSG9IIWc1Lzqf3lzG3OoF7BqIk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758901603; c=relaxed/simple; bh=izxo3ytX2ky75prMgX2DgMzwqLU8Fc5i50fDUC6VwRQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Pz5/Afj0AzvCLH4ijfpSKHN//wQ+3StgN4GmI83wSvCnbLwHvkn3NHbd4NEp5Jf2YmpyLhicAzxxZu6fXfpZZVFBzuFhq8VcO9ZUpFfqPc7uWoJtU3CmXfoKuzFb4scw87zZbFzjWvmHWZZC/0wTHa+lL/77dSK1AQn9/81PddA= 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=Co211V1K; arc=none smtp.client-ip=209.85.128.48 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="Co211V1K" Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-46cf7bbfda8so12779445e9.2 for ; Fri, 26 Sep 2025 08:46:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1758901600; x=1759506400; 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=Vyjd34dpouHtYVk7+69nnp/gLrS87XY89ac0686uOuA=; b=Co211V1KRseMMADs8x1nCsYi4iw20FPQ85RXqmIl3HB3qsSIO4zE3M5J8TyM1ixzDP XdCkA3Zz5tC0cH0TgwkIXlt83zLg4m9ZGw0HAA78412Ouoy330vjPQMaKvKMuuMWzl+Q pARGIiRF4Rv8SJ5ZYvU20O7sdvSw5ON8JGsDa4uQavf06WCFcPvGXrHGg5sQ9GVyI66e gD4qu9nJNQtbKwiazUISGJXemwyj9fEL+tJEQaH3VhY3q+/r4GtoDjRDOUWlQTLv5veB 64vnedQVg5f1yrN5rmz1vhEJQ6ZYVeVMPSg1LP8x2PdblxQg1QekTMIAalSvd1ZEeSM1 OUgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1758901600; x=1759506400; 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=Vyjd34dpouHtYVk7+69nnp/gLrS87XY89ac0686uOuA=; b=UlHAXeAgljI1hUUXqNE8TrYqpNhT/FDS2eB0zjO/5ii/8k6skGGp3xdHNCQzO5SAj+ wcGXeGJz7Uw7irnG4ZtpmtuWGXvmwUrw7VGasUTEeqnpECwI/YYTkeioFGurLKdGd5QO 1Ajy6ZzscssSKSoRxc50Mzp7aI+YOoBt/LxvihQNG0nhBR0pIV3KN240EQaywA1GyIzJ OatlfklWQaWSSF3dYxMS0nU1IoVBy6x31owTjHxqmAi9SgiLIjqMvF6YkhtoXnGUKDeH NQl+SOFItau6I0cY8KHQ5WbV5Ctb62HZw4XPK2SKJRlf1jAv71cmDNqu13Sf6OVdSOQ1 KAow== X-Forwarded-Encrypted: i=1; AJvYcCVVrkwv2YJnAbAWaGXmfpGm8OJ0zyGlJQPeEdI+9NZRrsR0LZvRVAd2mgLq7NqZwh5KrUPO4aYd8jUud0I=@vger.kernel.org X-Gm-Message-State: AOJu0YxWRU4e1quLlOt7FSMg1RVX4wzyhYIgK08Ftf6dlwWLXRqtjFtr oggqG68FQtPJhDR0zNk4ZO2a73BwiS41thATU0Tu3CaZwlteeVQDiZnw X-Gm-Gg: ASbGnctzA/VqCXfwvc1Po1wJucMd4Rj8DQGKshoqlzNxAbXU+n5R+kMBJu4WD132VFg 8hJrntg3tv5Uf0s/UiH5Pl29afgWdMCMyInlm1+BDJ+yQxhYz1CXiOoJNXZCyO7GMnqkGQX3pGS I6ruMAZ7NGz0qOA/YThIh4OQyqbjktbbqBMyCouXOSLhZjpIc63dunvnPhMgSowgsxYwWF7LuMA Sy2ve06hGCBi1sBBiw7rt6Do2nHuqkxVoKISz6Dz5X18nICtqX5Jx8+wAEnS4y6W/cNUwZNAZdJ g7G6EmCZDvLCFAtkEosOhpn4/VbSHoOLVKFOXWJkdWuUnxXKWyBlf+A/V4iFftnlcobum+2Vjlo CIbh5dWM0bqRHubagwtfp+yPFsDZCpg== X-Google-Smtp-Source: AGHT+IGhhkmyEQtreInOjJEwlkT0VZ/84Cyff8vq+9aMQpAeAZgSoLH6iUa3PKUXGrgvGvL5GvnuKA== X-Received: by 2002:a05:600c:3f12:b0:46e:41e6:28c7 with SMTP id 5b1f17b1804b1-46e41e6293fmr25386685e9.8.1758901599404; Fri, 26 Sep 2025 08:46:39 -0700 (PDT) Received: from hangmanPC.. ([86.124.200.102]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-46e32bcd016sm41680005e9.1.2025.09.26.08.46.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Sep 2025 08:46:39 -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 v5 2/3] i2c: pcf8584: Fix do not use assignment inside if conditional Date: Fri, 26 Sep 2025 18:45:19 +0300 Message-ID: <20250926154520.40583-3-chiru.cezar.89@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250926154520.40583-1-chiru.cezar.89@gmail.com> References: <20250926154520.40583-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 d4d82f3729d3..c856f4c8e3de 100644 --- a/drivers/i2c/algos/i2c-algo-pcf.c +++ b/drivers/i2c/algos/i2c-algo-pcf.c @@ -148,7 +148,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) { printk(KERN_ERR "i2c-algo-pcf.o: PCF detection failed -- can't select S0= (0x%02x).\n", temp); return -ENXIO; /* definitely not PCF8584 */ } @@ -156,7 +157,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)) { printk(KERN_ERR "i2c-algo-pcf.o: PCF detection failed -- can't set S0 (0= x%02x).\n", temp); return -ENXIO; } @@ -164,7 +166,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) { printk(KERN_ERR "i2c-algo-pcf.o: PCF detection failed -- can't select S2= (0x%02x).\n", temp); return -ENXIO; } @@ -172,7 +175,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)) { printk(KERN_ERR "i2c-algo-pcf.o: PCF detection failed -- can't set S2 (0= x%02x).\n", temp); return -ENXIO; } @@ -181,7 +185,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)) { printk(KERN_ERR "i2c-algo-pcf.o: PCF detection failed -- can't select S1= ` (0x%02x).\n", temp); return -ENXIO; } @@ -234,7 +239,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 @@ -394,7 +400,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:09 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 4540122B5A3 for ; Fri, 26 Sep 2025 15:46:49 +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=1758901610; cv=none; b=od4JyUZxqTwT3xgR7QvW7EDdEPB3+NPdb/xPWc+3ynPz329PfykygPvX/PhWI6Cr5F6n0g86/i2GOgfwE9DiN+Yt1HAR372OEBKckLo1Ads1WiIww7Ry+4aGQ9lucjDMCh8/y1mXeGmAhGiNme/+d1+9CafTow6/eXNf6DBNVkE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758901610; c=relaxed/simple; bh=WqFWle31hBLkKv2QftvcEgFosu5gxLiADdg1aI61w3s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lu4PKMD/wdhiR4oQn3PklVNBmLzZpucxMC0TTKD01JVlqJ4P7bwB3pqYs8o8pCw3OSoAMU/Z5OaqrAxOrMbyCjJT0PUyRXc3NP8nPRsXCJqtVbPmC0i/Res5tGU1K7ZzvHBye/k5Vx5wSm0F9bSP+QxAlzS2g4R03vkZTOUr0yk= 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=fytdoeUE; 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="fytdoeUE" Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-46b7bf21fceso17709495e9.3 for ; Fri, 26 Sep 2025 08:46:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1758901608; x=1759506408; 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=F/EQ7xD3PN8A2TUdrKeEw4dzE8F5BLQWtv40TOLd2H4=; b=fytdoeUEePi8WDCcScYZTpGXNNgKzNKQYQ3U/k1bApbsucXc2mxwaFHPV7w0kyN7sg 2mkKcoug21RJOKjxT3gybWSRa+Os9s8NBjNJwHzWbB0RyL1NNCMtwTzlSg9Gf4qKAg+A PvkcpC1Hthi6gbzNLrbSDXlzKSA70aZJ9RvcR12kRorG3VyPeWiVWSTSkY+Z/D/Gnc6T kf7WCRYqRIbNCNMkxuz6kMWxezVUCwvz2hGSqjc1CHm/GMPGWkRknX7nYHuj9A0u2MqF 4oc9YY/5KqpgUxOcw+J+Asj+r04Un5fFtMDbWtFf1iPcgTxlOJI4x4MoODZ/y3wZPoYV +TeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1758901608; x=1759506408; 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=F/EQ7xD3PN8A2TUdrKeEw4dzE8F5BLQWtv40TOLd2H4=; b=t11JmG0H9o251wVWFq8V1eI4SCnoi1A0sQMSsxY+DrZ+VX88mziXO3uGtZIecAyLj5 3zG9JM5jjVctdmm8FYpfImccVqAcI7qO8VT0Q29f3oEEiFWbu6FI2cPEW9jW31ILSept W8/EvRxFkv7a+B1VM9aFOx7JDmbMkcM7zNVTv+FTXwGudC63xYQYYY5+HF5atjaIF1cY INQYlCFxvj7APpe1p2LRPbZ1oPbVgToXHlfjVpXsLLWe1Xfn3Ked3D6v99lS1+opBnNp qMaAL6iC08ExrzhnnJOR1NO92rdRBap6x+rZU34ohC1KFENEJMskfLYoK62nwdPcJQS4 e9pQ== X-Forwarded-Encrypted: i=1; AJvYcCU2EYjlQJwgYArcIOigA7jEdJvXogOZWBX49F86r+ctLOW4Ijf6mX6UoNgSlAuJQQXG0QV2f/P2kXinX4w=@vger.kernel.org X-Gm-Message-State: AOJu0YxRXg9ZWYF9l5AlmjeBs33e5IXHpzWQjAsjDbbDqKc2mH8Egjif I6Ta1kRtCsoQZv4aIFx+Zx8em1B3TG10QeG5O5UgzqGZC3LUOPHStWXZ X-Gm-Gg: ASbGnct09QLf/YVntjcrfwvjq29Xtme/2w3YYXmh0shE5sCd//W5q6xXvy3Q7eDFAFY XWlbb2xMYJXJxnZfe/u6cRyzHostoQeOVoqPaTwJzmpB4olnzmISnSQNfQvT7yFBehQXzxQaJPE 4xB6jziRKHf+OPNsbk+ft9TdYmVeS0LMrxw3juN5ZgG6Cg08tx2Wj2FPDPGChFC4frxuTw0dWmM 2g0ZwXXOxp3qO1YxJ2XHM3pEUAaIzFNOHaXHksNdavYRe+IYWT96i6Mon7ggxXvB7NCKK5lpZa0 z8aiuhDarfTuovTfBeUd+KWjAZ+gM/vEKWfrxT8jIYu6w8S9hEnnv4zV0RU6KvC3SEkehQ1rqcm O3PuNrPLVt+pCH61vVeTNIAFlcueEIleRYDMISd14 X-Google-Smtp-Source: AGHT+IGmRrUsID/iMYO7L+HhZanavQv5O4am0JMpzo//A4tQNmtSyeXyqAUk+hX/oDh/sCWPF8+cTg== X-Received: by 2002:a05:600c:608e:b0:45d:dc85:c009 with SMTP id 5b1f17b1804b1-46e392534e7mr50482665e9.10.1758901607613; Fri, 26 Sep 2025 08:46:47 -0700 (PDT) Received: from hangmanPC.. ([86.124.200.102]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-46e32bcd016sm41680005e9.1.2025.09.26.08.46.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Sep 2025 08:46:47 -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 v5 3/3] i2c: pcf8584: Fix space(s) required before or after different operators Date: Fri, 26 Sep 2025 18:45:20 +0300 Message-ID: <20250926154520.40583-4-chiru.cezar.89@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250926154520.40583-1-chiru.cezar.89@gmail.com> References: <20250926154520.40583-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 signs. 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 c856f4c8e3de..8f7421794a7f 100644 --- a/drivers/i2c/algos/i2c-algo-pcf.c +++ b/drivers/i2c/algos/i2c-algo-pcf.c @@ -202,7 +202,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]); @@ -293,7 +293,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); @@ -307,7 +307,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 printk(KERN_DEBUG "i2c-algo-pcf.o: Doing %s %d bytes to 0x%02x - %d of %= d messages\n", @@ -352,9 +352,9 @@ static int pcf_xfer(struct i2c_adapter *i2c_adap, =20 if (ret !=3D pmsg->len) { printk(KERN_DEBUG "i2c-algo-pcf.o: fail: " - "only read %d bytes.\n",ret); + "only read %d bytes.\n", ret); } else { - printk(KERN_DEBUG "i2c-algo-pcf.o: read %d bytes.\n",ret); + printk(KERN_DEBUG "i2c-algo-pcf.o: read %d bytes.\n", ret); } } else { ret =3D pcf_sendbytes(i2c_adap, pmsg->buf, pmsg->len, @@ -362,9 +362,9 @@ static int pcf_xfer(struct i2c_adapter *i2c_adap, =20 if (ret !=3D pmsg->len) { printk(KERN_DEBUG "i2c-algo-pcf.o: fail: " - "only wrote %d bytes.\n",ret); + "only wrote %d bytes.\n", ret); } else { - printk(KERN_DEBUG "i2c-algo-pcf.o: wrote %d bytes.\n",ret); + printk(KERN_DEBUG "i2c-algo-pcf.o: wrote %d bytes.\n", ret); } } } --=20 2.43.0