[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZqkpOQIjcBSAg8rC@embed-PC.myguest.virtualbox.org>
Date: Tue, 30 Jul 2024 23:26:09 +0530
From: Abhishek Tamboli <abhishektamboli9@...il.com>
To: Oliver Neukum <oneukum@...e.com>
Cc: stern@...land.harvard.edu, gregkh@...uxfoundation.org,
usb-storage@...ts.one-eyed-alien.net, linux-usb@...r.kernel.org,
skhan@...uxfoundation.org, dan.carpenter@...aro.org,
rbmarliere@...il.com,
linux-kernel-mentees@...ts.linuxfoundation.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] usb: storage: ene_ub6250: Fix right shift warnings
On Tue, Jul 30, 2024 at 09:09:05AM +0200, Oliver Neukum wrote:
>
>
> On 29.07.24 20:23, Abhishek Tamboli wrote:
> > Change bl_len from u16 to u32 to accommodate the necessary bit shifts.
>
> Hi,
>
> while this patch is technically correct, it papers over the issue.
> Could you please
Thank you for your feedback on my patch. I have a few questions to ensure
I make the appropriate changes.
>
> 1. use a constant, where a constant is used
I think you are suggesting that I should replace hard-coded values like the
buffer size with named constants. For example:
#define BUF_SIZE 8
unsigned char buf[BUF_SIZE];
> 2. use the macros for converting endianness
Can I use macros like cpu_to_le32 for converting the bl_num and bl_len values.
Should I replace all instances of manual bitwise shifts with these macros?
For example:
u32 bl_len = 0x200;
buf[0] = cpu_to_le32(bl_num) >> 24;
buf[4] = cpu_to_le32(bl_len) >> 24;
Is using cpu_to_le32 appropriate for the data format required by this
device?
I will make the necessary updates once I have your confirmation.
Best Regards,
Abhishek Tamboli
>
> Regards
> Oliver
>
Powered by blists - more mailing lists