Re: [PATCH 11/32] parport_pc: add 16-bit and 8-bit fast EPP transfer flags

From: Sergey Shtylyov
Date: Sat Mar 11 2023 - 15:32:00 EST


On 3/11/23 11:09 PM, Sergey Shtylyov wrote:

>> PARPORT_EPP_FAST flag currently uses 32-bit I/O port access for data
>> read/write (insl/outsl).
>> Add PARPORT_EPP_FAST_16 and PARPORT_EPP_FAST_8 that use insw/outsw
>> and insb/outsb (and PARPORT_EPP_FAST_32 as alias for PARPORT_EPP_FAST).
>>
>> Signed-off-by: Ondrej Zary <linux@xxxxxxx>
>> ---
>> drivers/parport/parport_pc.c | 20 ++++++++++++++++----
>> include/uapi/linux/parport.h | 3 +++
>> 2 files changed, 19 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/parport/parport_pc.c b/drivers/parport/parport_pc.c
>> index 5784dc20fb38..eda4e4e6d4e8 100644
>> --- a/drivers/parport/parport_pc.c
>> +++ b/drivers/parport/parport_pc.c
>> @@ -298,9 +298,15 @@ static size_t parport_pc_epp_read_data(struct parport *port, void *buf,
>> }
>> return got;
>> }
>> - if ((flags & PARPORT_EPP_FAST) && (length > 1)) {
>> - if (!(((long)buf | length) & 0x03))
>> + if ((length > 1) && ((flags & PARPORT_EPP_FAST_32)
>> + || flags & PARPORT_EPP_FAST_16
>> + || flags & PARPORT_EPP_FAST_8)) {
>
> Why not:
>
>> + if ((flags & PARPORT_EPP_FAST_32)
>> + && !(((long)buf | length) & 0x03))
>> insl(EPPDATA(port), buf, (length >> 2));
>> + else if ((flags & PARPORT_EPP_FAST_16)
>> + && !(((long)buf | length) & 0x01))
>> + insw(EPPDATA(port), buf, length >> 1);
>> else
>> insb(EPPDATA(port), buf, length);
>

Oopsie, s/th went wrong while editing... :-/

[...]

MBR, Sergey