lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 30 Apr 2007 08:44:14 -0700
From:	Randy Dunlap <randy.dunlap@...cle.com>
To:	David Rientjes <rientjes@...gle.com>
Cc:	Linus Torvalds <torvalds@...ux-foundation.org>,
	Neela Kolli <Neela.Kolli@...enio.com>,
	Christoph Hellwig <hch@...radead.org>,
	linux-kernel@...r.kernel.org
Subject: Re: [patch] megaraid: fix CONFIG_PROC_FS compile errors

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@...enio.com>
> Cc: Christoph Hellwig <hch@...radead.org>
> Signed-off-by: David Rientjes <rientjes@...gle.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 ***
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists