Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp910725rwl; Wed, 5 Apr 2023 09:14:14 -0700 (PDT) X-Google-Smtp-Source: AKy350bqoGkaH213Rzb5mGz3W/Q/w802B8Ar/00zftlvUgaq8FywR7pZeBZMIbVZJG0BXVW5kKC9 X-Received: by 2002:a05:6a20:6712:b0:cd:71de:e757 with SMTP id q18-20020a056a20671200b000cd71dee757mr5214558pzh.32.1680711253575; Wed, 05 Apr 2023 09:14:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680711253; cv=none; d=google.com; s=arc-20160816; b=jHBEa3y7oT1ESSifh9QhRrZ5NfhrwksHMRVXdIWjQkrUB5BJnAQqkoq+E0aDY9L/gm 6X2A5Ni/RWZZnV2VEXaI7UNHCVl9zpsRKJ9e5dY9ZUC9qS+1MWT2++QiVGBBr1asDTe6 40Dv+MB55zs1NlcJvV3OttdavCoGoSPQj/KVhda0FbnLZU59IsfchgNXN7JO0OL7Liyr xzFOiak8mnWdrS5FhwLY8xav7Cnn7/rdoVLvsCIAR8vtFcONF+QPQfVvJcEMnM4E7Zhp 5IaHmSS3vPLLGpgyZ3UtKsstxEvjVafg5AMR0spYlpNzAlpOfHzgpOu9vQtZ3RTNysWY GLfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=X3/hKDGLIBgYBsSp9JxGzVD0t/I/eyqeXE/qh58RSV8=; b=dZXwP79JnU0ZSXeyHEfzQKPYG/QhLgd+E6R5lxeIc+GTHZzF7DrQYZOam3++li6dL1 SNDDfgQ2QqkumRYf8P4JwDM+WOk5Oi6X8FP25ZQOCkg9xa6hTcsY95wpTYJFQhbqEsfb 0ZSnJuUpheK3G2St8D5iVw/2JodsrvuiIXjY2vHK2ZK2BTMnpG4FneNcL2wSdto2FxLw oSCv2lx3dO3NkQDVRyuhv/7urXzYfYV0ftpa0wOfHjX4MblUQUw+p4sCnHIjIEW6IErr QdFNCo0p1vobiE/B/lNxFH3s635Qrs6mhhtXOX+iUTtWibSbb6Sb5ZyDWy/kJFc3/L3D KSLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AdzTEGbN; 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=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e13-20020a056a0000cd00b0062bbe792ab7si12485788pfj.191.2023.04.05.09.14.01; Wed, 05 Apr 2023 09:14:13 -0700 (PDT) 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=@linaro.org header.s=google header.b=AdzTEGbN; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233294AbjDEQMZ (ORCPT + 99 others); Wed, 5 Apr 2023 12:12:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233998AbjDEQMB (ORCPT ); Wed, 5 Apr 2023 12:12:01 -0400 Received: from mail-oi1-x231.google.com (mail-oi1-x231.google.com [IPv6:2607:f8b0:4864:20::231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A0BC6E9B for ; Wed, 5 Apr 2023 09:11:55 -0700 (PDT) Received: by mail-oi1-x231.google.com with SMTP id w133so27027887oib.1 for ; Wed, 05 Apr 2023 09:11:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680711114; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=X3/hKDGLIBgYBsSp9JxGzVD0t/I/eyqeXE/qh58RSV8=; b=AdzTEGbNSycljYJy5WCNyP5smG6PKUNLqxy4H4UJ7Wcj41efVFYkFlZP52ymD3pCkn lP7fv+4vTGcjRt9z705FLodCuOKHJ8PvpxFxkk3zVVVkCZ/iuDjbPHN2o6ZefGqpAmW8 eHvrkjYcd4ysJfZYtndZFcaRh6xYfF9XnQqOc5NP/htmGXl415+V8kWEX4ZSVxbbk1Ie dOuqqkujn+0FXzODX+WCGsfU68UyuieYtpytIXQwIgn22pJPpJA2B8qD9k0ls68xgbK6 fGznrhIWcrIj0hVLzmBkz/Z4tJ4frIwoscDk/8BQ7bBvZFh27gcDlzOrtXniT7kYldF0 qAcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680711114; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=X3/hKDGLIBgYBsSp9JxGzVD0t/I/eyqeXE/qh58RSV8=; b=kr5oZAiBcUB3BQurKWbxKEgZgTqeODEVBDvzqNpL9KBWj5BqFi4v0VLwzUt42YyDfz WE0Claj+maTDgUQkBLXC5RfGpUsD6D5TOobYTt2UJ9IuotCDZ7nsnxXrRtLfeflDaZJM MKWNZSQtF253TZKF2ukwEAAEL9wItJ/+98Qd1U76gq7TapN//MhxAbX8VdMssY4tmUIg 2Sh3Y7NUuaqFdyJ7QtmScKqgZssRml3FrJG8pxt+2IX6Yj8VXfJ6OmerraUSNYC2PRaO dY24suz2snKBG01yrWTfthAoONfR3Ct7G0A7F3YBO92xoIA0bYFtBqLKwHlGZR8zndzw jqFg== X-Gm-Message-State: AAQBX9dkEn4z9cF4dqe8ApyhA/biCKkpzjBr6nfhLHMw/rIh42gg5wpg HKbymXOOEOZpagQjDWIJehInLuRX2NC0nzHW3WqmrQ== X-Received: by 2002:a05:6808:2221:b0:389:7955:bd66 with SMTP id bd33-20020a056808222100b003897955bd66mr3608870oib.34.1680711114267; Wed, 05 Apr 2023 09:11:54 -0700 (PDT) Received: from fedora (69-109-179-158.lightspeed.dybhfl.sbcglobal.net. [69.109.179.158]) by smtp.gmail.com with ESMTPSA id d22-20020a4a5216000000b0053b56462336sm6929712oob.21.2023.04.05.09.11.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Apr 2023 09:11:53 -0700 (PDT) Date: Wed, 5 Apr 2023 12:11:51 -0400 From: William Breathitt Gray To: Andy Shevchenko Cc: Jonathan Cameron , Lars-Peter Clausen , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 3/5] iio: addac: stx104: Improve indentation in stx104_write_raw() Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="1jYOn3g9KEyDd8dW" Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 --1jYOn3g9KEyDd8dW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Apr 05, 2023 at 11:50:08AM +0300, Andy Shevchenko wrote: > On Tue, Apr 04, 2023 at 10:12:00AM -0400, William Breathitt Gray wrote: > > By bailing out early if chan->output is false for the IIO_CHAN_INFO_RAW, > > indentation can be decreased by a tab and code readability improved. >=20 > ... >=20 > > + /* DAC can only accept up to a 16-bit value */ > > + if ((unsigned int)val > 65535) > > + return -EINVAL; >=20 > While the patch is good per se, I don't like two things (which are also i= n the > original code): > - explicit casting (can it be avoided?) We could explicitly check for negative instead: if (val < 0 || val > 65535) Would that be better? > - would be good to have U16_MAX or ?.. instead of hard coded number Fair point, I'll use U16_MAX then. > Can it be addressed with (additional) patches? Sure, I'll submit a separate patch to address this. William Breathitt Gray --1jYOn3g9KEyDd8dW Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQSNN83d4NIlKPjon7a1SFbKvhIjKwUCZC2dxwAKCRC1SFbKvhIj K3Q+APsE95kTreE0b52i3BDXKPVUHEkYx+70aW7kAfkJ89TLfgEAruHwB9k+q/3J M5eK7yomsLlRXu2iPnwG82wIJoceOQk= =k33s -----END PGP SIGNATURE----- --1jYOn3g9KEyDd8dW--