Linux USB
 help / color / mirror / Atom feed
From: Oliver Neukum <oneukum@suse.com>
To: Alan Stern <stern@rowland.harvard.edu>, Oliver Neukum <oneukum@suse.com>
Cc: USB list <linux-usb@vger.kernel.org>
Subject: Re: alauda_check_media() doubts
Date: Tue, 29 Aug 2023 23:42:07 +0200	[thread overview]
Message-ID: <16964970-5f7a-c80c-ad30-0a09fef9dc2f@suse.com> (raw)
In-Reply-To: <001562e9-bc84-498f-a15a-8b4a01f172a7@rowland.harvard.edu>



On 29.08.23 20:49, Alan Stern wrote:
> On Tue, Aug 29, 2023 at 08:14:05PM +0200, Oliver Neukum wrote:
>> Hi Alan,
>>
>> as you did something on this driver, doesn't
>> this condition:
>>
>> (status[0] & 0x80) ||
>>                  ((status[0] & 0x1F) == 0x10) || ((status[1] & 0x01) == 0)
>>
>> look odd to you? Especially the parentheses?
> 
> (The actual text in my copy of the file is:

Yes, I rearranged it by the parantheses.

> 	if ((status[0] & 0x80) || ((status[0] & 0x1F) == 0x10)
> 		|| ((status[1] & 0x01) == 0)) {
> 
> This probably doesn't affect your point...)
> 
> Certainly the layout is a little peculiar, and the extra parentheses
> don't help any.  But they don't really hurt, either, and the meaning is
> clear.  It doesn't look obviously wrong.

Ok, then this is just me. THe parantheses would make perfect sense
if the actual intent were:

(status[0] & 0x80) ||
		((status[0] & 0x1F) == 0x10) && ((status[1] & 0x01) == 0)
> 
> Those two lines go back to the original version of the driver, added in
> 2005 by commit e80b0fade09e ("[PATCH] USB Storage: add alauda support"),
> written by Daniel Drake and edited by Matt Dharm.  So it's been around
> for quite a while and there may not be many devices left that need this
> driver.

Yes, I know. Hence my question.

> Did you want to change it?

Nope. I just looked through the log and saw your patch for the
failure of the transfer and the subsequent test looked
messed up.

	Regards
		Oliver


  reply	other threads:[~2023-08-29 21:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-29 18:14 alauda_check_media() doubts Oliver Neukum
2023-08-29 18:49 ` Alan Stern
2023-08-29 21:42   ` Oliver Neukum [this message]
2023-08-29 23:28     ` Alan Stern
2023-09-02  1:48       ` Pawlicker

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=16964970-5f7a-c80c-ad30-0a09fef9dc2f@suse.com \
    --to=oneukum@suse.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    /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