Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1020978rwb; Thu, 18 Aug 2022 17:13:15 -0700 (PDT) X-Google-Smtp-Source: AA6agR6PcTL4r9FgpudRW4++Ly2KmIVH/pTCen1DGpk1gjGEtnAE6PXRppgURLNSbR10EA7peoaH X-Received: by 2002:a05:6a00:999:b0:52e:cd5e:3453 with SMTP id u25-20020a056a00099900b0052ecd5e3453mr5163026pfg.76.1660867995589; Thu, 18 Aug 2022 17:13:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660867995; cv=none; d=google.com; s=arc-20160816; b=j+nNSRRzSsR5HcVxruGbZu0bVRoxBAtZGhbzpjDdWzt4RzoO8YOjWNbutGugJv6g/v aT4JT8SpStFpuEZvz3XIncKYVQHB1R8I76+VAwII3i/HILSMgjAB9TxVL5BNea3/GtVs TLKo+1UIJtT48C2slmc3TYKZ4t+fKhad/4OVPNiXNiqCb3no4pnsPxLjd2lYIXv9/g7O zd656cyek+Xb76nhAL63qMdwSFJ+sYAXFk1Wq8dFkHvEuVoDTsASddcOtExBfHtbyBt/ IPldPpKnUiMXKX3dsb6Y+df9N1SysS5n/ntCISWA/+RH5hXiiNug5plnU/CjFTpnZktj moXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:to:from :subject:message-id; bh=3xURV131JmwRIew828s11433HrNMFQV0lL8rT3/IjO0=; b=EB81L9CZiFXT4HVcP4a0ORfkuWmUIydAYU9ldTexBSyfHMDmWHxjzJ3tX/W8IvXI6T gXFUkfOxpMLEjUSoL74LQv4XlalZR/RA4sIC97lLM6AZ9DAWFE+iJC/+ZJhBbadtlv66 mKC80Utk7xyG0tW4ZhKFt7z/vrMb5iZAhnd3jDFZKSCPpylF1P6lcKrxzvcVF60JDYUZ M25jVpAJCVVvEWgybU54JHxyogwlegx+U+Rr2NEd9bYCJrF3jvX4JzB/nRWvBF7liD8s YBHflCYpqP3tO0RDcHRTz0MEaZmn7AYLbzpS6zNrgzBC/pOPkmJUASd5iktJ2pKn1hSn Te/g== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nl13-20020a17090b384d00b001f2cc064108si5875641pjb.140.2022.08.18.17.13.02; Thu, 18 Aug 2022 17:13:15 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245631AbiHSAIq convert rfc822-to-8bit (ORCPT + 99 others); Thu, 18 Aug 2022 20:08:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53358 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244366AbiHSAIm (ORCPT ); Thu, 18 Aug 2022 20:08:42 -0400 Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1CD255A3C6; Thu, 18 Aug 2022 17:08:38 -0700 (PDT) Received: from omf03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id E437AC017F; Fri, 19 Aug 2022 00:08:36 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: joe@perches.com) by omf03.hostedemail.com (Postfix) with ESMTPA id C188860013; Fri, 19 Aug 2022 00:08:35 +0000 (UTC) Message-ID: <72bbd0126162b7f78291d3431d2a8c6730cc4ce7.camel@perches.com> Subject: Re: [PATCH] iio: Avoid multiple line dereference for mask From: Joe Perches To: Joe Simmons-Talbott , Jonathan Cameron , Lars-Peter Clausen , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Date: Thu, 18 Aug 2022 20:08:27 -0400 In-Reply-To: <20220818125844.60762-1-joetalbott@gmail.com> References: <20220818125844.60762-1-joetalbott@gmail.com> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8BIT User-Agent: Evolution 3.44.4 (3.44.4-1.fc36) MIME-Version: 1.0 X-Stat-Signature: f1uyboi78t4c1z9e7swib63xprtonpzy X-Rspamd-Server: rspamout04 X-Rspamd-Queue-Id: C188860013 X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, SPF_NONE,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.6 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Session-ID: U2FsdGVkX1/c2aeq6vYQ0OSQy1gD2yCLIaS3sjK0e/E= X-HE-Tag: 1660867715-574754 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 Thu, 2022-08-18 at 08:58 -0400, Joe Simmons-Talbott wrote: > Add a mask variable to hold dereferences that span multiple lines. > Found with checkpatch.pl. [] > diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c [] > @@ -1301,10 +1302,9 @@ static int iio_device_add_channel_sysfs(struct iio_dev *indio_dev, > return ret; > attrcount += ret; > > + mask = &chan->info_mask_separate_available; > ret = iio_device_add_info_mask_type_avail(indio_dev, chan, > - IIO_SEPARATE, > - &chan-> > - info_mask_separate_available); > + IIO_SEPARATE, mask); The issue is the conflict between using 30+ character identifiers and 80 column lines. Perhaps it's better just to use a longer line instead of a temporary. ret = iio_device_add_info_mask_type_avail(indio_dev, chan, IIO_SEPARATE, &chan->info_mask_separate_available); [] > @@ -1316,10 +1316,9 @@ static int iio_device_add_channel_sysfs(struct iio_dev *indio_dev, > return ret; > attrcount += ret; > > + mask = &chan->info_mask_shared_by_type_available; > ret = iio_device_add_info_mask_type_avail(indio_dev, chan, > - IIO_SHARED_BY_TYPE, > - &chan-> > - info_mask_shared_by_type_available); > + IIO_SHARED_BY_TYPE, mask); ret = iio_device_add_info_mask_type_avail(indio_dev, chan, IIO_SHARED_BY_TYPE, &chan->info_mask_shared_by_type_available); etc...