Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp776399ybb; Fri, 20 Mar 2020 07:56:23 -0700 (PDT) X-Google-Smtp-Source: ADFU+vu9Xtk962rFYmtKwWWM6u91NVZJTLE8wbchIKZEhxRONjmkxiUrS5bcMCaSSxfjjgFm5L1h X-Received: by 2002:a9d:336:: with SMTP id 51mr7124828otv.202.1584716183732; Fri, 20 Mar 2020 07:56:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584716183; cv=none; d=google.com; s=arc-20160816; b=vFzZzBs8kxS8sb5NADGqEp3BpLrV96HZKmx/1WAIQeVAMZW4zsje6pxPXR8FFdK8q0 sFWeZyCyKEevfonWL5RTeFehaRS68vqTPwwdTQRoAXDMx1Qt5wqfc4I8TyIiRmmWbGSJ VPaPkUedcIY9OMnxP9QkIhhFKA4qWyaL9bmioiJMAcNLZ07ZEV890Dfa2qlifZ4S1W62 6WTGSsvvOZknSYWDVasgKdDQSnWVLaKQaCWuhHkOqrAYCaWJ0qsn8GWG+IjOsSJq/49T Ga7YqzXzgk+B+lNbrFdZ2HvM/jjJBb4gSFJjJXCe5GhmvAq0FhqiaHoM/bHvEvDKXVfj 4b1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=3by8HHqdb60xLrqm8mG6ZlzXiSIdGjkVHvmrucvJllw=; b=mNJLQ1pgl2nVNZ0YqOyqzyyRiSHm1KMSNrdbVd1fVqrVWhYaC0ShPpnFlzVBygZQc6 Ax3+r8Tn1SiRqdaoLE6TJpRQ71jUGLBG2F47OT2lbVoYvSrPkRozc6jDSAQZlmrsj/bK xQZGkPRnW+JRE/gjbeCW2cnPRRKryH7wxsXoV03IeKoYePdqcLdMcFvVA9uJkOeXIdkg 8M8BFbH0qjMXXaq2T/uyloB2J8JdVeGYKq5Oy3XaCg8biM7NCfQG2tV2Q4mwlli0ti7r p9r2B4J1CKMz59HhhznC6jfnaCu5K1Ps/UZMclKxf76E+hnFoUl4sONKQRSy6RzEU/N7 4IsA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w10si3122580oti.165.2020.03.20.07.56.10; Fri, 20 Mar 2020 07:56:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727516AbgCTOzG (ORCPT + 99 others); Fri, 20 Mar 2020 10:55:06 -0400 Received: from sauhun.de ([88.99.104.3]:49310 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727497AbgCTOzF (ORCPT ); Fri, 20 Mar 2020 10:55:05 -0400 Received: from localhost (p54B33339.dip0.t-ipconnect.de [84.179.51.57]) by pokefinder.org (Postfix) with ESMTPSA id 0182B2C08E7; Fri, 20 Mar 2020 15:55:03 +0100 (CET) Date: Fri, 20 Mar 2020 15:55:03 +0100 From: Wolfram Sang To: Federico Fuga Cc: Gregory CLEMENT , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] i2c: mv64xxx: Implement I2C_M_RECV_LEN and I2C_FUNC_SMBUS_READ_BLOCK_DATA Message-ID: <20200320145503.GC1282@ninjato> References: <20200118115820.9080-1-fuga@studiofuga.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="1ccMZA6j1vT5UqiK" Content-Disposition: inline In-Reply-To: <20200118115820.9080-1-fuga@studiofuga.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --1ccMZA6j1vT5UqiK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline > + /* If we should retrieve the length from the buffer, make sure */ > + /* to read enough bytes to avoid sending the */ > + /* STOP bit after the read if the first byte */ Please stick to Kernel commenting style. > + /* length=0 should not be allowed, but is indeed possible. > + * To avoid locking the chip, we keep reading at least 2 bytes > + */ Ditto. > + drv_data->effective_length = data+1; > + drv_data->bytes_left = data+1; > + drv_data->msg->len = data+1; Also, checkpatch complains about this if you run it with "--strict' CHECKPATCH CHECK: spaces preferred around that '+' (ctx:VxV) #81: FILE: drivers/i2c/busses/i2c-mv64xxx.c:384: + drv_data->effective_length = data+1; ^ CHECK: spaces preferred around that '+' (ctx:VxV) #82: FILE: drivers/i2c/busses/i2c-mv64xxx.c:385: + drv_data->bytes_left = data+1; ^ CHECK: spaces preferred around that '+' (ctx:VxV) #83: FILE: drivers/i2c/busses/i2c-mv64xxx.c:386: + drv_data->msg->len = data+1; ^ I think the complaints make sense. > - return I2C_FUNC_I2C | I2C_FUNC_10BIT_ADDR | I2C_FUNC_SMBUS_EMUL; > + return I2C_FUNC_I2C | I2C_FUNC_10BIT_ADDR | > + I2C_FUNC_SMBUS_READ_BLOCK_DATA | I2C_FUNC_SMBUS_EMUL; Likely I2C_FUNC_SMBUS_BLOCK_PROC_CALL will work as well, but I assume you can't test it? Otherwise, looks good. --1ccMZA6j1vT5UqiK Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEOZGx6rniZ1Gk92RdFA3kzBSgKbYFAl502UcACgkQFA3kzBSg KbaKrw//YFJRt+AH2+z/C2YoROOW6kIRbQ4RPamkJh+lUbPcfYhQtP1qyVDgoEf0 w7Qrqs915hVP5VDL7QaYXLs/Oe1+/UBvXuMCIdmAwvg7VJUN7YavhgAquqKGWgLb btrAfjhZncubn/h6k24n+5bcO+EgB4ILmWE+SnUNZI7DiFuzzKHxOlvBglKkgZy/ kv7gK4aIixneO0KD7As/dsNXkFAoXP9fQ+uug6hL/INZMM3Dbu0sWPiZ0qsPGciI /0fMhmRiTirbmS/d05VTKpK6MiV9kOm/VZybl7jjA67oDdEfV5bLJ17V9K86F+1U vZ9zLh0nqdScAltK+nNeJzSLMIdnur+kgfnhsd71S+q5bBXtzuCuT4wprhiY4ThD wWwkz6bLKWDbI8tkq+NGqQZ7zqLp3CCqaYVw41DN71sEAOu1QGDRBh8+DaYR/66j WZS+UfniiG6lk0N78k+p3yi3R1oQtXM4o7MiCTSlz7P7t9muKuGaXzbXlLaBqJIV mAHEVvktb+6YqwEk3RueDFVP61cH1MabuSWmMSq0L3WIaptaelKjMCSGdwo1s4A4 FjwIWUxRDkgRR/vaeKmmu3ZQbPHHC8NlLeRxjN2NIPZ7tBer6dec2Hpbtky7qZLI e3T35fk1I2iB9EcxIjRRbRerROPy4EXt1tDOGzi44LUimg/BWI4= =NYOi -----END PGP SIGNATURE----- --1ccMZA6j1vT5UqiK--