[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <12098259-32c4-4524-813e-38aeced837a0@roeck-us.net>
Date: Wed, 4 Jun 2025 05:40:44 -0700
From: Guenter Roeck <linux@...ck-us.net>
To: Oliver Neukum <oneukum@...e.com>, a0282524688@...il.com, lee@...nel.org,
linus.walleij@...aro.org, brgl@...ev.pl, andi.shyti@...nel.org,
mkl@...gutronix.de, mailhol.vincent@...adoo.fr, andrew+netdev@...n.ch,
davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
pabeni@...hat.com, wim@...ux-watchdog.org, jdelvare@...e.com,
alexandre.belloni@...tlin.com
Cc: linux-kernel@...r.kernel.org, linux-gpio@...r.kernel.org,
linux-i2c@...r.kernel.org, linux-can@...r.kernel.org,
netdev@...r.kernel.org, linux-watchdog@...r.kernel.org,
linux-hwmon@...r.kernel.org, linux-rtc@...r.kernel.org,
linux-usb@...r.kernel.org, Ming Yu <tmyu0@...oton.com>
Subject: Re: [PATCH v12 1/7] mfd: Add core driver for Nuvoton NCT6694
On 6/4/25 03:11, Oliver Neukum wrote:
> On 04.06.25 06:14, a0282524688@...il.com wrote:
>> From: Ming Yu <tmyu0@...oton.com>
>>
>> The Nuvoton NCT6694 provides an USB interface to the host to
>> access its features.
>>
>> Sub-devices can use the USB functions nct6694_read_msg() and
>> nct6694_write_msg() to issue a command. They can also request
>> interrupt that will be called when the USB device receives its
>> interrupt pipe.
>>
>> Signed-off-by: Ming Yu <tmyu0@...oton.com>
>> ---
...
>> +static void usb_int_callback(struct urb *urb)
>> +{
>> + struct nct6694 *nct6694 = urb->context;
>> + unsigned int *int_status = urb->transfer_buffer;
>> + int ret;
>> +
>> + switch (urb->status) {
>> + case 0:
>> + break;
>> + case -ECONNRESET:
>> + case -ENOENT:
>> + case -ESHUTDOWN:
>> + return;
>> + default:
>> + goto resubmit;
>> + }
>> +
>> + while (*int_status) {
>> + int irq = __ffs(*int_status);
>> +
>> + generic_handle_irq_safe(irq_find_mapping(nct6694->domain, irq));
>> + *int_status &= ~BIT(irq);
>> + }
>
> Does modifying the byte have any benefit?
>
Not sure if I understand the question, and assuming your question is regarding
*int_status: *int_status!=0 is the loop invariant, so, yes, modifying it does
have a benefit.
I'd be more concerned that transfer_buffer is the raw buffer, and that data
read from it is not endianness converted. That makes me wonder if and how the
code would work on a big endian system.
Guenter
Powered by blists - more mailing lists