Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp318184ybc; Tue, 19 Nov 2019 01:47:30 -0800 (PST) X-Google-Smtp-Source: APXvYqx7riYu4ofKtusa6Kc4hn19TT0sVxFerIjY7unG3ELGqbElKHZR6yayrWWL5nsoTSz1qI7Z X-Received: by 2002:a17:906:c44f:: with SMTP id ck15mr33696946ejb.7.1574156850187; Tue, 19 Nov 2019 01:47:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574156850; cv=none; d=google.com; s=arc-20160816; b=ZDFuL7lTZQ5mAAvEkV16Sq2KBdNRMZHjDMwCEXxMLMUZe5teuCbcJCNe2OZ2BGLIE9 PEYKCuiWx3NCZhI6o1duibzw7IxENUSXuwwtuwyQh+vXeHfxiGeWmDd7j5SuJrYVA0T+ LcNh/ymbgCQgErvw+CNgdwaL24taVcMyqHiISv+6eH9evlmjanFrQpxCTOnox23K8tab IiYPYgc7myWXXEXk5lVG6Vbh2JpRfyrdIZGUyDmgINg7qIyP/NTbCcDW6hRLnItMS9oI WfeTbK9JL5BETOkCqcxzylbeR+FxT8qisnYdXDcqdHgz1OcRihApou1+xi1WqmHlOFzP hXXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=iFLe74/vzczdwackurQ4dB1dCWSikCpaNjwX9L3dv0Y=; b=F1JUXx+cgnq2D2qV1P5KrKWYBvQt4WgyOXueMLN2drpnw7CGhn1Gvan09EAVUWv8+p j+tqMrG3Stl+V+1o9bA2sP7MXXXG6rBmhUQ/CavRs3APMSrmdrMjV7tPg/i0DAu2Bi5d cMDPcOLNN3vp4lOwbA3ceKw1rMXPWmFCu73iXRnMR8xaHR83EIFB35ju4Mq/EtMeXa4p yHpm73VlheiBQ2VbkZND2Fbti0yT9u/bqlGXGcywnSn/g3FG6Bydsr5QaGQEVvD3mJKK Ldn6/FzZN45mFYaar69G9fv+MAzthjb/C6ogYBkEKl1TLUM2SkXyL7XoZNzJav+zhpsp Q3Cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CBiofW6e; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k24si13612070ejv.111.2019.11.19.01.47.05; Tue, 19 Nov 2019 01:47:30 -0800 (PST) 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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CBiofW6e; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727016AbfKSJn5 (ORCPT + 99 others); Tue, 19 Nov 2019 04:43:57 -0500 Received: from mail-il1-f193.google.com ([209.85.166.193]:35161 "EHLO mail-il1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725798AbfKSJn5 (ORCPT ); Tue, 19 Nov 2019 04:43:57 -0500 Received: by mail-il1-f193.google.com with SMTP id z12so19028704ilp.2; Tue, 19 Nov 2019 01:43:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=iFLe74/vzczdwackurQ4dB1dCWSikCpaNjwX9L3dv0Y=; b=CBiofW6eqKqHm2UpnCQVpu+7I11dVQcpq2qYynsviw3OYGREYbQgKmV6j2c3wL2cW1 c4VLgaEhiAoj0PmkYaTdJ7TZ4Raio8xoNSrBVrd7pl2Th2j7kUpElFuPLJq/Rda9YyG2 H9tjSTQdHJ2IIoaRlbf+Ptpj2b9lCcjla07p6+oBZIgEEGa+0+PoOa62JwUcO4AH7FXd HIO6SafSwc+YNHLXV35Y0+gPaYekxJtF2syy8X/IA2cLrf8TcvfUQL2c4U/OCHhQ7343 OSEzlMurcpXNAuA+Pm7GZENAiFepFpZareOwPAl//w78eZwLowPIJc7pgD0Ue48y+JzX zAGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=iFLe74/vzczdwackurQ4dB1dCWSikCpaNjwX9L3dv0Y=; b=SWX13ohEHHl7R7z5MWyLvgctYx9Sw1JJYdcAkjVGgQVXUBC0Q6sQJMIKAW+w2CNDjx Bdnyo/sfdbhkw0gBPJHTvlFwCjyzJUm2vbCZV023JqlHWBmp2+PRXSTi8/e1mHxG2yPf CrFXfefEleUcLPjIJ2Kup60kHHKPswIA6LAT4Tze+iT2DlVQaZA7ghLlvVlu0OT8oqWC 31utErAUAtCW0rHb8nSrYqtoWdkYTanBubgnYtD7o0mKAIf9omhpoOeAXxbwmPsHUdE9 ssVgJ+x8ON6I511uIpOhllTFeSRGMsiquig/6ZpBmPS7zfeP5z1kV3HQnc83P4gbyd9f C4sw== X-Gm-Message-State: APjAAAXZnP5xUPbs+6FsxBF2QiObhzIvo/yY/cbPw+fgD8nuN1w6XkK9 aiJW53QBihYtSt3K2Rkh7BRskfV8SviYlA+F9N3gbzb5 X-Received: by 2002:a92:17c8:: with SMTP id 69mr21702785ilx.42.1574156634388; Tue, 19 Nov 2019 01:43:54 -0800 (PST) MIME-Version: 1.0 References: <1574153778-59977-1-git-send-email-mine260309@gmail.com> In-Reply-To: From: Lei YU Date: Tue, 19 Nov 2019 17:43:43 +0800 Message-ID: Subject: Re: [PATCH] docs: i2c: Fix return value of i2c_smbus_xxx functions To: Peter Rosin Cc: Wolfram Sang , "linux-i2c@vger.kernel.org" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 19, 2019 at 5:33 PM Peter Rosin wrote: > > On 2019-11-19 09:56, Lei YU wrote: > > In i2c/dev-interface.rst it said > > > >> All these transactions return -1 on failure > > > > But actually the i2c_smbus_xxx functions return negative error numbers > > on failure, instead of -1. > > > > Fix the document. > > > > Signed-off-by: Lei YU > > --- > > Documentation/i2c/dev-interface.rst | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/Documentation/i2c/dev-interface.rst b/Documentation/i2c/dev-interface.rst > > index 69c23a3..73b77c3 100644 > > --- a/Documentation/i2c/dev-interface.rst > > +++ b/Documentation/i2c/dev-interface.rst > > @@ -163,8 +163,8 @@ for details) through the following functions:: > > __s32 i2c_smbus_write_block_data(int file, __u8 command, __u8 length, > > __u8 *values); > > > > -All these transactions return -1 on failure; you can read errno to see > > -what happened. The 'write' transactions return 0 on success; the > > +All these transactions return negative value on failure; you can read errno to > > +see what happened. The 'write' transactions return 0 on success; the > > s/return negative/return a negative/ Ack, will send v2 patch. > > And the line is now too long compared to the rest of the text, so you > need to rewrap the paragraph. In this patch it's at column 78, that should be OK. But after adding the "a" it will exceed and will rewrap in v2 patch. > > And why do you need to dig around in errno if the negative errno has > already been returned? Yeah, good question, probably we could remove the following sentence? > > > 'read' transactions return the read value, except for read_block, which > > returns the number of values read. The block buffers need not be longer > > than 32 bytes. > > > > Hmm, unrelated, but should that perhaps be "must not" instead of "need not"? > > Cheers, > Peter