linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* RE: [PATCH 2.6] cciss typo fix
@ 2005-01-07 23:24 Miller, Mike (OS Dev)
  2005-01-07 23:32 ` James Bottomley
  2005-01-08  8:41 ` Jens Axboe
  0 siblings, 2 replies; 8+ messages in thread
From: Miller, Mike (OS Dev) @ 2005-01-07 23:24 UTC (permalink / raw)
  To: James Bottomley
  Cc: Andrew Morton, Jens Axboe, Linux Kernel, SCSI Mailing List

> -----Original Message-----
> From: James Bottomley [mailto:James.Bottomley@SteelEye.com]
> 
> 
> On Fri, 2005-01-07 at 17:01 -0600, mike.miller@hp.com wrote:
> > -		*total_size = be32_to_cpu(*((__be32 *) 
> &buf->total_size[0]))+1;
> > -		*block_size = be32_to_cpu(*((__be32 *) 
> &buf->block_size[0]));
> > +		*total_size = be32_to_cpu(*((__u32 *) 
> &buf->total_size[0]))+1;
> > +		*block_size = be32_to_cpu(*((__u32 *) 
> &buf->block_size[0]));
> 
> I don't think that's a typo.  It was introduced by this patch:
> 
> ChangeSet 1.1988.24.79 2004/10/06 07:55:02 viro@www.linux.org.uk
>   [PATCH] cciss endianness and iomem annotations
>  
> The idea being that BE and LE numbers should be annotated differently,
> so the __be32 annotations look correct to me.  I think sparse 
> will warn
> if you make this change.

Hmmm, SuSE complained that __be32 was not defined in the kernel. Any other thoughts, anyone?

mikem

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [PATCH 2.6] cciss typo fix
  2005-01-07 23:24 [PATCH 2.6] cciss typo fix Miller, Mike (OS Dev)
@ 2005-01-07 23:32 ` James Bottomley
  2005-01-08  8:41 ` Jens Axboe
  1 sibling, 0 replies; 8+ messages in thread
From: James Bottomley @ 2005-01-07 23:32 UTC (permalink / raw)
  To: Miller, Mike (OS Dev)
  Cc: Andrew Morton, Jens Axboe, Linux Kernel, SCSI Mailing List

On Fri, 2005-01-07 at 17:24 -0600, Miller, Mike (OS Dev) wrote:
> Hmmm, SuSE complained that __be32 was not defined in the kernel. Any other thoughts, anyone?

Erm, well it might not be defined in the SuSE kernel ... that's based on
2.6.5, I believe.  These symbols are definitely defined in the mainline
kernel.

James



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2.6] cciss typo fix
  2005-01-07 23:24 [PATCH 2.6] cciss typo fix Miller, Mike (OS Dev)
  2005-01-07 23:32 ` James Bottomley
@ 2005-01-08  8:41 ` Jens Axboe
  1 sibling, 0 replies; 8+ messages in thread
From: Jens Axboe @ 2005-01-08  8:41 UTC (permalink / raw)
  To: Miller, Mike (OS Dev)
  Cc: James Bottomley, Andrew Morton, Linux Kernel, SCSI Mailing List

On Fri, Jan 07 2005, Miller, Mike (OS Dev) wrote:
> > -----Original Message-----
> > From: James Bottomley [mailto:James.Bottomley@SteelEye.com]
> > 
> > 
> > On Fri, 2005-01-07 at 17:01 -0600, mike.miller@hp.com wrote:
> > > -		*total_size = be32_to_cpu(*((__be32 *) 
> > &buf->total_size[0]))+1;
> > > -		*block_size = be32_to_cpu(*((__be32 *) 
> > &buf->block_size[0]));
> > > +		*total_size = be32_to_cpu(*((__u32 *) 
> > &buf->total_size[0]))+1;
> > > +		*block_size = be32_to_cpu(*((__u32 *) 
> > &buf->block_size[0]));
> > 
> > I don't think that's a typo.  It was introduced by this patch:
> > 
> > ChangeSet 1.1988.24.79 2004/10/06 07:55:02 viro@www.linux.org.uk
> >   [PATCH] cciss endianness and iomem annotations
> >  
> > The idea being that BE and LE numbers should be annotated differently,
> > so the __be32 annotations look correct to me.  I think sparse 
> > will warn
> > if you make this change.
> 
> Hmmm, SuSE complained that __be32 was not defined in the kernel. Any
> other thoughts, anyone?

Hmm odd, no one should have complained, it should just have been added
to the compat header.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [PATCH 2.6] cciss typo fix
  2005-01-10 15:45 Miller, Mike (OS Dev)
@ 2005-01-10 15:50 ` James Bottomley
  0 siblings, 0 replies; 8+ messages in thread
From: James Bottomley @ 2005-01-10 15:50 UTC (permalink / raw)
  To: Miller, Mike (OS Dev)
  Cc: Jens Axboe, Andrew Morton, Linux Kernel, SCSI Mailing List

On Mon, 2005-01-10 at 09:45 -0600, Miller, Mike (OS Dev) wrote:
> Even if it were added to the compat header; is using __be32 correct in this context?

They should be.  The __be annotations track unconverted big endian
numbers.  be32_to_cpu checks that it's only taking __be annotated
variables (at least when sparse tracks it), so the cast is correct and
prevents sparse from warning.

James



^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [PATCH 2.6] cciss typo fix
@ 2005-01-10 15:45 Miller, Mike (OS Dev)
  2005-01-10 15:50 ` James Bottomley
  0 siblings, 1 reply; 8+ messages in thread
From: Miller, Mike (OS Dev) @ 2005-01-10 15:45 UTC (permalink / raw)
  To: Jens Axboe
  Cc: James Bottomley, Andrew Morton, Linux Kernel, SCSI Mailing List

> > > -		*block_size = be32_to_cpu(*((__be32 *) 
> > &buf->block_size[0]));
> > > +		*total_size = be32_to_cpu(*((__u32 *) 
> > &buf->total_size[0]))+1;
>


> From: Jens Axboe [mailto:axboe@suse.de]
> Hmm odd, no one should have complained, it should just have been added
> to the compat header.

Even if it were added to the compat header; is using __be32 correct in this context?

mikem

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [PATCH 2.6] cciss typo fix
@ 2005-01-07 23:34 Miller, Mike (OS Dev)
  0 siblings, 0 replies; 8+ messages in thread
From: Miller, Mike (OS Dev) @ 2005-01-07 23:34 UTC (permalink / raw)
  To: James Bottomley
  Cc: Andrew Morton, Jens Axboe, Linux Kernel, SCSI Mailing List

> -----Original Message-----
> From: James Bottomley [mailto:James.Bottomley@SteelEye.com]
> Erm, well it might not be defined in the SuSE kernel ... 
> that's based on
> 2.6.5, I believe.  These symbols are definitely defined in 
> the mainline
> kernel.

OK, then it looks like this isn't needed.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2.6] cciss typo fix
  2005-01-07 23:01 mike.miller
@ 2005-01-07 23:19 ` James Bottomley
  0 siblings, 0 replies; 8+ messages in thread
From: James Bottomley @ 2005-01-07 23:19 UTC (permalink / raw)
  To: mike.miller; +Cc: Andrew Morton, Jens Axboe, Linux Kernel, SCSI Mailing List

On Fri, 2005-01-07 at 17:01 -0600, mike.miller@hp.com wrote:
> -		*total_size = be32_to_cpu(*((__be32 *) &buf->total_size[0]))+1;
> -		*block_size = be32_to_cpu(*((__be32 *) &buf->block_size[0]));
> +		*total_size = be32_to_cpu(*((__u32 *) &buf->total_size[0]))+1;
> +		*block_size = be32_to_cpu(*((__u32 *) &buf->block_size[0]));

I don't think that's a typo.  It was introduced by this patch:

ChangeSet 1.1988.24.79 2004/10/06 07:55:02 viro@www.linux.org.uk
  [PATCH] cciss endianness and iomem annotations
 
The idea being that BE and LE numbers should be annotated differently,
so the __be32 annotations look correct to me.  I think sparse will warn
if you make this change.

James



^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 2.6] cciss typo fix
@ 2005-01-07 23:01 mike.miller
  2005-01-07 23:19 ` James Bottomley
  0 siblings, 1 reply; 8+ messages in thread
From: mike.miller @ 2005-01-07 23:01 UTC (permalink / raw)
  To: akpm, axboe; +Cc: linux-kernel, linux-scsi

This patch fixes a stupid typo. I thought I submitted this but I don't seem to
find it anywhere.

 cciss.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Signed-off-by: Mike Miller <mike.miller@hp.com>
-------------------------------------------------------------------------------
diff -burNp lx2610-p001/drivers/block/cciss.c lx2610/drivers/block/cciss.c
--- lx2610-p001/drivers/block/cciss.c	2005-01-07 15:29:29.645792288 -0600
+++ lx2610/drivers/block/cciss.c	2005-01-07 15:29:59.490255240 -0600
@@ -1505,8 +1505,8 @@ cciss_read_capacity(int ctlr, int logvol
 		return_code = sendcmd(CCISS_READ_CAPACITY,
 			ctlr, buf, sizeof(*buf), 1, logvol, 0, NULL, TYPE_CMD);
 	if (return_code == IO_OK) {
-		*total_size = be32_to_cpu(*((__be32 *) &buf->total_size[0]))+1;
-		*block_size = be32_to_cpu(*((__be32 *) &buf->block_size[0]));
+		*total_size = be32_to_cpu(*((__u32 *) &buf->total_size[0]))+1;
+		*block_size = be32_to_cpu(*((__u32 *) &buf->block_size[0]));
 	} else { /* read capacity command failed */
 		printk(KERN_WARNING "cciss: read capacity failed\n");
 		*total_size = 0;

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2005-01-10 15:53 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-07 23:24 [PATCH 2.6] cciss typo fix Miller, Mike (OS Dev)
2005-01-07 23:32 ` James Bottomley
2005-01-08  8:41 ` Jens Axboe
  -- strict thread matches above, loose matches on Subject: below --
2005-01-10 15:45 Miller, Mike (OS Dev)
2005-01-10 15:50 ` James Bottomley
2005-01-07 23:34 Miller, Mike (OS Dev)
2005-01-07 23:01 mike.miller
2005-01-07 23:19 ` James Bottomley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).