* [patch] megaraid: fix CONFIG_PROC_FS compile errors
@ 2007-04-30 14:35 David Rientjes
2007-04-30 15:44 ` Randy Dunlap
0 siblings, 1 reply; 4+ messages in thread
From: David Rientjes @ 2007-04-30 14:35 UTC (permalink / raw)
To: Linus Torvalds; +Cc: Neela Kolli, Christoph Hellwig, linux-kernel
Only declare mega_proc_dir_entry() in CONFIG_PROC_FS. We should call
mega_create_proc_entry() only in this configuration so make sure it's defined
if we call it.
Only define mega_adapinq() in CONFIG_PROC_FS. mega_internal_dev_inquiry()
and mega_print_inquiry() were never declared without CONFIG_PROC_FS so
make sure we don't have prototypes for them if we aren't going to define
them.
Move the declaration of 'buf' in mega_remove_one() because we only use it
in the CONFIG_PROC_FS case.
Cc: Neela Kolli <Neela.Kolli@engenio.com>
Cc: Christoph Hellwig <hch@infradead.org>
Signed-off-by: David Rientjes <rientjes@google.com>
---
drivers/scsi/megaraid.c | 10 +++++++++-
drivers/scsi/megaraid.h | 5 +++--
2 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c
--- a/drivers/scsi/megaraid.c
+++ b/drivers/scsi/megaraid.c
@@ -84,7 +84,10 @@ MODULE_PARM_DESC(max_mbox_busy_wait, "Maximum wait for mailbox in microseconds i
static int hba_count;
static adapter_t *hba_soft_state[MAX_CONTROLLERS];
+
+#ifdef CONFIG_PROC_FS
static struct proc_dir_entry *mega_proc_dir_entry;
+#endif
/* For controller re-ordering */
static struct mega_hbas mega_hbas[MAX_CONTROLLERS];
@@ -4342,6 +4345,7 @@ mega_support_cluster(adapter_t *adapter)
return 0;
}
+#ifdef CONFIG_PROC_FS
/**
* mega_adapinq()
@@ -4448,6 +4452,7 @@ mega_internal_dev_inquiry(adapter_t *adapter, u8 ch, u8 tgt,
return rval;
}
+#endif
/**
* mega_internal_command()
@@ -4890,7 +4895,9 @@ megaraid_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
pci_set_drvdata(pdev, host);
+#ifdef CONFIG_PROC_FS
mega_create_proc_entry(hba_count, mega_proc_dir_entry);
+#endif
error = scsi_add_host(host, &pdev->dev);
if (error)
@@ -4965,7 +4972,6 @@ megaraid_remove_one(struct pci_dev *pdev)
{
struct Scsi_Host *host = pci_get_drvdata(pdev);
adapter_t *adapter = (adapter_t *)host->hostdata;
- char buf[12] = { 0 };
scsi_remove_host(host);
@@ -4982,6 +4988,8 @@ megaraid_remove_one(struct pci_dev *pdev)
#ifdef CONFIG_PROC_FS
if (adapter->controller_proc_dir_entry) {
+ char buf[12] = { 0 };
+
remove_proc_entry("stat", adapter->controller_proc_dir_entry);
remove_proc_entry("config",
adapter->controller_proc_dir_entry);
diff --git a/drivers/scsi/megaraid.h b/drivers/scsi/megaraid.h
--- a/drivers/scsi/megaraid.h
+++ b/drivers/scsi/megaraid.h
@@ -1002,7 +1002,9 @@ static int megaraid_reset(Scsi_Cmnd *);
static int megaraid_abort_and_reset(adapter_t *, Scsi_Cmnd *, int);
static int megaraid_biosparam(struct scsi_device *, struct block_device *,
sector_t, int []);
+#ifdef CONFIG_PROC_FS
static int mega_print_inquiry(char *, char *);
+#endif
static int mega_build_sglist (adapter_t *adapter, scb_t *scb,
u32 *buffer, u32 *length);
@@ -1040,10 +1042,9 @@ static int proc_rdrv_20(char *, char **, off_t, int, int *, void *);
static int proc_rdrv_30(char *, char **, off_t, int, int *, void *);
static int proc_rdrv_40(char *, char **, off_t, int, int *, void *);
static int proc_rdrv(adapter_t *, char *, int, int);
-#endif
-
static int mega_adapinq(adapter_t *, dma_addr_t);
static int mega_internal_dev_inquiry(adapter_t *, u8, u8, dma_addr_t);
+#endif
static int mega_support_ext_cdb(adapter_t *);
static mega_passthru* mega_prepare_passthru(adapter_t *, scb_t *,
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [patch] megaraid: fix CONFIG_PROC_FS compile errors
2007-04-30 14:35 [patch] megaraid: fix CONFIG_PROC_FS compile errors David Rientjes
@ 2007-04-30 15:44 ` Randy Dunlap
2007-05-01 2:25 ` Andrew Morton
0 siblings, 1 reply; 4+ messages in thread
From: Randy Dunlap @ 2007-04-30 15:44 UTC (permalink / raw)
To: David Rientjes
Cc: Linus Torvalds, Neela Kolli, Christoph Hellwig, linux-kernel
On Mon, 30 Apr 2007 07:35:00 -0700 (PDT) David Rientjes wrote:
> Only declare mega_proc_dir_entry() in CONFIG_PROC_FS. We should call
> mega_create_proc_entry() only in this configuration so make sure it's defined
> if we call it.
>
> Only define mega_adapinq() in CONFIG_PROC_FS. mega_internal_dev_inquiry()
> and mega_print_inquiry() were never declared without CONFIG_PROC_FS so
> make sure we don't have prototypes for them if we aren't going to define
> them.
>
> Move the declaration of 'buf' in mega_remove_one() because we only use it
> in the CONFIG_PROC_FS case.
Just noting the presence of:
http://www.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.21-rc7/2.6.21-rc7-mm2/broken-out/megaraid-fix-warnings-when-config_proc_fs=n.patch
Oh, and that SCSI patches need to go to the linux-scsi mailing list.
> Cc: Neela Kolli <Neela.Kolli@engenio.com>
> Cc: Christoph Hellwig <hch@infradead.org>
> Signed-off-by: David Rientjes <rientjes@google.com>
> ---
> drivers/scsi/megaraid.c | 10 +++++++++-
> drivers/scsi/megaraid.h | 5 +++--
> 2 files changed, 12 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c
> --- a/drivers/scsi/megaraid.c
> +++ b/drivers/scsi/megaraid.c
> @@ -84,7 +84,10 @@ MODULE_PARM_DESC(max_mbox_busy_wait, "Maximum wait for mailbox in microseconds i
>
> static int hba_count;
> static adapter_t *hba_soft_state[MAX_CONTROLLERS];
> +
> +#ifdef CONFIG_PROC_FS
> static struct proc_dir_entry *mega_proc_dir_entry;
> +#endif
>
> /* For controller re-ordering */
> static struct mega_hbas mega_hbas[MAX_CONTROLLERS];
> @@ -4342,6 +4345,7 @@ mega_support_cluster(adapter_t *adapter)
> return 0;
> }
>
> +#ifdef CONFIG_PROC_FS
>
> /**
> * mega_adapinq()
> @@ -4448,6 +4452,7 @@ mega_internal_dev_inquiry(adapter_t *adapter, u8 ch, u8 tgt,
> return rval;
> }
>
> +#endif
>
> /**
> * mega_internal_command()
> @@ -4890,7 +4895,9 @@ megaraid_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
>
> pci_set_drvdata(pdev, host);
>
> +#ifdef CONFIG_PROC_FS
> mega_create_proc_entry(hba_count, mega_proc_dir_entry);
> +#endif
>
> error = scsi_add_host(host, &pdev->dev);
> if (error)
> @@ -4965,7 +4972,6 @@ megaraid_remove_one(struct pci_dev *pdev)
> {
> struct Scsi_Host *host = pci_get_drvdata(pdev);
> adapter_t *adapter = (adapter_t *)host->hostdata;
> - char buf[12] = { 0 };
>
> scsi_remove_host(host);
>
> @@ -4982,6 +4988,8 @@ megaraid_remove_one(struct pci_dev *pdev)
>
> #ifdef CONFIG_PROC_FS
> if (adapter->controller_proc_dir_entry) {
> + char buf[12] = { 0 };
> +
> remove_proc_entry("stat", adapter->controller_proc_dir_entry);
> remove_proc_entry("config",
> adapter->controller_proc_dir_entry);
> diff --git a/drivers/scsi/megaraid.h b/drivers/scsi/megaraid.h
> --- a/drivers/scsi/megaraid.h
> +++ b/drivers/scsi/megaraid.h
> @@ -1002,7 +1002,9 @@ static int megaraid_reset(Scsi_Cmnd *);
> static int megaraid_abort_and_reset(adapter_t *, Scsi_Cmnd *, int);
> static int megaraid_biosparam(struct scsi_device *, struct block_device *,
> sector_t, int []);
> +#ifdef CONFIG_PROC_FS
> static int mega_print_inquiry(char *, char *);
> +#endif
>
> static int mega_build_sglist (adapter_t *adapter, scb_t *scb,
> u32 *buffer, u32 *length);
> @@ -1040,10 +1042,9 @@ static int proc_rdrv_20(char *, char **, off_t, int, int *, void *);
> static int proc_rdrv_30(char *, char **, off_t, int, int *, void *);
> static int proc_rdrv_40(char *, char **, off_t, int, int *, void *);
> static int proc_rdrv(adapter_t *, char *, int, int);
> -#endif
> -
> static int mega_adapinq(adapter_t *, dma_addr_t);
> static int mega_internal_dev_inquiry(adapter_t *, u8, u8, dma_addr_t);
> +#endif
>
> static int mega_support_ext_cdb(adapter_t *);
> static mega_passthru* mega_prepare_passthru(adapter_t *, scb_t *,
> -
---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [patch] megaraid: fix CONFIG_PROC_FS compile errors
2007-04-30 15:44 ` Randy Dunlap
@ 2007-05-01 2:25 ` Andrew Morton
2007-05-01 4:25 ` Randy Dunlap
0 siblings, 1 reply; 4+ messages in thread
From: Andrew Morton @ 2007-05-01 2:25 UTC (permalink / raw)
To: Randy Dunlap
Cc: David Rientjes, Linus Torvalds, Neela Kolli, Christoph Hellwig,
linux-kernel
On Mon, 30 Apr 2007 08:44:14 -0700 Randy Dunlap <randy.dunlap@oracle.com> wrote:
> On Mon, 30 Apr 2007 07:35:00 -0700 (PDT) David Rientjes wrote:
>
> > Only declare mega_proc_dir_entry() in CONFIG_PROC_FS. We should call
> > mega_create_proc_entry() only in this configuration so make sure it's defined
> > if we call it.
> >
> > Only define mega_adapinq() in CONFIG_PROC_FS. mega_internal_dev_inquiry()
> > and mega_print_inquiry() were never declared without CONFIG_PROC_FS so
> > make sure we don't have prototypes for them if we aren't going to define
> > them.
> >
> > Move the declaration of 'buf' in mega_remove_one() because we only use it
> > in the CONFIG_PROC_FS case.
>
> Just noting the presence of:
> http://www.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.21-rc7/2.6.21-rc7-mm2/broken-out/megaraid-fix-warnings-when-config_proc_fs=n.patch
>
That patch has been submitted fourteen times in the past year, and was
completely ignored each time.
>
> Oh, and that SCSI patches need to go to the linux-scsi mailing list.
>
There seem to be little point in doing that.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch] megaraid: fix CONFIG_PROC_FS compile errors
2007-05-01 2:25 ` Andrew Morton
@ 2007-05-01 4:25 ` Randy Dunlap
0 siblings, 0 replies; 4+ messages in thread
From: Randy Dunlap @ 2007-05-01 4:25 UTC (permalink / raw)
To: Andrew Morton
Cc: David Rientjes, Linus Torvalds, Neela Kolli, Christoph Hellwig,
linux-kernel
Andrew Morton wrote:
> On Mon, 30 Apr 2007 08:44:14 -0700 Randy Dunlap <randy.dunlap@oracle.com> wrote:
>
>> On Mon, 30 Apr 2007 07:35:00 -0700 (PDT) David Rientjes wrote:
>>
>>> Only declare mega_proc_dir_entry() in CONFIG_PROC_FS. We should call
>>> mega_create_proc_entry() only in this configuration so make sure it's defined
>>> if we call it.
>>>
>>> Only define mega_adapinq() in CONFIG_PROC_FS. mega_internal_dev_inquiry()
>>> and mega_print_inquiry() were never declared without CONFIG_PROC_FS so
>>> make sure we don't have prototypes for them if we aren't going to define
>>> them.
>>>
>>> Move the declaration of 'buf' in mega_remove_one() because we only use it
>>> in the CONFIG_PROC_FS case.
>> Just noting the presence of:
>> http://www.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.21-rc7/2.6.21-rc7-mm2/broken-out/megaraid-fix-warnings-when-config_proc_fs=n.patch
>>
>
> That patch has been submitted fourteen times in the past year, and was
> completely ignored each time.
>
>> Oh, and that SCSI patches need to go to the linux-scsi mailing list.
>>
>
> There seem to be little point in doing that.
Yes, I guess I was speaking theory instead of reality.
I suppose that one alternative is for you to merge those long-queued
patches instead of sending them on to linux-scsi over and over again.
--
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-05-01 4:22 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-30 14:35 [patch] megaraid: fix CONFIG_PROC_FS compile errors David Rientjes
2007-04-30 15:44 ` Randy Dunlap
2007-05-01 2:25 ` Andrew Morton
2007-05-01 4:25 ` Randy Dunlap
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox