public inbox for linux-kernel-mentees@lists.linux-foundation.org
 help / color / mirror / Atom feed
From: Abhishek Tamboli <abhishektamboli9@gmail.com>
To: Oliver Neukum <oneukum@suse.com>
Cc: stern@rowland.harvard.edu, gregkh@linuxfoundation.org,
	usb-storage@lists.one-eyed-alien.net, linux-usb@vger.kernel.org,
	skhan@linuxfoundation.org, dan.carpenter@linaro.org,
	rbmarliere@gmail.com,
	linux-kernel-mentees@lists.linuxfoundation.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] usb: storage: ene_ub6250: Fix right shift warnings
Date: Tue, 30 Jul 2024 23:26:09 +0530	[thread overview]
Message-ID: <ZqkpOQIjcBSAg8rC@embed-PC.myguest.virtualbox.org> (raw)
In-Reply-To: <e72cc56a-3066-4cb8-848d-bfe27a48c095@suse.com>

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
> 

  reply	other threads:[~2024-07-30 17:56 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-29 18:23 [PATCH] usb: storage: ene_ub6250: Fix right shift warnings Abhishek Tamboli
2024-07-29 18:34 ` Alan Stern
2024-07-30  7:09 ` Oliver Neukum
2024-07-30 17:56   ` Abhishek Tamboli [this message]
2024-07-31  9:15     ` Oliver Neukum
2024-07-31 14:04       ` Alan Stern
2024-07-31 18:04         ` Abhishek Tamboli
2024-07-31 18:19           ` Alan Stern
2024-07-31 19:18             ` Abhishek Tamboli
2024-08-01  6:54             ` Oliver Neukum
2024-08-01 14:51               ` Alan Stern
2024-09-12  0:45                 ` Abhishek Tamboli
2024-09-12  1:24                   ` Alan Stern
2024-09-12  5:06                   ` Greg KH
2024-09-12 14:50                     ` Abhishek Tamboli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZqkpOQIjcBSAg8rC@embed-PC.myguest.virtualbox.org \
    --to=abhishektamboli9@gmail.com \
    --cc=dan.carpenter@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel-mentees@lists.linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=oneukum@suse.com \
    --cc=rbmarliere@gmail.com \
    --cc=skhan@linuxfoundation.org \
    --cc=stern@rowland.harvard.edu \
    --cc=usb-storage@lists.one-eyed-alien.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox