lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <72bbd0126162b7f78291d3431d2a8c6730cc4ce7.camel@perches.com>
Date:   Thu, 18 Aug 2022 20:08:27 -0400
From:   Joe Perches <joe@...ches.com>
To:     Joe Simmons-Talbott <joetalbott@...il.com>,
        Jonathan Cameron <jic23@...nel.org>,
        Lars-Peter Clausen <lars@...afoo.de>,
        linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] iio: Avoid multiple line dereference for mask

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...


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ