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  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 22 Jul 2014 13:17:22 -0700
From:	Greg KH <gregkh@...uxfoundation.org>
To:	Jeff Oczek <jeffoczek@...il.com>
Cc:	devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] staging: cxt1e1: Fix static symbol sparse warnings for
 global vars in linux.c

On Tue, Jul 22, 2014 at 04:07:51PM -0400, Jeff Oczek wrote:
> Put extern declarations in cxt1e1_common.h to reduce sparse warnings for linux.c:
> drivers/staging/cxt1e1/linux.c:86:13: warning:
>   symbol 'error_flag' was not declared. Should it be static?
> drivers/staging/cxt1e1/linux.c:91:13: warning:
>   symbol 'cxt1e1_max_mru' was not declared. Should it be static?
> drivers/staging/cxt1e1/linux.c:95:13: warning:
>   symbol 'cxt1e1_max_mtu' was not declared. Should it be static?
> drivers/staging/cxt1e1/linux.c:96:13: warning:
>   symbol 'max_mtu_default' was not declared. Should it be static?
> drivers/staging/cxt1e1/linux.c:99:13: warning:
>   symbol 'max_txdesc_used' was not declared. Should it be static?
> drivers/staging/cxt1e1/linux.c:100:13: warning:
>   symbol 'max_txd:esc_default' was not declared. Should it be static?
> drivers/staging/cxt1e1/linux.c:103:13: warning:
>   symbol 'max_rxdesc_used' was not declared. Should it be static?
> drivers/staging/cxt1e1/linux.c:104:13: warning:
>   symbol 'max_rxdesc_default' was not declared. Should it be static?
> drivers/staging/cxt1e1/linux.c:153:1: warning:
>   symbol 'c4_wk_chan_restart' was not declared. Should it be static?
> drivers/staging/cxt1e1/linux.c:171:1: warning:
>   symbol 'c4_wk_chan_init' was not declared. Should it be static?
> drivers/staging/cxt1e1/linux.c:186:1: warning:
>   symbol 'c4_wq_port_init' was not declared. Should it be static?
> drivers/staging/cxt1e1/linux.c:208:1: warning:
>   symbol 'c4_wq_port_cleanup' was not declared. Should it be static?
> 
> Signed-off-by: Jeff Oczek <jeffoczek@...il.com>
> ---
>  drivers/staging/cxt1e1/cxt1e1_common.h | 15 +++++++++++++++
>  drivers/staging/cxt1e1/hwprobe.c       |  2 +-
>  drivers/staging/cxt1e1/linux.c         |  2 +-
>  drivers/staging/cxt1e1/musycc.c        |  7 +------
>  drivers/staging/cxt1e1/pmcc4_drv.c     |  5 +----
>  5 files changed, 19 insertions(+), 12 deletions(-)
>  create mode 100644 drivers/staging/cxt1e1/cxt1e1_common.h
> 
> diff --git a/drivers/staging/cxt1e1/cxt1e1_common.h b/drivers/staging/cxt1e1/cxt1e1_common.h
> new file mode 100644
> index 0000000..ac6b974
> --- /dev/null
> +++ b/drivers/staging/cxt1e1/cxt1e1_common.h
> @@ -0,0 +1,15 @@
> +#ifndef __CXT1E1_COMMON_H
> +#define __CXT1E1_COMMON_H
> +
> +#include "pmcc4.h"
> +
> +extern int error_flag;

I know you didn't name this variable, but wow, that's a horrid name for
a global variable :)

Any way you could change this to first fix up the name of the variable
to something a bit more "device-specific" first, before this patch?

Perhaps "cxt1e1_error_flag"?

> +extern int cxt1e1_max_mru;
> +extern int cxt1e1_max_mtu;

These are fine.

> +extern int max_mtu_default;
> +extern int max_txdesc_used;
> +extern int max_txdesc_default;
> +extern int max_rxdesc_used;
> +extern int max_rxdesc_default;

Again, these are bad names, can you do the same thing here?

thanks,

greg k-h
--
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