Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759757AbXIZOHv (ORCPT ); Wed, 26 Sep 2007 10:07:51 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754349AbXIZOHm (ORCPT ); Wed, 26 Sep 2007 10:07:42 -0400 Received: from hancock.steeleye.com ([71.30.118.248]:39969 "EHLO hancock.sc.steeleye.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754534AbXIZOHk (ORCPT ); Wed, 26 Sep 2007 10:07:40 -0400 Subject: Re: queued patches for SCSI for 2.6.24 From: James Bottomley To: FUJITA Tomonori Cc: jeff@garzik.org, matthew@wil.cx, akpm@linux-foundation.org, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, fujita.tomonori@lab.ntt.co.jp In-Reply-To: <20070925102150V.tomof@acm.org> References: <20070926025608.GA3899@parisc-linux.org> <46F9D328.4030801@garzik.org> <1190778353.8707.29.camel@localhost.localdomain> <20070925102150V.tomof@acm.org> Content-Type: text/plain Date: Wed, 26 Sep 2007 09:07:37 -0500 Message-Id: <1190815658.3359.11.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.10.3 (2.10.3-4.fc7) Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3253 Lines: 81 On Wed, 2007-09-26 at 13:56 +0900, FUJITA Tomonori wrote: > On Tue, 25 Sep 2007 22:45:53 -0500 > James Bottomley wrote: > > > On Tue, 2007-09-25 at 23:34 -0400, Jeff Garzik wrote: > > > Matthew Wilcox wrote: > > > > On Tue, Sep 25, 2007 at 10:37:33PM -0400, Jeff Garzik wrote: > > > >> Are there any const-ness worries for scsi_host_template, or plans for > > > >> the future? I do not see any other examples of the host template > > > >> members getting modified. > > > > > > > > Goodness, Jeff, you haven't looked too hard. There's dozens of examples > > > > I've come across trawling the horrible unmaintained drivers. I'd love > > > > to see scsi_host_template become const, but it's not happening any time > > > > soon, and we can address this little piece when the time comes. > > > > > > Well, sure, the driver is the owner of that memory. > > > > > > We're talking about common code. > > > > > > If everybody agrees SHT is R/W in the core, Fujita-san's patch is fine. > > > > Well, I don't like mucking with the template either. > > > > This whole mess is generated basically because the zero default of the > > template should be treated as initiator. How about this, which makes > > that manifest? > > > > James > > > > diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c > > index adc9559..7e26440 100644 > > --- a/drivers/scsi/hosts.c > > +++ b/drivers/scsi/hosts.c > > @@ -342,7 +342,11 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize) > > shost->unchecked_isa_dma = sht->unchecked_isa_dma; > > shost->use_clustering = sht->use_clustering; > > shost->ordered_tag = sht->ordered_tag; > > - shost->active_mode = sht->supported_mode; > > + if (sht->supported_mode == MODE_UNKNOWN) > > + /* means we didn't set it ... default to INITIATOR */ > > + shost->active_mode = MODE_INITIATOR; > > + else > > + shost->active_mode = sht->supported_mode; > > > > if (sht->max_host_blocked) > > shost->max_host_blocked = sht->max_host_blocked; > > diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c > > index 0088c4d..4965e9e 100644 > > --- a/drivers/scsi/scsi_sysfs.c > > +++ b/drivers/scsi/scsi_sysfs.c > > @@ -209,11 +209,13 @@ show_shost_mode(unsigned int mode, char *buf) > > static ssize_t show_shost_supported_mode(struct class_device *class_dev, char *buf) > > { > > struct Scsi_Host *shost = class_to_shost(class_dev); > > + unsigned int supported_mode = shost->hostt->supported_mode; > > > > - if (shost->hostt->supported_mode == MODE_UNKNOWN) > > - return snprintf(buf, 20, "unknown\n"); > > - else > > - return show_shost_mode(shost->hostt->supported_mode, buf); > > + if (supported_mode == MODE_UNKNOWN) > > + /* by default this should be initiator */ > > + supported_mode = MODE_INITIATOR; > > + > > + return show_shost_mode(shost->hostt->supported_mode, buf); > > should be: > > return show_shost_mode(supported_mode, buf); Yes, sorry ... code in haste etc. James - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/