Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 311b8935 authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'sparc_sparse_fixes'



Sam Ravnborg says:

====================
sparc sparse fixes + diverse cleanup

v1 => v2
- audit of all patches. I deliberately waited a while
  before doing so - in order to look at them with fresh eyes.
- Fix bogus sbus() use found by davem in iommu.c
- Split patch touching iommu.c and io-unit.c in two
- Fix bogus sbus use in time_32 (sbus_readw => sbus_readl)
- Dropped patch that touches signal_64.c
  __put_user() does many magic things and I could not convince
  myself that dropping a cast of a pointer to (u64) was correct.
- Updated a few changelogs to be more precise/descriptive
- In systbls.h rearrange include and move include to the common part
- Updated cover letter (this mail)

Fix build breakage of sparc32 in certain configurations

Fix sparse warnings in sparc32.
  What is remaining:
  - "shift too big" warnings in the soft floating point code.
    This is too complex - so I dropped trying to fix these

Fix sparse warnings in sparc64.
  What is remaining:
  - "shift too big" warnings in the soft floating point code (like sparc32)
  - pcr.c defines arch_irq_work_raise() which is also defined as __weak in common code.
    As I recall there are some issues with weak functions with prototypes
    so it is left as-is
  - signal32.c issue a lot of "cast removes address space of expression"
    This actually deserve an extra look - as I think this may be
    some code that mixes two sizes to __put_user()
  - viohs.c uses a variable length array
  - init_64.c reference vmemmap_free which is properly declared in common code
    but seems to be guarded by wrong ifdefs
  - signal_64.c mix with __user pointers and wrong casts

None of the remaining sparse warnings looks simple to fix - and any
hints how to proceed are appreciated.

A lot of the sparse warnings are fixed by addding or moving function
prototypes to common files. Many prototypes are for functions
solely called from assembler so they are added only to shut up sparse.
But there is also a lot of prototypes that had local declarations
which are now visible both in the file where the function
is defined and in the file where the function is used.

Change all prototypes in sparc .h files so they do not use extern.
This change touches a lot of files.

Fix so we no longer assumes _NIG_WORDS can have more than one value,
and add a build time check to catch if the value changes anyway.

**The following patches require extra careful review:**

[PATCH 07/34] sparc32: fix sparse warnings in sys_sparc_32.c
  The return type of a few syscalls has been changed for sparc32,
  to align with sparc64.
  I assume this is safe to do.

[PATCH 08/34] sparc32: remove cast from output constraints in math asm statements
[PATCH 09/34] sparc64: remove cast from output constraints in math asm statements
  I have not much experience with gcc inline
  assembler - so please check that this looks OK.
  A cast in the output section of the inline
  assembler is dropped - which should be OK.

[PATCH 23/34] sparc64: clean up compat_sigset_t.seta handling
  This drops code that assumed _NSIG_WORDS could change.
  But as _NIG_WORDS are always constant drop this code.

[PATCH 34/34] sparc64: fix sparse warnings in int_64.c
  Introduces some ugly ifdef in the code.
  Was not sure if there was a smarter way to do this.
  It looked like some code was executed in the
  !CONFIG_NEED_MULTIPLE_NODES case which is not required.
  For now the simple solution with ifdef was used.

**The following patches touches files outside arch/sparc:**

[PATCH 24/34] sparc64: fix sparse warning in tsb.c
  Touches kernel/sysctl.c - removes a few sparc64 specific lines

[PATCH 27/34] sparc: fix sparse warnings in smp_32.c + smp_64.c
  Adds prototype for setup_profiling_timer to include/linux/profile.h.
  I could not find any obvious candidates to cc: on this patch
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents bf656998 48d37216
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -124,7 +124,7 @@ extern void aes_sparc64_ctr_crypt_256(const u64 *key, const u64 *input,
				      u64 *output, unsigned int len,
				      u64 *iv);

struct aes_ops aes128_ops = {
static struct aes_ops aes128_ops = {
	.encrypt		= aes_sparc64_encrypt_128,
	.decrypt		= aes_sparc64_decrypt_128,
	.load_encrypt_keys	= aes_sparc64_load_encrypt_keys_128,
@@ -136,7 +136,7 @@ struct aes_ops aes128_ops = {
	.ctr_crypt		= aes_sparc64_ctr_crypt_128,
};

struct aes_ops aes192_ops = {
static struct aes_ops aes192_ops = {
	.encrypt		= aes_sparc64_encrypt_192,
	.decrypt		= aes_sparc64_decrypt_192,
	.load_encrypt_keys	= aes_sparc64_load_encrypt_keys_192,
@@ -148,7 +148,7 @@ struct aes_ops aes192_ops = {
	.ctr_crypt		= aes_sparc64_ctr_crypt_192,
};

struct aes_ops aes256_ops = {
static struct aes_ops aes256_ops = {
	.encrypt		= aes_sparc64_encrypt_256,
	.decrypt		= aes_sparc64_decrypt_256,
	.load_encrypt_keys	= aes_sparc64_load_encrypt_keys_256,
+4 −4
Original line number Diff line number Diff line
@@ -19,11 +19,11 @@

#define ATOMIC_INIT(i)  { (i) }

extern int __atomic_add_return(int, atomic_t *);
extern int atomic_cmpxchg(atomic_t *, int, int);
int __atomic_add_return(int, atomic_t *);
int atomic_cmpxchg(atomic_t *, int, int);
#define atomic_xchg(v, new) (xchg(&((v)->counter), new))
extern int __atomic_add_unless(atomic_t *, int, int);
extern void atomic_set(atomic_t *, int);
int __atomic_add_unless(atomic_t *, int, int);
void atomic_set(atomic_t *, int);

#define atomic_read(v)          (*(volatile int *)&(v)->counter)

+9 −9
Original line number Diff line number Diff line
@@ -19,15 +19,15 @@
#define atomic_set(v, i)	(((v)->counter) = i)
#define atomic64_set(v, i)	(((v)->counter) = i)

extern void atomic_add(int, atomic_t *);
extern void atomic64_add(long, atomic64_t *);
extern void atomic_sub(int, atomic_t *);
extern void atomic64_sub(long, atomic64_t *);
void atomic_add(int, atomic_t *);
void atomic64_add(long, atomic64_t *);
void atomic_sub(int, atomic_t *);
void atomic64_sub(long, atomic64_t *);

extern int atomic_add_ret(int, atomic_t *);
extern long atomic64_add_ret(long, atomic64_t *);
extern int atomic_sub_ret(int, atomic_t *);
extern long atomic64_sub_ret(long, atomic64_t *);
int atomic_add_ret(int, atomic_t *);
long atomic64_add_ret(long, atomic64_t *);
int atomic_sub_ret(int, atomic_t *);
long atomic64_sub_ret(long, atomic64_t *);

#define atomic_dec_return(v) atomic_sub_ret(1, v)
#define atomic64_dec_return(v) atomic64_sub_ret(1, v)
@@ -106,7 +106,7 @@ static inline long atomic64_add_unless(atomic64_t *v, long a, long u)

#define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1, 0)

extern long atomic64_dec_if_positive(atomic64_t *v);
long atomic64_dec_if_positive(atomic64_t *v);

/* Atomic operations are already serializing */
#define smp_mb__before_atomic_dec()	barrier()
+3 −3
Original line number Diff line number Diff line
@@ -34,8 +34,8 @@
 * NOTE: these routines are implementation dependent--
 * understand the hardware you are querying!
 */
extern void set_auxio(unsigned char bits_on, unsigned char bits_off);
extern unsigned char get_auxio(void); /* .../asm/floppy.h */
void set_auxio(unsigned char bits_on, unsigned char bits_off);
unsigned char get_auxio(void); /* .../asm/floppy.h */

/*
 * The following routines are provided for driver-compatibility
@@ -78,7 +78,7 @@ do { \


/* AUXIO2 (Power Off Control) */
extern __volatile__ unsigned char * auxio_power_register;
extern volatile u8 __iomem *auxio_power_register;

#define	AUXIO_POWER_DETECT_FAILURE	32
#define	AUXIO_POWER_CLEAR_FAILURE	2
+2 −2
Original line number Diff line number Diff line
@@ -82,7 +82,7 @@
 *
 * on - AUXIO_LTE_ON or AUXIO_LTE_OFF
 */
extern void auxio_set_lte(int on);
void auxio_set_lte(int on);

#define AUXIO_LED_ON	1
#define AUXIO_LED_OFF	0
@@ -91,7 +91,7 @@ extern void auxio_set_lte(int on);
 *
 * on - AUXIO_LED_ON or AUXIO_LED_OFF
 */
extern void auxio_set_led(int on);
void auxio_set_led(int on);

#endif /* ifndef __ASSEMBLY__ */

Loading