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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180317191555.GA14672@sophia>
Date:   Sat, 17 Mar 2018 15:15:55 -0400
From:   William Breathitt Gray <vilhelm.gray@...il.com>
To:     Andy Shevchenko <andy.shevchenko@...il.com>
Cc:     Linus Walleij <linus.walleij@...aro.org>,
        "open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        linux-iio@...r.kernel.org, Jonathan Cameron <jic23@...nel.org>,
        Hartmut Knaack <knaack.h@....de>,
        Lars-Peter Clausen <lars@...afoo.de>,
        Peter Meerwald-Stadler <pmeerw@...erw.net>
Subject: Re: [PATCH v3 1/8] iio: stx104: Implement get_multiple callback

On Sat, Mar 17, 2018 at 08:51:07PM +0200, Andy Shevchenko wrote:
>On Sat, Mar 17, 2018 at 5:49 PM, William Breathitt Gray
><vilhelm.gray@...il.com> wrote:
>> The Apex Embedded Systems STX104 series of devices provides 4 TTL
>> compatible lines of inputs accessed via a single 4-bit port. Since four
>> input lines are acquired on a single port input read, the STX104 GPIO
>> driver may improve multiple input reads by utilizing a get_multiple
>> callback. This patch implements the stx104_gpio_get_multiple function
>> which serves as the respective get_multiple callback.
>
>> +static int stx104_gpio_get_multiple(struct gpio_chip *chip, unsigned long *mask,
>> +       unsigned long *bits)
>> +{
>> +       struct stx104_gpio *const stx104gpio = gpiochip_get_data(chip);
>> +
>
>> +       *bits = inb(stx104gpio->base);
>
>I think on LE and BE if will give you different results.

That may be true for a memcpy operation, but in this case I'm relying on
the standard C evaluation rules. I expect we should be fine with the
returned byte assigned to an unsigned long, since it'll be evaluated by
its value rather than memory representation.

William Breathitt Gray

>
>> +
>> +       return 0;
>> +}
>
>
>
>-- 
>With Best Regards,
>Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ