Re: [PATCH 1/2] staging: iio: cdc: ad7150: use pointer to shorten the line length

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/01/2018 09:33 PM, Slawomir Stepien wrote:
> By using the pointer to channel attribute, we can now make the lines
> short enough to eliminate the checkpatch.pl problem:
> 
>     CHECK: Alignment should match open parenthesis
> 
> Signed-off-by: Slawomir Stepien <sst@xxxxxxxxx>

Hi,

Thanks for the patch. This looks good. But maybe a small suggestion further
improvement.

> ---
>  drivers/staging/iio/cdc/ad7150.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/iio/cdc/ad7150.c b/drivers/staging/iio/cdc/ad7150.c
> index d16084d7068c..5b5b766a0405 100644
> --- a/drivers/staging/iio/cdc/ad7150.c
> +++ b/drivers/staging/iio/cdc/ad7150.c
> @@ -102,18 +102,19 @@ static int ad7150_read_raw(struct iio_dev *indio_dev,
>  {
>  	int ret;
>  	struct ad7150_chip_info *chip = iio_priv(indio_dev);
> +	const int *channel = &chan->channel;

Instead of taking a pointer, just take the value of the channel index and
use that. The generated code should be very similar but its a bit nicer to read.



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux