Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp1384617rwb; Fri, 13 Jan 2023 11:29:40 -0800 (PST) X-Google-Smtp-Source: AMrXdXslgywhqsX9ja5722TkcMD0+dViNeURezQd91zcVu9Bo3UstqfnFukyHekPeFN3qZBufCXF X-Received: by 2002:a17:902:c814:b0:193:a5b:ccf6 with SMTP id u20-20020a170902c81400b001930a5bccf6mr13576132plx.0.1673638180128; Fri, 13 Jan 2023 11:29:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673638180; cv=none; d=google.com; s=arc-20160816; b=aWzQkv489GU6nVDLvy+j1nuZ0pllJ5vwMxPbPYyoa4hhWZo0Aw+e/HD1NQHDav35ab z8TMkSQyPWtYLUarGgGmjFpvhyhUI+Ta5VhhApcFDDJ+t9BV/7BFCORrq4936JKfWMrg wsR2MjzZmRcrm6v9uOzJqeftQFeotr6Ic9tkYWpcLOxZGRjUI6xHpC4TF3sMoSv5kzmC L5X2P8j09ET//p5GeO/uOqddLDXa/yNOs/q/g/5Fsadc7VruXvUmueLnwOyUSfEJCuUs sIJMJYG+y+Gvpu8Z6kGVmUZhq8R/26zXLDbM56y2j3vBVAOLbmBIP0BKonSuxLvoiRPh ysmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:autocrypt:from :references:cc:to:subject:dkim-signature:dkim-filter; bh=WoEjMlGXKsESHjEdT525Jh0VyfiBQINEkK7HGQsGYT8=; b=r3kZK6wP28zKHk7jju0KmQVRnvMmDKAY/845vx4roCZDMuL0MzwxOBObQ/Voe6yK3z 3kQ1IhZ+Rq8wayxZotH7b/CmFlgQcjJ5Pe6i2q0oV5yYIapBrd1bWtOzGJLmTOsmMDIr zTnZ+0DwG6zZ5yIH3q3pRfyrAQiGVTm+Uw/Ywn/EH8gm4cwMTREwKPEtcLBPUQ2xMtMc /adlTWsLTOyIV87cqDl9lTIVKUBaqxUBL8OiyfrMZG1akeEBXd+ir2y5wwKtoBKO4MVM HTJ/7gWdtAJ+3RaKJM/yK1QT07gxsusQPai4b9WPhN0FqZ3m9FQA8VVFteRRs/ak2VPt yvSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ispras.ru header.s=default header.b=RVjkvhdC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ispras.ru Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v8-20020a63bf08000000b0044cce26fa32si22222610pgf.632.2023.01.13.11.29.33; Fri, 13 Jan 2023 11:29:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ispras.ru header.s=default header.b=RVjkvhdC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ispras.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229894AbjAMT2G (ORCPT + 52 others); Fri, 13 Jan 2023 14:28:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229868AbjAMT1r (ORCPT ); Fri, 13 Jan 2023 14:27:47 -0500 Received: from mail.ispras.ru (mail.ispras.ru [83.149.199.84]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0BD7387F24; Fri, 13 Jan 2023 11:27:47 -0800 (PST) Received: from [10.10.2.52] (unknown [10.10.2.52]) by mail.ispras.ru (Postfix) with ESMTPSA id 36FFD40D4004; Fri, 13 Jan 2023 19:27:45 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 mail.ispras.ru 36FFD40D4004 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ispras.ru; s=default; t=1673638065; bh=WoEjMlGXKsESHjEdT525Jh0VyfiBQINEkK7HGQsGYT8=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=RVjkvhdCL/8IbSW1P1VP5bk77Alclds8LjLAMiOcw9TtCuR+WsokxV8jpaVWNY+19 Wzj8bTSXdmDe/WbxVpNpenqQTjnjt8O0/5oM3t53Tkal3LoERAHodtsEfY4+doLTXC sru8k5eZMOWDQ9+5iK9V3MNlcmMy7fCFO7iL//mI= Subject: Re: [lvc-project] [PATCH] iio: chemical: scd30: Add check for NULL in scd30_i2c_command To: Andy Shevchenko Cc: Anastasia Belova , Tomasz Duszynski , Lars-Peter Clausen , lvc-project@linuxtesting.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Jonathan Cameron References: <20230113133320.7531-1-abelova@astralinux.ru> From: Alexey Khoroshilov Autocrypt: addr=khoroshilov@ispras.ru; prefer-encrypt=mutual; keydata= xsFNBFtq9eIBEACxmOIPDht+aZvO9DGi4TwnZ1WTDnyDVz3Nnh0rlQCK8IssaT6wE5a95VWo iwOWalcL9bJMHQvw60JwZKFjt9oH2bov3xzx/JRCISQB4a4U1J/scWvPtabbB3t+VAodF5KZ vZ2gu/Q/Wa5JZ9aBH0IvNpBAAThFg1rBXKh7wNqrhsQlMLg+zTSK6ZctddNl6RyaJvAmbaTS sSeyUKXiabxHn3BR9jclXfmPLfWuayinBvW4J3vS+bOhbLxeu3MO0dUqeX/Nl8EAhvzo0I2d A0vRu/Ze1wU3EQYT6M8z3i1b3pdLjr/i+MI8Rgijs+TFRAhxRw/+0vHGTg6Pn02t0XkycxQR mhH3v0kVTvMyM7YSI7yXvd0QPxb1RX9AGmvbJu7eylzcq9Jla+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oM+z1dCrNNtN3u4R7AYr6DDIDxoSzR4k0ZaG uSeqh4xxQCD7vLT3JdZDyhYUJgy9mvSXdkXGdBIhVmeLch2gaWNf5UOutVJwdPbIaUDRjVoV Iw6qjKq+mnK3ttuxW5Aeg9Y1OuKEvCVu+U/iEEJxx1JRmVAYq848YqtVPY9DkZdBT4E9dHqO n8lr+XPVyMN6SBXkaR5tB6zSkSDrIw+9uv1LN7QIri43fLqhM950ltlveROEdLL1bI30lYO5 J07KmxgOjrvY8X9WOC3O0k/nFpBbbsM4zUrmF6F5wIYO99xafQOlfpUnVtbo3GnBR2LIcPYj SyY3dW28JXo2cftxIOr1edJ+fhcRqYRrPzJrQBZcE2GZjRO8tz6IOMAsc+WMtVfj5grgVHCu kK2E04Fb+Zk1eJvHYRc= Message-ID: <15a05909-a373-09af-c0bf-1b35fd019bd5@ispras.ru> Date: Fri, 13 Jan 2023 22:27:44 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 13.01.2023 21:47, Andy Shevchenko wrote: > On Fri, Jan 13, 2023 at 8:41 PM Alexey Khoroshilov > wrote: >> On 13.01.2023 16:33, Anastasia Belova wrote: > >> It seems it is better to put the whole validation loop under if (rsp) >> check. > > No. The entire patch is redundant. > The code that calls this function is under the control of the same > driver, so we know how to avoid shooting in our foot. I see, there is an assumption that response is NULL iff size is zero. May be it could be documented, because naming of arguments does not make such assumption obvious for fresh readers. -- Thank you, Alexey