public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sshtylyov@ru.mvista.com>
To: Andrew Morton <akpm@osdl.org>
Cc: bzolnier@gmail.com, linux-ide@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ide_dma_speed() fixes
Date: Mon, 15 May 2006 17:44:30 +0400	[thread overview]
Message-ID: <446885BE.4090404@ru.mvista.com> (raw)
In-Reply-To: <20060514050548.5399e3f4.akpm@osdl.org>

Hello.

Andrew Morton wrote:

>>    ide_dma_speed() fails to actually honor the IDE drivers' mode support 
>> masks) because of the bogus checks -- thus, selecting the DMA transfer mode 
>> that the driver explicitly refuses to support is possible. Additionally, there 
>> is no check for validity of the UltraDMA mode data in the drive ID, and the 
>> function is misdocumented.

> drivers/ide/ide-lib.c: In function `ide_dma_speed':
> drivers/ide/ide-lib.c:86: warning: `ultra_mask' might be used uninitialized in this function

> Looks like a real bug to me - it depends up on the values of `mode' and
> id->field_value.

> Anyway, I'll drop it, please review and fix.  I assume that warning was
> occurring for you as well - please spend more time over these things. 
> Especially when working on IDE, where bugs are slow to show themselves and
> have particularly bad consequences.

    That's what gcc thinks. The code is 100% correct -- it will never reach 
the switch statement with mode > 0 (in which case ultra_mask isn't used) and 
ultra_mask unitialized. I may add an explicit initializer in the declaration 
if you like...

MBR, Sergei

  reply	other threads:[~2006-05-15 13:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-12  2:36 [PATCH] ide_dma_speed() fixes Sergei Shtylyov
2006-05-14 12:05 ` Andrew Morton
2006-05-15 13:44   ` Sergei Shtylyov [this message]
2006-05-15 14:08     ` Alan Cox
2006-05-15 15:00     ` Andrew Morton
2006-05-15 15:27       ` Alan Cox

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=446885BE.4090404@ru.mvista.com \
    --to=sshtylyov@ru.mvista.com \
    --cc=akpm@osdl.org \
    --cc=bzolnier@gmail.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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