diff options
| author | Jerry Jelinek <jerry.jelinek@joyent.com> | 2019-10-14 12:18:41 +0000 |
|---|---|---|
| committer | Jerry Jelinek <jerry.jelinek@joyent.com> | 2019-10-14 12:18:41 +0000 |
| commit | 755372d9e950669d3f6b867ce43d056a939938ee (patch) | |
| tree | b2ef05a7e7a9db118fd0c0d7b338d8c67c16dd50 | |
| parent | 0210cc0a214ebbcce779cf2d621eecec8108f129 (diff) | |
| parent | 8e0c82482ca0deab087522e43df87919b37037f3 (diff) | |
| download | illumos-joyent-755372d9e950669d3f6b867ce43d056a939938ee.tar.gz | |
[illumos-gate merge]
commit 8e0c82482ca0deab087522e43df87919b37037f3
10178 Enable compiler warnings when building C++ code
commit ebc5aadbbe5490fb3d00525924989d180fff369d
11665 SMB2 NEGOTIATE Security Mode handling is wrong
11659 SMB2 protocol version negotiation needs work
11670 SMB2_FLAGS_SIGNED is not valid during NEGOTIATE
commit 2ceb34da5f472ca531def3b536d203d345515f2a
11802 xencons: cast between incompatible function types
commit 95d486fbe6ce779cf0bbaf748766b2404e3f1116
11800 i86hvm: cast between incompatible function types
commit e39d848858aa235e4715efe1293ed57ddb0231c5
11782 reboot -f ends up creating bad /boot/transient.conf
11783 Print a message when rebooting due to a stale boot archive
commit 00a2bb8f2626ebdf8b00480ccc705df3502feab1
11795 ksslf: cast between incompatible function types
commit eb09fcf8417871597746d29fbfa39665d2623d5a
11789 gld: cast between incompatible function types
commit ca19b8572adc4c6a3d44d243844ef95865864bf7
11721 bnxe: cast between incompatible function types
36 files changed, 429 insertions, 253 deletions
diff --git a/usr/src/Makefile.master b/usr/src/Makefile.master index cfd4d0f885..a0699583e5 100644 --- a/usr/src/Makefile.master +++ b/usr/src/Makefile.master @@ -26,11 +26,11 @@ # Copyright 2015, OmniTI Computer Consulting, Inc. All rights reserved. # Copyright 2015 Gary Mills # Copyright 2015 Igor Kozhukhov <ikozhukhov@gmail.com> -# Copyright 2016 RackTop Systems. # Copyright 2016 Toomas Soome <tsoome@me.com> # Copyright 2017 Joyent, Inc. # Copyright 2018 OmniOS Community Edition (OmniOSce) Association. # Copyright 2019, Joyent, Inc. +# Copyright 2019 RackTop Systems. # # @@ -487,7 +487,15 @@ include $(SRC)/Makefile.smatch # # turn warnings into errors (C++) -CCERRWARN= -xwe +CCERRWARN = -errtags=yes -errwarn=%all +CCERRWARN += -erroff=E_EMPTY_TRANSLATION_UNIT +CCERRWARN += -erroff=E_STATEMENT_NOT_REACHED + +CCERRWARN += -_gcc=-Wno-missing-braces +CCERRWARN += -_gcc=-Wno-sign-compare +CCERRWARN += -_gcc=-Wno-unknown-pragmas +CCERRWARN += -_gcc=-Wno-unused-parameter +CCERRWARN += -_gcc=-Wno-missing-field-initializers # C standard. Keep Studio flags until we get rid of lint. CSTD_GNU89= -xc99=%none diff --git a/usr/src/cmd/audio/audioconvert/Makefile b/usr/src/cmd/audio/audioconvert/Makefile index 42248df2ed..3cdd2b4e0e 100644 --- a/usr/src/cmd/audio/audioconvert/Makefile +++ b/usr/src/cmd/audio/audioconvert/Makefile @@ -23,11 +23,13 @@ # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # +# Copyright 2019 RackTop Systems. +# # Makefile for cmd/audio/audioconvert PROG= audioconvert -include ../../Makefile.cmd +include ../../Makefile.cmd INCLUDES += -I../include -I. @@ -41,6 +43,11 @@ LDLIBS += -laudio -lm -lc LDFLAGS += -L../utilities +CCERRWARN += -_gcc=-Wno-switch +CCERRWARN += -_gcc=-Wno-parentheses +CCERRWARN += -_gcc=-Wno-ignored-qualifiers +CCERRWARN += -_gcc=-Wno-return-type + .PARALLEL: $(OBJS) .KEEP_STATE: diff --git a/usr/src/cmd/audio/utilities/AudioHdrParse.cc b/usr/src/cmd/audio/utilities/AudioHdrParse.cc index eb47e2002b..03686ecaa8 100644 --- a/usr/src/cmd/audio/utilities/AudioHdrParse.cc +++ b/usr/src/cmd/audio/utilities/AudioHdrParse.cc @@ -22,10 +22,10 @@ /* * Copyright 2005 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * + * Copyright 2019 RackTop Systems. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <stdio.h> #include <string.h> #include <ctype.h> @@ -235,6 +235,7 @@ static char *lib_hz = NULL; return (AUDIO_ERR_BADARG); } delete khz; + /* FALLTHROUGH */ case 1: rate = irint(r); break; diff --git a/usr/src/cmd/audio/utilities/AudioTypeSampleRate.cc b/usr/src/cmd/audio/utilities/AudioTypeSampleRate.cc index 9a936ac150..e79e48ecbf 100644 --- a/usr/src/cmd/audio/utilities/AudioTypeSampleRate.cc +++ b/usr/src/cmd/audio/utilities/AudioTypeSampleRate.cc @@ -22,10 +22,10 @@ /* * Copyright (c) 1992-2001 by Sun Microsystems, Inc. * All rights reserved. + * + * Copyright 2019 RackTop Systems. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <stdlib.h> #include <memory.h> #include <math.h> @@ -80,7 +80,9 @@ Convert( Double length; int i; size_t nsamps; +#ifdef DEBUG size_t insamps; +#endif AudioError err; inhdr = inbuf->GetHeader(); @@ -133,6 +135,7 @@ Convert( (int)inbuf->GetHeader().Time_to_Samples(inbuf->GetLength()), (short *)outbuf->GetAddress()); +#ifdef DEBUG // do a sanity check. did we write more bytes then we had // available in the output buffer? insamps = (unsigned int) @@ -140,6 +143,7 @@ Convert( AUDIO_DEBUG((2, "TypeResample: after filter, insamps=%d, outsamps=%d\n", insamps, nsamps)); +#endif if (nsamps > outbuf->GetHeader().Time_to_Samples(outbuf->GetSize())) { AudioStderrMsg(outbuf, AUDIO_NOERROR, Fatal, diff --git a/usr/src/cmd/audio/utilities/Makefile b/usr/src/cmd/audio/utilities/Makefile index 5aa3024509..6d62590594 100644 --- a/usr/src/cmd/audio/utilities/Makefile +++ b/usr/src/cmd/audio/utilities/Makefile @@ -23,6 +23,7 @@ # Use is subject to license terms. # # Copyright (c) 2018, Joyent, Inc. +# Copyright 2019 RackTop Systems. include ../../Makefile.cmd @@ -37,6 +38,11 @@ CERRWARN += $(CNOWARN_UNINIT) CERRWARN += -_gcc=-Wno-unused-variable CERRWARN += -_gcc=-Wno-parentheses +CCERRWARN += -_gcc=-Wno-reorder +CCERRWARN += -_gcc=-Wno-ignored-qualifiers +CCERRWARN += -_gcc=-Wno-return-type +CCERRWARN += -_gcc=-Wno-switch + # not linted SMATCH=off diff --git a/usr/src/cmd/boot/bootadm/bootadm_loader.c b/usr/src/cmd/boot/bootadm/bootadm_loader.c index 1e41533df2..5755efd7d5 100644 --- a/usr/src/cmd/boot/bootadm/bootadm_loader.c +++ b/usr/src/cmd/boot/bootadm/bootadm_loader.c @@ -26,7 +26,7 @@ /* * Copyright 2015 Nexenta Systems, Inc. All rights reserved. * Copyright 2016 Toomas Soome <tsoome@me.com> - * Copyright 2018 OmniOS Community Edition (OmniOSce) Association. + * Copyright 2019 OmniOS Community Edition (OmniOSce) Association. */ /* @@ -1136,9 +1136,9 @@ update_temp(struct menu_lst *menu, char *dummy, char *opt) if (env != NULL) { env = getenv("boot-args"); - (void) fprintf(fp, "boot-args=\"%s %s\"\n", env, opt); + (void) fprintf(fp, "boot-args='%s %s'\n", env, opt); } else - (void) fprintf(fp, "boot-args=\"%s\"\n", opt); + (void) fprintf(fp, "boot-args='%s'\n", opt); (void) fclose(fp); return (BAM_SUCCESS); } @@ -1155,7 +1155,7 @@ update_temp(struct menu_lst *menu, char *dummy, char *opt) fp = fopen(path, "w"); if (fp == NULL) return (BAM_ERROR); - (void) fprintf(fp, "bootfile=\"%s;unix\"\n", opt); + (void) fprintf(fp, "bootfile='%s;unix'\n", opt); (void) fclose(fp); return (BAM_SUCCESS); } @@ -1163,13 +1163,13 @@ update_temp(struct menu_lst *menu, char *dummy, char *opt) fp = fopen(path, "w"); if (fp == NULL) return (BAM_ERROR); - (void) fprintf(fp, "bootfile=\"%s;unix\"\n", opt); + (void) fprintf(fp, "bootfile='%s;unix'\n", opt); if (env != NULL) { env = getenv("boot-args"); - (void) fprintf(fp, "boot-args=\"%s %s\"\n", env, opt); + (void) fprintf(fp, "boot-args='%s %s'\n", env, o); } else - (void) fprintf(fp, "boot-args=\"%s\"\n", o); + (void) fprintf(fp, "boot-args='%s'\n", o); (void) fflush(fp); (void) fclose(fp); diff --git a/usr/src/cmd/make/bin/Makefile b/usr/src/cmd/make/bin/Makefile index b6d3778402..51effa85b3 100644 --- a/usr/src/cmd/make/bin/Makefile +++ b/usr/src/cmd/make/bin/Makefile @@ -10,6 +10,7 @@ # # Copyright 2015, Richard Lowe. +# Copyright 2019 RackTop Systems. PROG= make POFILE= make.po @@ -40,6 +41,13 @@ LDLIBS += ../lib/bsd/libbsd.a -lc -lnsl -lumem CPPFLAGS += -D_FILE_OFFSET_BITS=64 +CCERRWARN += -_gcc=-Wno-unused-variable +CCERRWARN += -_gcc=-Wno-switch +CCERRWARN += -_gcc=-Wno-parentheses +CCERRWARN += -_gcc=-Wno-unused-function +CCERRWARN += -_gcc=-Wno-clobbered +CCERRWARN += -_gcc=-Wno-uninitialized + ROOTLINKS = $(ROOTCCSBIN)/make $(ROOTXPG4BIN)/make $(ROOTBIN)/dmake $(ROOTCCSLIB)/svr4.make \ $(ROOTLIB)/svr4.make diff --git a/usr/src/cmd/make/bin/doname.cc b/usr/src/cmd/make/bin/doname.cc index 5622c5f388..70289cc0b5 100644 --- a/usr/src/cmd/make/bin/doname.cc +++ b/usr/src/cmd/make/bin/doname.cc @@ -22,8 +22,8 @@ * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. * - * Copyright 2016 RackTop Systems. * Copyright (c) 2016 by Delphix. All rights reserved. + * Copyright 2019 RackTop Systems. */ /* @@ -2733,6 +2733,7 @@ sccs_get(register Name target, register Property *command) case DONT_KNOW_SCCS: /* We dont know by now there is no SCCS/s.* */ target->stat.has_sccs = NO_SCCS; + /* FALLTHROUGH */ case NO_SCCS: /* * If there is no SCCS/s.* but the plain file exists, diff --git a/usr/src/cmd/make/bin/files.cc b/usr/src/cmd/make/bin/files.cc index 1aefc4e5c5..647b8741bd 100644 --- a/usr/src/cmd/make/bin/files.cc +++ b/usr/src/cmd/make/bin/files.cc @@ -21,6 +21,8 @@ /* * Copyright 2003 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * + * Copyright 2019 RackTop Systems. */ /* @@ -682,6 +684,7 @@ top: k |= (lower_bound <= string_ch) && (string_ch <= (pattern_ch = pattern[1])); + /* FALLTHROUGH */ default: if (string_ch == (lower_bound = pattern_ch)) { diff --git a/usr/src/cmd/make/bin/implicit.cc b/usr/src/cmd/make/bin/implicit.cc index 184e5b6d97..9315077a6d 100644 --- a/usr/src/cmd/make/bin/implicit.cc +++ b/usr/src/cmd/make/bin/implicit.cc @@ -21,6 +21,8 @@ /* * Copyright 2004 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * + * Copyright 2019 RackTop Systems. */ /* @@ -322,6 +324,7 @@ posix_attempts: } continue; } + /* FALLTHROUGH */ case build_running: if(!name_found) { store_name(source); diff --git a/usr/src/cmd/make/bin/main.cc b/usr/src/cmd/make/bin/main.cc index 1320f68a4d..41aff926e9 100644 --- a/usr/src/cmd/make/bin/main.cc +++ b/usr/src/cmd/make/bin/main.cc @@ -23,6 +23,7 @@ * Use is subject to license terms. * * Copyright 2019, Joyent, Inc. + * Copyright 2019 RackTop Systems. */ /* @@ -1794,8 +1795,6 @@ read_files_and_state(int argc, char **argv) register Name name; Name new_make_value; Boolean save_do_not_exec_rule; - Name sdotMakefile; - Name sdotmakefile_name; static wchar_t state_file_str; static char state_file_str_mb[MAXPATHLEN]; static struct _Name state_filename; @@ -1818,10 +1817,6 @@ read_files_and_state(int argc, char **argv) Makefile = GETNAME(wcs_buffer, FIND_LENGTH); MBSTOWCS(wcs_buffer, "makefile"); makefile_name = GETNAME(wcs_buffer, FIND_LENGTH); - MBSTOWCS(wcs_buffer, "s.makefile"); - sdotmakefile_name = GETNAME(wcs_buffer, FIND_LENGTH); - MBSTOWCS(wcs_buffer, "s.Makefile"); - sdotMakefile = GETNAME(wcs_buffer, FIND_LENGTH); /* * initialize global dependency entry for .NOT_AUTO @@ -1914,6 +1909,7 @@ read_files_and_state(int argc, char **argv) case 2: append_char('D', &makeflags_string); append_char('D', &makeflags_string_posix); + /* FALLTHROUGH */ case 1: append_char('D', &makeflags_string); append_char('D', &makeflags_string_posix); @@ -1922,6 +1918,7 @@ read_files_and_state(int argc, char **argv) case 2: append_char('d', &makeflags_string); append_char('d', &makeflags_string_posix); + /* FALLTHROUGH */ case 1: append_char('d', &makeflags_string); append_char('d', &makeflags_string_posix); @@ -1959,12 +1956,15 @@ read_files_and_state(int argc, char **argv) case 4: append_char('P', &makeflags_string); append_char('P', &makeflags_string_posix); + /* FALLTHROUGH */ case 3: append_char('P', &makeflags_string); append_char('P', &makeflags_string_posix); + /* FALLTHROUGH */ case 2: append_char('P', &makeflags_string); append_char('P', &makeflags_string_posix); + /* FALLTHROUGH */ case 1: append_char('P', &makeflags_string); append_char('P', &makeflags_string_posix); diff --git a/usr/src/cmd/make/bin/read.cc b/usr/src/cmd/make/bin/read.cc index 0d47f5b2f6..d5445938ef 100644 --- a/usr/src/cmd/make/bin/read.cc +++ b/usr/src/cmd/make/bin/read.cc @@ -21,6 +21,8 @@ /* * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * + * Copyright 2019 RackTop Systems. */ /* @@ -1169,7 +1171,7 @@ case scan_name_state: if (paren_count + brace_count == 0) { source_p++; } - /* Fall into */ + /* FALLTHROUGH */ case tab_char: case space_char: if (paren_count + brace_count > 0) { diff --git a/usr/src/cmd/make/bin/read2.cc b/usr/src/cmd/make/bin/read2.cc index 50324ded6d..835b7f881e 100644 --- a/usr/src/cmd/make/bin/read2.cc +++ b/usr/src/cmd/make/bin/read2.cc @@ -21,6 +21,8 @@ /* * Copyright 2005 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * + * Copyright 2019 RackTop Systems. */ /* @@ -509,7 +511,7 @@ find_target_groups(register Name_vector target_list, register int i, Boolean res /* We need to keep this pointer so */ /* we can stuff it for last member */ clear_target_group = true; - /* fall into */ + /* FALLTHROUGH */ case 3: /* Middle group member */ /* Add this target to the */ /* current chain */ @@ -774,6 +776,7 @@ enter_dependencies(register Name target, Chain target_group, register Name_vecto built_last_make_run_seen = false; command_changed = true; target->ran_command = true; + /* FALLTHROUGH */ case reading_statefile: /* Reading the statefile for the first time. Enter the rules */ /* as "Commands used" not "templates to use" */ @@ -785,6 +788,7 @@ enter_dependencies(register Name target, Chain target_group, register Name_vecto } line->body.line.command_used = command; } + /* FALLTHROUGH */ case reading_cpp_file: /* Reading report file from programs that reports */ /* dependencies. If this is the first time the target is */ diff --git a/usr/src/cmd/make/include/mk/defs.h b/usr/src/cmd/make/include/mk/defs.h index fb8745db8e..a3e5c3bc0c 100644 --- a/usr/src/cmd/make/include/mk/defs.h +++ b/usr/src/cmd/make/include/mk/defs.h @@ -23,6 +23,7 @@ * Use is subject to license terms. * * Copyright 2019, Joyent, Inc. + * Copyright 2019 RackTop Systems. */ #ifndef _MK_DEFS_H @@ -363,7 +364,7 @@ extern Doname execute_parallel(Property line, Boolean waitflg, extern Doname execute_serial(Property line); extern timestruc_t& exists(Name target); extern void fatal(const char *, ...) __NORETURN; -extern void fatal_reader(char *, ...); +extern void fatal_reader(char *, ...) __NORETURN; extern Doname find_ar_suffix_rule(Name target, Name true_target, Property *command, Boolean rechecking); extern Doname find_double_suffix_rule(Name target, Property *command, diff --git a/usr/src/cmd/make/include/mksh/misc.h b/usr/src/cmd/make/include/mksh/misc.h index d2048c391c..d5506fdedb 100644 --- a/usr/src/cmd/make/include/mksh/misc.h +++ b/usr/src/cmd/make/include/mksh/misc.h @@ -23,6 +23,8 @@ /* * Copyright 2004 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * + * Copyright 2019 RackTop Systems. */ #include <mksh/defs.h> @@ -32,8 +34,8 @@ extern Property append_prop(register Name target, register Property_id type); extern void append_string(register wchar_t *from, register String to, register int length); extern void enable_interrupt(register void (*handler) (int)); extern char *errmsg(int errnum); -extern void fatal_mksh(const char *message, ...); -extern void fatal_reader_mksh(const char *pattern, ...); +extern void fatal_mksh(const char *message, ...) __NORETURN; +extern void fatal_reader_mksh(const char *pattern, ...) __NORETURN; extern char *get_current_path_mksh(void); extern Property get_prop(register Property start, register Property_id type); extern char *getmem(size_t size); diff --git a/usr/src/cmd/make/lib/mksh/Makefile b/usr/src/cmd/make/lib/mksh/Makefile index 12eabf851e..bacec9b9dc 100644 --- a/usr/src/cmd/make/lib/mksh/Makefile +++ b/usr/src/cmd/make/lib/mksh/Makefile @@ -10,6 +10,7 @@ # # Copyright 2015, Richard Lowe. +# Copyright 2019 RackTop Systems. LIBRARY = libmksh.a VERS = .1 @@ -32,6 +33,11 @@ SRCDIR = ../ MAPFILES= CPPFLAGS += -D_FILE_OFFSET_BITS=64 +CCERRWARN += -_gcc=-Wno-unused-variable +CCERRWARN += -_gcc=-Wno-unused-function +CCERRWARN += -_gcc=-Wno-unused-value +CCERRWARN += -_gcc=-Wno-uninitialized + all: $(LIBS) install: all diff --git a/usr/src/cmd/make/lib/mksh/dosys.cc b/usr/src/cmd/make/lib/mksh/dosys.cc index 08ea785b73..651f58464e 100644 --- a/usr/src/cmd/make/lib/mksh/dosys.cc +++ b/usr/src/cmd/make/lib/mksh/dosys.cc @@ -25,6 +25,7 @@ /* * Copyright 2015, Joyent, Inc. + * Copyright 2019 RackTop Systems. */ @@ -440,7 +441,6 @@ await(Boolean ignore_error, Boolean silent_error, Name target, wchar_t *command, pid_t pid; struct stat stat_buff; int termination_signal; - char tmp_buf[MAXPATHLEN]; while ((pid = wait(&status)) != running_pid) { if (pid == -1) { @@ -477,8 +477,7 @@ await(Boolean ignore_error, Boolean silent_error, Name target, wchar_t *command, * If the child returned an error, we now try to print a * nice message about it. */ - - tmp_buf[0] = (int) nul_char; + if (!silent_error) { if (exit_status != 0) { (void) fprintf(stdout, diff --git a/usr/src/cmd/make/lib/vroot/Makefile b/usr/src/cmd/make/lib/vroot/Makefile index 4481099572..af580f47b6 100644 --- a/usr/src/cmd/make/lib/vroot/Makefile +++ b/usr/src/cmd/make/lib/vroot/Makefile @@ -10,6 +10,7 @@ # # Copyright 2015, Richard Lowe. +# Copyright 2019 RackTop Systems. LIBRARY = libvroot.a VERS = .1 @@ -47,6 +48,9 @@ SRCDIR = ../ MAPFILES= CPPFLAGS += -D_FILE_OFFSET_BITS=64 +CCERRWARN += -_gcc=-Wno-unused-variable +CCERRWARN += -_gcc=-Wno-parentheses + all: $(LIBS) install: all diff --git a/usr/src/cmd/svc/milestone/fs-usr b/usr/src/cmd/svc/milestone/fs-usr index 3caac452a3..e4b6a263e1 100644 --- a/usr/src/cmd/svc/milestone/fs-usr +++ b/usr/src/cmd/svc/milestone/fs-usr @@ -25,6 +25,7 @@ # All rights reserved. # Copyright 2016 Nexenta Systems, Inc. # Copyright 2012, Joyent, Inc. All rights reserved. +# Copyright 2019 OmniOS Community Edition (OmniOSce) Association. # . /lib/svc/share/smf_include.sh diff --git a/usr/src/lib/libfru/Makefile.flag b/usr/src/lib/libfru/Makefile.flag index 7588cd66e6..46fef309e9 100644 --- a/usr/src/lib/libfru/Makefile.flag +++ b/usr/src/lib/libfru/Makefile.flag @@ -22,6 +22,8 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # +# Copyright 2019 RackTop Systems. +# # lib/libfru/Makefile.flag # @@ -35,12 +37,17 @@ ROOTLINT = $(LINTSRC:%=$(ROOTLINTDIR)/%) CPPFLAGS += -I../include -I$(SRC)/lib/libpicl CPPFLAGS += -I$(SRC)/lib/libfruutils CPPFLAGS += -I$(SRC)/cmd/picl/plugins/inc -CPPFLAGS += -D_REENTRANT +CPPFLAGS += -D_REENTRANT CFLAGS += $(CCVERBOSE) -CCFLAGS64 += -mt +CCFLAGS64 += -mt CCFLAGS += -mt LDLIBS += -lc +CCERRWARN += -_gcc=-Wno-unused-variable +CCERRWARN += -_gcc=-Wno-switch +CCERRWARN += -_gcc=-Wno-reorder +CCERRWARN += -_gcc=-Wno-type-limits + CLEANFILES += pics/lex.fru.cc pics/y.tab.cc pics/y.tab.h $(LINTLIB) := SRCS = ../llib-lfru diff --git a/usr/src/lib/libnisdb/Makefile b/usr/src/lib/libnisdb/Makefile index 95d5cea6b7..11f21d5100 100644 --- a/usr/src/lib/libnisdb/Makefile +++ b/usr/src/lib/libnisdb/Makefile @@ -24,6 +24,8 @@ # Use is subject to license terms. # # Copyright (c) 2019, Joyent, Inc. +# Copyright 2019 RackTop Systems. +# LIBRARY= libnisdb.a VERS= .2 @@ -165,6 +167,17 @@ $(UVAR_PICS) := CERRWARN += -_gcc=-Wno-unused-variable CERRWARN += $(CNOWARN_UNINIT) CERRWARN += -_gcc=-Wno-switch +CCERRWARN += -_gcc=-Wno-parentheses +CCERRWARN += -_gcc=-Wno-unused-variable +CCERRWARN += -_gcc=-Wno-unused-value +CCERRWARN += -_gcc=-Wno-unused-function +CCERRWARN += -_gcc=-Wno-return-type +CCERRWARN += -_gcc=-Wno-uninitialized + +CCERRWARN += -_gcc7=-Wno-nonnull-compare +CCERRWARN += -_gcc8=-Wno-nonnull-compare +CCERRWARN += -_gcc9=-Wno-nonnull-compare + # not linted SMATCH=off diff --git a/usr/src/lib/libnisdb/db_dictionary.cc b/usr/src/lib/libnisdb/db_dictionary.cc index bb314c2984..74162009af 100644 --- a/usr/src/lib/libnisdb/db_dictionary.cc +++ b/usr/src/lib/libnisdb/db_dictionary.cc @@ -24,6 +24,8 @@ * * Copyright 2004 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * + * Copyright 2019 RackTop Systems. */ #include "db_headers.h" @@ -206,10 +208,11 @@ delete_dictionary(db_dict_desc *dict) if (dict) { if (dict->tables.tables_val) { /* delete each bucket */ - for (i = 0; i < dict->tables.tables_len; i++) + for (i = 0; i < dict->tables.tables_len; i++) { bucket = dict->tables.tables_val[i]; if (bucket) delete_bucket(bucket); + } /* delete table */ delete dict->tables.tables_val; } @@ -318,19 +321,17 @@ remove_from_bucket(db_table_desc_p bucket, static bool_t add_to_bucket(db_table_desc_p bucket, db_table_desc **head, db_table_desc_p td) { - db_table_desc_p curr, prev; + db_table_desc_p curr; register char *target_name; unsigned long target_hval; target_name = td->table_name; target_hval = td->hashval; /* Search for it in the bucket */ - for (prev = curr = bucket; curr != NULL; curr = curr->next) { + for (curr = bucket; curr != NULL; curr = curr->next) { if (curr->hashval == target_hval && strcmp(curr->table_name, target_name) == 0) { break; - } else { - prev = curr; } } diff --git a/usr/src/lib/libnisdb/db_mindex3.cc b/usr/src/lib/libnisdb/db_mindex3.cc index e70076f409..66cdb10052 100644 --- a/usr/src/lib/libnisdb/db_mindex3.cc +++ b/usr/src/lib/libnisdb/db_mindex3.cc @@ -23,7 +23,7 @@ * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. * - * Copyright 2015 RackTop Systems. + * Copyright 2019 RackTop Systems. */ #include <sys/types.h> @@ -668,7 +668,9 @@ entriesFromLDAPreal(__entries_from_ldap_arg_t *arg) { entry_col ec[NIS_MAXCOLUMNS+1]; for (i = 0, na = 0; i < nq; i++) { entry_object eo, *e; +#ifdef SET_ENTRY_FLAGS table_col *tc; +#endif /* SET_ENTRY_FLAGS */ nis_object o, *to; int j, nc; db_qcomp *qc; @@ -694,10 +696,12 @@ entriesFromLDAPreal(__entries_from_ldap_arg_t *arg) { o.zo_name = to->zo_name; o.zo_data.objdata_u.en_data.en_type = to->zo_data.objdata_u.ta_data.ta_type; +#ifdef SET_ENTRY_FLAGS tc = to->zo_data.objdata_u.ta_data.ta_cols.ta_cols_val; if (to->zo_data.objdata_u.ta_data.ta_cols.ta_cols_len != t->numColumns) tc = 0; +#endif /* SET_ENTRY_FLAGS */ if (o.zo_owner == 0) o.zo_owner = to->zo_owner; if (o.zo_group == 0) @@ -709,7 +713,9 @@ entriesFromLDAPreal(__entries_from_ldap_arg_t *arg) { if (o.zo_ttl == 0) o.zo_ttl = to->zo_ttl; } else { +#ifdef SET_ENTRY_FLAGS tc = 0; +#endif /* SET_ENTRY_FLAGS */ o.zo_owner = (nis_name)""; o.zo_group = (nis_name)""; o.zo_domain = (nis_name)""; diff --git a/usr/src/lib/sun_fc/Makefile.com b/usr/src/lib/sun_fc/Makefile.com index 7eb64ad1b5..68de7967ed 100644 --- a/usr/src/lib/sun_fc/Makefile.com +++ b/usr/src/lib/sun_fc/Makefile.com @@ -22,6 +22,7 @@ # Copyright 2009 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # +# Copyright 2019 RackTop Systems. # LIBRARYCCC = libsun_fc.a @@ -137,6 +138,17 @@ CCFLAGS64 += -D_POSIX_PTHREAD_SEMANTICS CCFLAGS64 += -compat=5 -_g++=-std=c++98 CPPFLAGS += $(INCS) -DBUILD_TIME='"Wed Sep 24 12:00:00 2008"' +CCERRWARN += -_gcc=-Wno-reorder +CCERRWARN += -_gcc=-Wno-unused-variable +CCERRWARN += -_gcc=-Wno-unused-value +CCERRWARN += -_gcc=-Wno-unused-function +CCERRWARN += -_gcc=-Wno-type-limits +CCERRWARN += -_gcc=-Wno-return-type + +CCERRWARN += -_gcc7=-Wno-c++11-compat +CCERRWARN += -_gcc8=-Wno-c++11-compat +CCERRWARN += -_gcc9=-Wno-c++11-compat + LDLIBS += -ldevinfo LDLIBS += -lsysevent LDLIBS += -lnvpair diff --git a/usr/src/lib/sun_fc/common/FCHBAPort.cc b/usr/src/lib/sun_fc/common/FCHBAPort.cc index 01caf87912..eca3b8aa34 100644 --- a/usr/src/lib/sun_fc/common/FCHBAPort.cc +++ b/usr/src/lib/sun_fc/common/FCHBAPort.cc @@ -21,6 +21,8 @@ /* * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * + * Copyright 2019 RackTop Systems. */ @@ -305,7 +307,6 @@ void FCHBAPort::sendSCSIPassThru(struct fcp_scsi_cmd *fscsi, Trace log("FCHBAPort::sendSCSIPassThru"); int fd; HBA_STATUS ret; - int count; char fcioErrorString[MAX_FCIO_MSG_LEN] = ""; hrtime_t start; hrtime_t end; @@ -325,7 +326,6 @@ void FCHBAPort::sendSCSIPassThru(struct fcp_scsi_cmd *fscsi, fscsi->scsi_fc_port_num = instanceNumber; fd = HBA::_open(FCP_DRIVER_PATH, O_RDONLY | O_NDELAY); - count = 0; ioctl_errno = 0; if (ioctl(fd, FCP_TGT_SEND_SCSI, fscsi) != 0) { diff --git a/usr/src/lib/sun_fc/common/Lockable.cc b/usr/src/lib/sun_fc/common/Lockable.cc index e6ca1c160b..e0a533aeee 100644 --- a/usr/src/lib/sun_fc/common/Lockable.cc +++ b/usr/src/lib/sun_fc/common/Lockable.cc @@ -21,6 +21,8 @@ /* * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * + * Copyright 2019 RackTop Systems. */ @@ -111,6 +113,7 @@ void Lockable::lock(pthread_mutex_t *myMutex) { break; case ENOTRECOVERABLE: cerr << "Lock failed: not recoverable" << endl; + /* FALLTHROUGH */ default: if (loop > DEADLOCK_WARNING) { cerr << "Lock failed: " <<strerror(status) << endl; diff --git a/usr/src/tools/make/bin/Makefile b/usr/src/tools/make/bin/Makefile index fcbcb3c7d1..0a65f0a4c2 100644 --- a/usr/src/tools/make/bin/Makefile +++ b/usr/src/tools/make/bin/Makefile @@ -10,6 +10,7 @@ # # Copyright 2015, Richard Lowe. +# Copyright 2019 RackTop Systems. PROG= make CMDDIR= $(SRC)/cmd/make/bin @@ -39,6 +40,13 @@ LDLIBS += ../lib/bsd/libbsd.a -lc -lnsl -lumem CPPFLAGS += -D_FILE_OFFSET_BITS=64 +CCERRWARN += -_gcc=-Wno-unused-variable +CCERRWARN += -_gcc=-Wno-switch +CCERRWARN += -_gcc=-Wno-parentheses +CCERRWARN += -_gcc=-Wno-unused-function +CCERRWARN += -_gcc=-Wno-clobbered +CCERRWARN += -_gcc=-Wno-uninitialized + ROOTLINKS = $(ROOTONBLDBINMACH)/dmake ROOTRULES = $(ROOTONBLDSHARE)/make.rules diff --git a/usr/src/tools/make/lib/mksh/Makefile b/usr/src/tools/make/lib/mksh/Makefile index b351b488bb..8a1e66d324 100644 --- a/usr/src/tools/make/lib/mksh/Makefile +++ b/usr/src/tools/make/lib/mksh/Makefile @@ -10,6 +10,7 @@ # # Copyright 2015, Richard Lowe. +# Copyright 2019 RackTop Systems. LIBRARY = libmksh.a VERS = .1 @@ -23,6 +24,11 @@ SRCDIR = $(SRC)/cmd/make/lib/mksh MAPFILES= CPPFLAGS += -D_FILE_OFFSET_BITS=64 +CCERRWARN += -_gcc=-Wno-unused-variable +CCERRWARN += -_gcc=-Wno-unused-function +CCERRWARN += -_gcc=-Wno-unused-value +CCERRWARN += -_gcc=-Wno-uninitialized + all: $(LIBS) install: all diff --git a/usr/src/tools/make/lib/vroot/Makefile b/usr/src/tools/make/lib/vroot/Makefile index 7965de5fde..51929aa785 100644 --- a/usr/src/tools/make/lib/vroot/Makefile +++ b/usr/src/tools/make/lib/vroot/Makefile @@ -10,6 +10,7 @@ # # Copyright 2015, Richard Lowe. +# Copyright 2019 RackTop Systems. LIBRARY = libvroot.a VERS = .1 @@ -44,6 +45,9 @@ SRCDIR = $(SRC)/cmd/make/lib/vroot MAPFILES= CPPFLAGS += -D_FILE_OFFSET_BITS=64 +CCERRWARN += -_gcc=-Wno-unused-variable +CCERRWARN += -_gcc=-Wno-parentheses + all: $(LIBS) install: all diff --git a/usr/src/uts/common/fs/smbsrv/smb2_negotiate.c b/usr/src/uts/common/fs/smbsrv/smb2_negotiate.c index 7464afe81a..e01edfaea3 100644 --- a/usr/src/uts/common/fs/smbsrv/smb2_negotiate.c +++ b/usr/src/uts/common/fs/smbsrv/smb2_negotiate.c @@ -21,6 +21,14 @@ #include <smbsrv/smb2_kproto.h> #include <smbsrv/smb2.h> +/* + * Note from [MS-SMB2] Sec. 2.2.3: Windows servers return + * invalid parameter if the dialect count is greater than 64 + * This is here (and not in smb2.h) because this is technically + * an implementation detail, not protocol specification. + */ +#define SMB2_NEGOTIATE_MAX_DIALECTS 64 + static int smb2_negotiate_common(smb_request_t *, uint16_t); /* List of supported capabilities. Can be patched for testing. */ @@ -114,7 +122,6 @@ smb1_negotiate_smb2(smb_request_t *sr) smb_session_t *s = sr->session; smb_arg_negotiate_t *negprot = sr->sr_negprot; uint16_t smb2_version; - int rc; /* * Note: In the SMB1 negotiate command handler, we @@ -145,18 +152,6 @@ smb1_negotiate_smb2(smb_request_t *sr) } /* - * Clients that negotiate SMB2 from SMB1 have not yet had the - * opportunity to provide us with a secmode. However, any - * client that negotiates SMB2 should support signing, so - * this should be fiction good enough to pass the signing - * check in smb2_negotiate_common(). Even if the client - * doesn't support signing and we require it, we'll fail them - * later when they fail to sign the packet. For 2.???, - * we'll check the real secmode when the 2nd negotiate comes. - */ - s->cli_secmode = SMB2_NEGOTIATE_SIGNING_ENABLED; - - /* * We did not decode an SMB2 header, so make sure * the SMB2 header fields are initialized. * (Most are zero from smb_request_alloc.) @@ -165,11 +160,16 @@ smb1_negotiate_smb2(smb_request_t *sr) */ sr->smb2_reply_hdr = sr->reply.chain_offset = 0; sr->smb2_cmd_code = SMB2_NEGOTIATE; + sr->smb2_hdr_flags = SMB2_FLAGS_SERVER_TO_REDIR; + + (void) smb2_encode_header(sr, B_FALSE); + if (smb2_negotiate_common(sr, smb2_version) != 0) + sr->smb2_status = NT_STATUS_INTERNAL_ERROR; + if (sr->smb2_status != 0) + smb2sr_put_error(sr, sr->smb2_status); + (void) smb2_encode_header(sr, B_TRUE); - rc = smb2_negotiate_common(sr, smb2_version); smb2_send_reply(sr); - if (rc != 0) - return (SDRC_DROP_VC); /* * We sent the reply, so tell the SMB1 dispatch @@ -215,16 +215,20 @@ smb2_newrq_negotiate(smb_request_t *sr) { smb_session_t *s = sr->session; int rc; + uint32_t status = 0; uint16_t struct_size; uint16_t best_version; uint16_t version_cnt; - uint16_t cl_versions[8]; + uint16_t cl_versions[SMB2_NEGOTIATE_MAX_DIALECTS]; sr->smb2_cmd_hdr = sr->command.chain_offset; rc = smb2_decode_header(sr); if (rc != 0) return (rc); + if (sr->smb2_hdr_flags & SMB2_FLAGS_SERVER_TO_REDIR) + return (-1); + if ((sr->smb2_cmd_code != SMB2_NEGOTIATE) || (sr->smb2_next_command != 0)) return (-1); @@ -243,30 +247,66 @@ smb2_newrq_negotiate(smb_request_t *sr) /* start_time 8. */ if (rc != 0) return (rc); - if (struct_size != 36 || version_cnt > 8) + if (struct_size != 36) return (-1); /* * Decode SMB2 Negotiate (variable part) + * + * Be somewhat tolerant while decoding the variable part + * so we can return errors instead of dropping the client. + * Will limit decoding to the size of cl_versions here, + * and do the error checks on version_cnt after the + * dtrace start probe. */ - rc = smb_mbc_decodef(&sr->command, - "#w", version_cnt, cl_versions); - if (rc != 0) - return (rc); + if (version_cnt > 0 && + version_cnt <= SMB2_NEGOTIATE_MAX_DIALECTS && + smb_mbc_decodef(&sr->command, "#w", version_cnt, + cl_versions) != 0) { + /* decode error; force an error below */ + version_cnt = 0; + } DTRACE_SMB2_START(op__Negotiate, smb_request_t *, sr); + sr->smb2_hdr_flags |= SMB2_FLAGS_SERVER_TO_REDIR; + (void) smb2_encode_header(sr, B_FALSE); + + /* + * [MS-SMB2] 3.3.5.2.4 Verifying the Signature + * "If the SMB2 header of the SMB2 NEGOTIATE request has the + * SMB2_FLAGS_SIGNED bit set in the Flags field, the server + * MUST fail the request with STATUS_INVALID_PARAMETER." + */ + if ((sr->smb2_hdr_flags & SMB2_FLAGS_SIGNED) != 0) { + sr->smb2_hdr_flags &= ~SMB2_FLAGS_SIGNED; + status = NT_STATUS_INVALID_PARAMETER; + goto errout; + } + + /* + * [MS-SMB2] 3.3.5.4 Receiving an SMB2 NEGOTIATE Request + * "If the DialectCount of the SMB2 NEGOTIATE Request is 0, the + * server MUST fail the request with STATUS_INVALID_PARAMETER." + */ + if (version_cnt == 0 || + version_cnt > SMB2_NEGOTIATE_MAX_DIALECTS) { + status = NT_STATUS_INVALID_PARAMETER; + goto errout; + } + /* * The client offers an array of protocol versions it * supports, which we have decoded into cl_versions[]. * We walk the array and pick the highest supported. + * + * [MS-SMB2] 3.3.5.4 Receiving an SMB2 NEGOTIATE Request + * "If a common dialect is not found, the server MUST fail + * the request with STATUS_NOT_SUPPORTED." */ best_version = smb2_find_best_dialect(s, cl_versions, version_cnt); if (best_version == 0) { - cmn_err(CE_NOTE, "clnt %s no supported dialect", - sr->session->ip_addr_str); - sr->smb2_status = NT_STATUS_INVALID_PARAMETER; - rc = -1; + status = NT_STATUS_NOT_SUPPORTED; goto errout; } s->dialect = best_version; @@ -275,12 +315,17 @@ smb2_newrq_negotiate(smb_request_t *sr) s->s_state = SMB_SESSION_STATE_NEGOTIATED; s->newrq_func = smb2sr_newrq; - rc = smb2_negotiate_common(sr, best_version); + if (smb2_negotiate_common(sr, best_version) != 0) + status = NT_STATUS_INTERNAL_ERROR; errout: - /* sr->smb2_status was set */ + sr->smb2_status = status; DTRACE_SMB2_DONE(op__Negotiate, smb_request_t *, sr); + if (sr->smb2_status != 0) + smb2sr_put_error(sr, sr->smb2_status); + (void) smb2_encode_header(sr, B_TRUE); + smb2_send_reply(sr); return (rc); @@ -292,8 +337,7 @@ errout: * Do negotiation decisions and encode the reply. * The caller does the network send. * - * Return value is 0 for success, and anything else will - * terminate the reader thread (drop the connection). + * Return value is 0 for success, else error. */ static int smb2_negotiate_common(smb_request_t *sr, uint16_t version) @@ -304,19 +348,12 @@ smb2_negotiate_common(smb_request_t *sr, uint16_t version) uint32_t max_rwsize; uint16_t secmode; - sr->smb2_status = 0; - /* * Negotiation itself. First the Security Mode. */ secmode = SMB2_NEGOTIATE_SIGNING_ENABLED; - if (sr->sr_cfg->skc_signing_required) { + if (sr->sr_cfg->skc_signing_required) secmode |= SMB2_NEGOTIATE_SIGNING_REQUIRED; - /* Make sure client at least enables signing. */ - if ((s->cli_secmode & secmode) == 0) { - sr->smb2_status = NT_STATUS_INVALID_PARAMETER; - } - } s->srv_secmode = secmode; s->cmd_max_bytes = smb2_tcp_bufsize; @@ -337,17 +374,6 @@ smb2_negotiate_common(smb_request_t *sr, uint16_t version) now_tv.tv_nsec = 0; /* - * SMB2 negotiate reply - */ - sr->smb2_hdr_flags = SMB2_FLAGS_SERVER_TO_REDIR; - (void) smb2_encode_header(sr, B_FALSE); - if (sr->smb2_status != 0) { - smb2sr_put_error(sr, sr->smb2_status); - /* smb2_send_reply(sr); in caller */ - return (-1); /* will drop */ - } - - /* * If the version is 0x2FF, we haven't completed negotiate. * Don't initialize until we have our final request. */ diff --git a/usr/src/uts/common/inet/kssl/ksslrec.c b/usr/src/uts/common/inet/kssl/ksslrec.c index f7928e7bab..e609893c73 100644 --- a/usr/src/uts/common/inet/kssl/ksslrec.c +++ b/usr/src/uts/common/inet/kssl/ksslrec.c @@ -77,16 +77,25 @@ static ssl3CipherSuiteDef cipher_suite_defs[] = { static int cipher_suite_defs_nentries = sizeof (cipher_suite_defs) / sizeof (cipher_suite_defs[0]); +static void KSSL_SHA1Update(void *, uchar_t *, uint32_t); + static KSSLMACDef mac_defs[] = { /* indexed by SSL3MACAlgorithm */ /* macsz padsz HashInit HashUpdate HashFinal */ - {MD5_HASH_LEN, SSL3_MD5_PAD_LEN, - (hashinit_func_t)MD5Init, (hashupdate_func_t)MD5Update, - (hashfinal_func_t)MD5Final}, - - {SHA1_HASH_LEN, SSL3_SHA1_PAD_LEN, - (hashinit_func_t)SHA1Init, (hashupdate_func_t)SHA1Update, - (hashfinal_func_t)SHA1Final}, + { + .hashsz = MD5_HASH_LEN, + .padsz = SSL3_MD5_PAD_LEN, + .HashInit = (hashinit_func_t)MD5Init, + .HashUpdate = (hashupdate_func_t)MD5Update, + .HashFinal = (hashfinal_func_t)MD5Final + }, + { + .hashsz = SHA1_HASH_LEN, + .padsz = SSL3_SHA1_PAD_LEN, + .HashInit = (hashinit_func_t)SHA1Init, + .HashUpdate = KSSL_SHA1Update, + .HashFinal = (hashfinal_func_t)SHA1Final + } }; static uchar_t kssl_pad_1[60] = { @@ -153,6 +162,17 @@ static void kssl_cke_done(void *, int); rv = crypto_mac_final(c, &mac, NULL); if (CRYPTO_ERR(rv)) goto end; /* + * Wrapper for SHA1Update to translate arguments. We need this because + * the KSSL hash update function expects the size argument to be a + * uint32_t, but SHA1Update uses a size_t. + */ +static void +KSSL_SHA1Update(void *ctx, uchar_t *in, uint32_t size) +{ + SHA1Update(ctx, in, size); +} + +/* * This hack can go away once we have SSL3 MAC support by KCF * software providers (See 4873559). */ diff --git a/usr/src/uts/common/io/bnxe/577xx/common/bnxe_clc.c b/usr/src/uts/common/io/bnxe/577xx/common/bnxe_clc.c index 7e1afd9fd0..38dff893d7 100644 --- a/usr/src/uts/common/io/bnxe/577xx/common/bnxe_clc.c +++ b/usr/src/uts/common/io/bnxe/577xx/common/bnxe_clc.c @@ -4779,9 +4779,9 @@ static void elink_sfp_e3_set_transmitter(struct elink_params *params, elink_set_cfg_pin(cb, cfg_pin + 3, tx_en ^ 1); } -static void elink_warpcore_config_init(struct elink_phy *phy, - struct elink_params *params, - struct elink_vars *vars) +static elink_status_t +elink_warpcore_config_init(struct elink_phy *phy, struct elink_params *params, + struct elink_vars *vars) { struct elink_dev *cb = params->cb; u32 serdes_net_if; @@ -4859,7 +4859,7 @@ static void elink_warpcore_config_init(struct elink_phy *phy, case PORT_HW_CFG_NET_SERDES_IF_DXGXS: if (vars->line_speed != ELINK_SPEED_20000) { ELINK_DEBUG_P0(cb, "Speed not supported yet\n"); - return; + return (ELINK_STATUS_ERROR); } ELINK_DEBUG_P0(cb, "Setting 20G DXGXS\n"); elink_warpcore_set_20G_DXGXS(cb, phy, lane); @@ -4882,13 +4882,14 @@ static void elink_warpcore_config_init(struct elink_phy *phy, ELINK_DEBUG_P1(cb, "Unsupported Serdes Net Interface 0x%x\n", serdes_net_if); - return; + return (ELINK_STATUS_ERROR); } } /* Take lane out of reset after configuration is finished */ elink_warpcore_reset_lane(cb, phy, 0); ELINK_DEBUG_P0(cb, "Exit config init\n"); + return (ELINK_STATUS_OK); } static void elink_warpcore_link_reset(struct elink_phy *phy, @@ -6257,9 +6258,9 @@ static elink_status_t elink_get_link_speed_duplex(struct elink_phy *phy, } #ifndef EXCLUDE_XGXS -static elink_status_t elink_link_settings_status(struct elink_phy *phy, - struct elink_params *params, - struct elink_vars *vars) +static elink_status_t +elink_link_settings_status(struct elink_phy *phy, struct elink_params *params, + struct elink_vars *vars) { struct elink_dev *cb = params->cb; @@ -6333,9 +6334,9 @@ static elink_status_t elink_link_settings_status(struct elink_phy *phy, #endif // EXCLUDE_XGXS #ifndef EXCLUDE_WARPCORE -static elink_status_t elink_warpcore_read_status(struct elink_phy *phy, - struct elink_params *params, - struct elink_vars *vars) +static elink_status_t +elink_warpcore_read_status(struct elink_phy *phy, struct elink_params *params, + struct elink_vars *vars) { struct elink_dev *cb = params->cb; u8 lane; @@ -6571,9 +6572,9 @@ static void elink_set_preemphasis(struct elink_phy *phy, } } -static void elink_xgxs_config_init(struct elink_phy *phy, - struct elink_params *params, - struct elink_vars *vars) +static elink_status_t +elink_xgxs_config_init(struct elink_phy *phy, struct elink_params *params, + struct elink_vars *vars) { #ifdef ELINK_DEBUG struct elink_dev *cb = params->cb; @@ -6620,6 +6621,7 @@ static void elink_xgxs_config_init(struct elink_phy *phy, elink_initialize_sgmii_process(phy, params, vars); } + return (ELINK_STATUS_OK); } static elink_status_t elink_prepare_xgxs(struct elink_phy *phy, @@ -6818,7 +6820,8 @@ static void elink_link_int_ack(struct elink_params *params, } #if !defined(ELINK_EMUL_ONLY) && (!defined(EXCLUDE_BCM8727_BCM8073) || !defined(EXCLUDE_SFX7101) || !defined(EXCLUDE_BCM8705) || !defined(EXCLUDE_BCM87x6)) -static elink_status_t elink_format_ver(u32 num, u8 *str, u16 *len) +static elink_status_t +elink_format_ver(u32 num, u8 *str, u16 *len) { #ifdef ELINK_ENHANCEMENTS u8 *str_ptr = str; @@ -6861,7 +6864,8 @@ static elink_status_t elink_format_ver(u32 num, u8 *str, u16 *len) #ifndef EXCLUDE_BCM8705 -static elink_status_t elink_null_format_ver(u32 spirom_ver, u8 *str, u16 *len) +static elink_status_t +elink_null_format_ver(u32 spirom_ver, u8 *str, u16 *len) { #ifdef ELINK_ENHANCEMENTS str[0] = '\0'; @@ -8257,9 +8261,9 @@ static elink_status_t elink_8073_config_init(struct elink_phy *phy, return ELINK_STATUS_OK; } -static u8 elink_8073_read_status(struct elink_phy *phy, - struct elink_params *params, - struct elink_vars *vars) +static elink_status_t +elink_8073_read_status(struct elink_phy *phy, struct elink_params *params, + struct elink_vars *vars) { struct elink_dev *cb = params->cb; u8 link_up = 0; @@ -8453,9 +8457,9 @@ static elink_status_t elink_8705_config_init(struct elink_phy *phy, return ELINK_STATUS_OK; } -static u8 elink_8705_read_status(struct elink_phy *phy, - struct elink_params *params, - struct elink_vars *vars) +static elink_status_t +elink_8705_read_status(struct elink_phy *phy, struct elink_params *params, + struct elink_vars *vars) { u8 link_up = 0; u16 val1, rx_sd; @@ -9749,9 +9753,9 @@ static u8 elink_8706_8726_read_status(struct elink_phy *phy, /******************************************************************/ /* BCM8706 PHY SECTION */ /******************************************************************/ -static u8 elink_8706_config_init(struct elink_phy *phy, - struct elink_params *params, - struct elink_vars *vars) +static elink_status_t +elink_8706_config_init(struct elink_phy *phy, struct elink_params *params, + struct elink_vars *vars) { u32 tx_en_mode; u16 cnt, val, tmp1; @@ -9855,9 +9859,9 @@ static u8 elink_8706_config_init(struct elink_phy *phy, return ELINK_STATUS_OK; } -static elink_status_t elink_8706_read_status(struct elink_phy *phy, - struct elink_params *params, - struct elink_vars *vars) +static elink_status_t +elink_8706_read_status(struct elink_phy *phy, struct elink_params *params, + struct elink_vars *vars) { return elink_8706_8726_read_status(phy, params, vars); } @@ -9911,9 +9915,9 @@ static void elink_8726_external_rom_boot(struct elink_phy *phy, elink_save_bcm_spirom_ver(cb, phy, params->port); } -static u8 elink_8726_read_status(struct elink_phy *phy, - struct elink_params *params, - struct elink_vars *vars) +static elink_status_t +elink_8726_read_status(struct elink_phy *phy, struct elink_params *params, + struct elink_vars *vars) { struct elink_dev *cb = params->cb; u16 val1; @@ -9932,9 +9936,9 @@ static u8 elink_8726_read_status(struct elink_phy *phy, } -static elink_status_t elink_8726_config_init(struct elink_phy *phy, - struct elink_params *params, - struct elink_vars *vars) +static elink_status_t +elink_8726_config_init(struct elink_phy *phy, struct elink_params *params, + struct elink_vars *vars) { struct elink_dev *cb = params->cb; ELINK_DEBUG_P0(cb, "Initializing BCM8726\n"); @@ -10154,9 +10158,9 @@ static void elink_8727_config_speed(struct elink_phy *phy, } } -static elink_status_t elink_8727_config_init(struct elink_phy *phy, - struct elink_params *params, - struct elink_vars *vars) +static elink_status_t +elink_8727_config_init(struct elink_phy *phy, struct elink_params *params, + struct elink_vars *vars) { u32 tx_en_mode; u16 tmp1, mod_abs, tmp2; @@ -10325,10 +10329,9 @@ static void elink_8727_handle_mod_abs(struct elink_phy *phy, /* No need to check link status in case of module plugged in/out */ } -static u8 elink_8727_read_status(struct elink_phy *phy, - struct elink_params *params, - struct elink_vars *vars) - +static elink_status_t +elink_8727_read_status(struct elink_phy *phy, struct elink_params *params, + struct elink_vars *vars) { struct elink_dev *cb = params->cb; u8 link_up = 0; @@ -10798,9 +10801,9 @@ static elink_status_t elink_848xx_cmn_config_init(struct elink_phy *phy, #ifndef EXCLUDE_BCM8481 #ifndef EXCLUDE_NON_COMMON_INIT -static elink_status_t elink_8481_config_init(struct elink_phy *phy, - struct elink_params *params, - struct elink_vars *vars) +static elink_status_t +elink_8481_config_init(struct elink_phy *phy, struct elink_params *params, + struct elink_vars *vars) { struct elink_dev *cb = params->cb; /* Restore normal power mode*/ @@ -10946,7 +10949,8 @@ static u8 elink_84833_get_reset_gpios(struct elink_dev *cb, } #ifndef EXCLUDE_NON_COMMON_INIT -static elink_status_t elink_84833_hw_reset_phy(struct elink_phy *phy, +static void +elink_84833_hw_reset_phy(struct elink_phy *phy, struct elink_params *params) { struct elink_dev *cb = params->cb; @@ -10977,8 +10981,6 @@ static elink_status_t elink_84833_hw_reset_phy(struct elink_phy *phy, ELINK_DEBUG_P1(cb, "84833 hw reset on pin values 0x%x\n", reset_gpios); #endif // EDEBUG - - return ELINK_STATUS_OK; } #endif // EXCLUDE_NON_COMMON_INIT #endif // #ifndef EXCLUDE_BCM84833 @@ -11031,9 +11033,9 @@ static elink_status_t elink_8483x_enable_eee(struct elink_phy *phy, #if !defined(EXCLUDE_BCM8481) || !defined(EXCLUDE_BCM84833) #define PHY84833_CONSTANT_LATENCY 1193 -static elink_status_t elink_848x3_config_init(struct elink_phy *phy, - struct elink_params *params, - struct elink_vars *vars) +static elink_status_t +elink_848x3_config_init(struct elink_phy *phy, struct elink_params *params, + struct elink_vars *vars) { struct elink_dev *cb = params->cb; u8 port, initialize = 1; @@ -11215,9 +11217,9 @@ static elink_status_t elink_848x3_config_init(struct elink_phy *phy, return rc; } -static u8 elink_848xx_read_status(struct elink_phy *phy, - struct elink_params *params, - struct elink_vars *vars) +static elink_status_t +elink_848xx_read_status(struct elink_phy *phy, struct elink_params *params, + struct elink_vars *vars) { struct elink_dev *cb = params->cb; u16 val, val1, val2; @@ -11361,7 +11363,8 @@ static u8 elink_848xx_read_status(struct elink_phy *phy, return link_up; } -static elink_status_t elink_848xx_format_ver(u32 raw_ver, u8 *str, u16 *len) +static elink_status_t +elink_848xx_format_ver(u32 raw_ver, u8 *str, u16 *len) { elink_status_t status = ELINK_STATUS_OK; #ifdef ELINK_ENHANCEMENTS @@ -11766,9 +11769,9 @@ static void elink_54618se_specific_func(struct elink_phy *phy, } } -static elink_status_t elink_54618se_config_init(struct elink_phy *phy, - struct elink_params *params, - struct elink_vars *vars) +static elink_status_t +elink_54618se_config_init(struct elink_phy *phy, + struct elink_params *params, struct elink_vars *vars) { struct elink_dev *cb = params->cb; u8 port; @@ -12053,9 +12056,9 @@ static void elink_54618se_link_reset(struct elink_phy *phy, elink_set_cfg_pin(cb, cfg_pin, 0); } -static u8 elink_54618se_read_status(struct elink_phy *phy, - struct elink_params *params, - struct elink_vars *vars) +static elink_status_t +elink_54618se_read_status(struct elink_phy *phy, struct elink_params *params, + struct elink_vars *vars) { struct elink_dev *cb = params->cb; u16 val; @@ -12256,9 +12259,9 @@ static elink_status_t elink_7101_config_init(struct elink_phy *phy, return ELINK_STATUS_OK; } -static u8 elink_7101_read_status(struct elink_phy *phy, - struct elink_params *params, - struct elink_vars *vars) +static elink_status_t +elink_7101_read_status(struct elink_phy *phy, struct elink_params *params, + struct elink_vars *vars) { struct elink_dev *cb = params->cb; u8 link_up; @@ -12296,7 +12299,8 @@ static u8 elink_7101_read_status(struct elink_phy *phy, return link_up; } -static elink_status_t elink_7101_format_ver(u32 spirom_ver, u8 *str, u16 *len) +static elink_status_t +elink_7101_format_ver(u32 spirom_ver, u8 *str, u16 *len) { if (*len < 5) return ELINK_STATUS_ERROR; @@ -12427,9 +12431,9 @@ static const struct elink_phy phy_serdes = { /*.speed_cap_mask = */0, /*.req_duplex = */0, /*.rsrv = */0, - /*.config_init = */(config_init_t)elink_xgxs_config_init, - /*.read_status = */(read_status_t)elink_link_settings_status, - /*.link_reset = */(link_reset_t)elink_int_link_reset, + /*.config_init = */elink_xgxs_config_init, + /*.read_status = */elink_link_settings_status, + /*.link_reset = */elink_int_link_reset, /*.config_loopback = */(config_loopback_t)NULL, /*.format_fw_ver = */(format_fw_ver_t)NULL, /*.hw_reset = */(hw_reset_t)NULL, @@ -12466,14 +12470,14 @@ static const struct elink_phy phy_xgxs = { /*.req_duplex = */0, /*.rsrv = */0, #ifndef EXCLUDE_NON_COMMON_INIT - /*.config_init = */(config_init_t)elink_xgxs_config_init, - /*.read_status = */(read_status_t)elink_link_settings_status, - /*.link_reset = */(link_reset_t)elink_int_link_reset, - /*.config_loopback = */(config_loopback_t)elink_set_xgxs_loopback, + /*.config_init = */elink_xgxs_config_init, + /*.read_status = */elink_link_settings_status, + /*.link_reset = */elink_int_link_reset, + /*.config_loopback = */elink_set_xgxs_loopback, /*.format_fw_ver= */(format_fw_ver_t)NULL, /*.hw_reset = */(hw_reset_t)NULL, /*.set_link_led = */(set_link_led_t)NULL, - /*.phy_specific_func = */(phy_specific_func_t)elink_xgxs_specific_func + /*.phy_specific_func = */elink_xgxs_specific_func #endif }; #endif @@ -12506,12 +12510,12 @@ static const struct elink_phy phy_warpcore = { /* req_duplex = */0, /* rsrv = */0, #ifndef EXCLUDE_NON_COMMON_INIT - /*.config_init = */(config_init_t)elink_warpcore_config_init, - /*.read_status = */(read_status_t)elink_warpcore_read_status, - /*.link_reset = */(link_reset_t)elink_warpcore_link_reset, - /*.config_loopback = */(config_loopback_t)elink_set_warpcore_loopback, + /*.config_init = */elink_warpcore_config_init, + /*.read_status = */elink_warpcore_read_status, + /*.link_reset = */elink_warpcore_link_reset, + /*.config_loopback = */elink_set_warpcore_loopback, /*.format_fw_ver= */(format_fw_ver_t)NULL, - /*.hw_reset = */(hw_reset_t)elink_warpcore_hw_reset, + /*.hw_reset = */elink_warpcore_hw_reset, /*.set_link_led = */(set_link_led_t)NULL, /*.phy_specific_func = */(phy_specific_func_t)NULL #endif @@ -12541,13 +12545,13 @@ static const struct elink_phy phy_7101 = { /*.speed_cap_mask = */0, /*.req_duplex = */0, /*.rsrv = */0, - /*.config_init = */(config_init_t)elink_7101_config_init, - /*.read_status = */(read_status_t)elink_7101_read_status, - /*.link_reset = */(link_reset_t)elink_common_ext_link_reset, - /*.config_loopback = */(config_loopback_t)elink_7101_config_loopback, - /*.format_fw_ver= */(format_fw_ver_t)elink_7101_format_ver, - /*.hw_reset = */(hw_reset_t)elink_7101_hw_reset, - /*.set_link_led = */(set_link_led_t)elink_7101_set_link_led, + /*.config_init = */elink_7101_config_init, + /*.read_status = */elink_7101_read_status, + /*.link_reset = */elink_common_ext_link_reset, + /*.config_loopback = */elink_7101_config_loopback, + /*.format_fw_ver= */elink_7101_format_ver, + /*.hw_reset = */elink_7101_hw_reset, + /*.set_link_led = */elink_7101_set_link_led, /*.phy_specific_func = */(phy_specific_func_t)NULL }; #endif /* EXCLUDE_SFX7101 */ @@ -12575,14 +12579,14 @@ static const struct elink_phy phy_8073 = { /*.req_duplex = */0, /*.rsrv = */0, #ifndef EXCLUDE_NON_COMMON_INIT - /*.config_init = */(config_init_t)elink_8073_config_init, - /*.read_status = */(read_status_t)elink_8073_read_status, - /*.link_reset = */(link_reset_t)elink_8073_link_reset, + /*.config_init = */elink_8073_config_init, + /*.read_status = */elink_8073_read_status, + /*.link_reset = */elink_8073_link_reset, /*.config_loopback = */(config_loopback_t)NULL, - /*.format_fw_ver= */(format_fw_ver_t)elink_format_ver, + /*.format_fw_ver= */elink_format_ver, /*.hw_reset = */(hw_reset_t)NULL, /*.set_link_led = */(set_link_led_t)NULL, - /*.phy_specific_func = */(phy_specific_func_t)elink_8073_specific_func + /*.phy_specific_func = */elink_8073_specific_func #endif }; #endif @@ -12606,11 +12610,11 @@ static const struct elink_phy phy_8705 = { /*.speed_cap_mask = */0, /*.req_duplex = */0, /*.rsrv = */0, - /*.config_init = */(config_init_t)elink_8705_config_init, - /*.read_status = */(read_status_t)elink_8705_read_status, - /*.link_reset = */(link_reset_t)elink_common_ext_link_reset, + /*.config_init = */elink_8705_config_init, + /*.read_status = */elink_8705_read_status, + /*.link_reset = */elink_common_ext_link_reset, /*.config_loopback = */(config_loopback_t)NULL, - /*.format_fw_ver= */(format_fw_ver_t)elink_null_format_ver, + /*.format_fw_ver= */elink_null_format_ver, /*.hw_reset = */(hw_reset_t)NULL, /*.set_link_led = */(set_link_led_t)NULL, /*.phy_specific_func = */(phy_specific_func_t)NULL @@ -12637,11 +12641,11 @@ static const struct elink_phy phy_8706 = { /*.speed_cap_mask = */0, /*.req_duplex = */0, /*.rsrv = */0, - /*.config_init = */(config_init_t)elink_8706_config_init, - /*.read_status = */(read_status_t)elink_8706_read_status, - /*.link_reset = */(link_reset_t)elink_common_ext_link_reset, + /*.config_init = */elink_8706_config_init, + /*.read_status = */elink_8706_read_status, + /*.link_reset = */elink_common_ext_link_reset, /*.config_loopback = */(config_loopback_t)NULL, - /*.format_fw_ver= */(format_fw_ver_t)elink_format_ver, + /*.format_fw_ver= */elink_format_ver, /*.hw_reset = */(hw_reset_t)NULL, /*.set_link_led = */(set_link_led_t)NULL, /*.phy_specific_func = */(phy_specific_func_t)NULL @@ -12669,11 +12673,11 @@ static const struct elink_phy phy_8726 = { /*.speed_cap_mask = */0, /*.req_duplex = */0, /*.rsrv = */0, - /*.config_init = */(config_init_t)elink_8726_config_init, - /*.read_status = */(read_status_t)elink_8726_read_status, - /*.link_reset = */(link_reset_t)elink_8726_link_reset, - /*.config_loopback = */(config_loopback_t)elink_8726_config_loopback, - /*.format_fw_ver= */(format_fw_ver_t)elink_format_ver, + /*.config_init = */elink_8726_config_init, + /*.read_status = */elink_8726_read_status, + /*.link_reset = */elink_8726_link_reset, + /*.config_loopback = */elink_8726_config_loopback, + /*.format_fw_ver= */elink_format_ver, /*.hw_reset = */(hw_reset_t)NULL, /*.set_link_led = */(set_link_led_t)NULL, /*.phy_specific_func = */(phy_specific_func_t)NULL @@ -12703,14 +12707,14 @@ static const struct elink_phy phy_8727 = { /*.req_duplex = */0, /*.rsrv = */0, #ifndef EXCLUDE_NON_COMMON_INIT - /*.config_init = */(config_init_t)elink_8727_config_init, - /*.read_status = */(read_status_t)elink_8727_read_status, - /*.link_reset = */(link_reset_t)elink_8727_link_reset, + /*.config_init = */elink_8727_config_init, + /*.read_status = */elink_8727_read_status, + /*.link_reset = */elink_8727_link_reset, /*.config_loopback = */(config_loopback_t)NULL, - /*.format_fw_ver= */(format_fw_ver_t)elink_format_ver, - /*.hw_reset = */(hw_reset_t)elink_8727_hw_reset, - /*.set_link_led = */(set_link_led_t)elink_8727_set_link_led, - /*.phy_specific_func = */(phy_specific_func_t)elink_8727_specific_func + /*.format_fw_ver= */elink_format_ver, + /*.hw_reset = */elink_8727_hw_reset, + /*.set_link_led = */elink_8727_set_link_led, + /*.phy_specific_func = */elink_8727_specific_func #endif }; #endif @@ -12742,13 +12746,13 @@ static const struct elink_phy phy_8481 = { /*.req_duplex = */0, /*.rsrv = */0, #ifndef EXCLUDE_NON_COMMON_INIT - /*.config_init = */(config_init_t)elink_8481_config_init, - /*.read_status = */(read_status_t)elink_848xx_read_status, - /*.link_reset = */(link_reset_t)elink_8481_link_reset, + /*.config_init = */elink_8481_config_init, + /*.read_status = */elink_848xx_read_status, + /*.link_reset = */elink_8481_link_reset, /*.config_loopback = */(config_loopback_t)NULL, - /*.format_fw_ver= */(format_fw_ver_t)elink_848xx_format_ver, - /*.hw_reset = */(hw_reset_t)elink_8481_hw_reset, - /*.set_link_led = */(set_link_led_t)elink_848xx_set_link_led, + /*.format_fw_ver= */elink_848xx_format_ver, + /*.hw_reset = */elink_8481_hw_reset, + /*.set_link_led = */elink_848xx_set_link_led, /*.phy_specific_func = */(phy_specific_func_t)NULL #endif }; @@ -12781,14 +12785,14 @@ static const struct elink_phy phy_84823 = { /*.req_duplex = */0, /*.rsrv = */0, #ifndef EXCLUDE_NON_COMMON_INIT - /*.config_init = */(config_init_t)elink_848x3_config_init, - /*.read_status = */(read_status_t)elink_848xx_read_status, - /*.link_reset = */(link_reset_t)elink_848x3_link_reset, + /*.config_init = */elink_848x3_config_init, + /*.read_status = */elink_848xx_read_status, + /*.link_reset = */elink_848x3_link_reset, /*.config_loopback = */(config_loopback_t)NULL, - /*.format_fw_ver= */(format_fw_ver_t)elink_848xx_format_ver, + /*.format_fw_ver= */elink_848xx_format_ver, /*.hw_reset = */(hw_reset_t)NULL, - /*.set_link_led = */(set_link_led_t)elink_848xx_set_link_led, - /*.phy_specific_func = */(phy_specific_func_t)elink_848xx_specific_func + /*.set_link_led = */elink_848xx_set_link_led, + /*.phy_specific_func = */elink_848xx_specific_func #endif // #ifndef EXCLUDE_NON_COMMON_INIT }; #endif /* EXCLUDE_BCM8481 */ @@ -12821,14 +12825,14 @@ static const struct elink_phy phy_84833 = { /*.req_duplex = */0, /*.rsrv = */0, #ifndef EXCLUDE_NON_COMMON_INIT - /*.config_init = */(config_init_t)elink_848x3_config_init, - /*.read_status = */(read_status_t)elink_848xx_read_status, - /*.link_reset = */(link_reset_t)elink_848x3_link_reset, + /*.config_init = */elink_848x3_config_init, + /*.read_status = */elink_848xx_read_status, + /*.link_reset = */elink_848x3_link_reset, /*.config_loopback = */(config_loopback_t)NULL, - /*.format_fw_ver= */(format_fw_ver_t)elink_848xx_format_ver, - /*.hw_reset = */(hw_reset_t)elink_84833_hw_reset_phy, - /*.set_link_led = */(set_link_led_t)elink_848xx_set_link_led, - /*.phy_specific_func = */(phy_specific_func_t)elink_848xx_specific_func + /*.format_fw_ver= */elink_848xx_format_ver, + /*.hw_reset = */elink_84833_hw_reset_phy, + /*.set_link_led = */elink_848xx_set_link_led, + /*.phy_specific_func = */elink_848xx_specific_func #endif }; @@ -12857,14 +12861,14 @@ static const struct elink_phy phy_84834 = { /*.req_duplex = */0, /*.rsrv = */0, #ifndef EXCLUDE_NON_COMMON_INIT - /*.config_init = */(config_init_t)elink_848x3_config_init, - /*.read_status = */(read_status_t)elink_848xx_read_status, - /*.link_reset = */(link_reset_t)elink_848x3_link_reset, + /*.config_init = */elink_848x3_config_init, + /*.read_status = */elink_848xx_read_status, + /*.link_reset = */elink_848x3_link_reset, /*.config_loopback = */(config_loopback_t)NULL, - /*.format_fw_ver= */(format_fw_ver_t)elink_848xx_format_ver, - /*.hw_reset = */(hw_reset_t)elink_84833_hw_reset_phy, - /*.set_link_led = */(set_link_led_t)elink_848xx_set_link_led, - /*.phy_specific_func = */(phy_specific_func_t)elink_848xx_specific_func + /*.format_fw_ver= */elink_848xx_format_ver, + /*.hw_reset = */elink_84833_hw_reset_phy, + /*.set_link_led = */elink_848xx_set_link_led, + /*.phy_specific_func = */elink_848xx_specific_func #endif }; #endif // #ifndef EXCLUDE_BCM84833 @@ -12895,14 +12899,14 @@ static const struct elink_phy phy_54618se = { /* req_duplex = */0, /* rsrv = */0, #ifndef EXCLUDE_NON_COMMON_INIT - /*.config_init = */(config_init_t)elink_54618se_config_init, - /*.read_status = */(read_status_t)elink_54618se_read_status, - /*.link_reset = */(link_reset_t)elink_54618se_link_reset, - /*.config_loopback = */(config_loopback_t)elink_54618se_config_loopback, + /*.config_init = */elink_54618se_config_init, + /*.read_status = */elink_54618se_read_status, + /*.link_reset = */elink_54618se_link_reset, + /*.config_loopback = */elink_54618se_config_loopback, /*.format_fw_ver= */(format_fw_ver_t)NULL, /*.hw_reset = */(hw_reset_t)NULL, - /*.set_link_led = */(set_link_led_t)elink_5461x_set_link_led, - /*.phy_specific_func = */(phy_specific_func_t)elink_54618se_specific_func + /*.set_link_led = */elink_5461x_set_link_led, + /*.phy_specific_func = */elink_54618se_specific_func #endif }; #endif diff --git a/usr/src/uts/common/io/bnxe/577xx/hsi/hw/include/clc.h b/usr/src/uts/common/io/bnxe/577xx/hsi/hw/include/clc.h index d4faa2dca1..5c72c19e71 100644 --- a/usr/src/uts/common/io/bnxe/577xx/hsi/hw/include/clc.h +++ b/usr/src/uts/common/io/bnxe/577xx/hsi/hw/include/clc.h @@ -234,15 +234,15 @@ struct elink_vars; struct elink_params; struct elink_phy; -typedef u8 (*config_init_t)(struct elink_phy *phy, struct elink_params *params, - struct elink_vars *vars); -typedef u8 (*read_status_t)(struct elink_phy *phy, struct elink_params *params, - struct elink_vars *vars); +typedef elink_status_t (*config_init_t)(struct elink_phy *phy, + struct elink_params *params, struct elink_vars *vars); +typedef elink_status_t (*read_status_t)(struct elink_phy *phy, + struct elink_params *params, struct elink_vars *vars); typedef void (*link_reset_t)(struct elink_phy *phy, struct elink_params *params); typedef void (*config_loopback_t)(struct elink_phy *phy, struct elink_params *params); -typedef u8 (*format_fw_ver_t)(u32 raw, u8 *str, u16 *len); +typedef elink_status_t (*format_fw_ver_t)(u32 raw, u8 *str, u16 *len); typedef void (*hw_reset_t)(struct elink_phy *phy, struct elink_params *params); typedef void (*set_link_led_t)(struct elink_phy *phy, struct elink_params *params, u8 mode); diff --git a/usr/src/uts/common/io/gld.c b/usr/src/uts/common/io/gld.c index 5502ea54af..d29bb816b7 100644 --- a/usr/src/uts/common/io/gld.c +++ b/usr/src/uts/common/io/gld.c @@ -2902,10 +2902,10 @@ gld_sendup(gld_mac_info_t *macinfo, pktinfo_t *pktinfo, * device might need this, so it's here but undocumented. */ if (macinfo->gldm_options & GLDOPT_FAST_RECV) { - send = (void (*)(queue_t *, mblk_t *))putq; + send = (void (*)(queue_t *, mblk_t *))(uintptr_t)putq; cansend = canput; } else { - send = (void (*)(queue_t *, mblk_t *))putnext; + send = putnext; cansend = canputnext; } diff --git a/usr/src/uts/common/xen/io/xdf.c b/usr/src/uts/common/xen/io/xdf.c index 7a945b8cf1..bd900f818c 100644 --- a/usr/src/uts/common/xen/io/xdf.c +++ b/usr/src/uts/common/xen/io/xdf.c @@ -171,7 +171,7 @@ static ddi_dma_attr_t xb_dma_attr = { (uint64_t)XB_BSIZE, /* alignment in bytes */ XB_BSIZE - 1, /* bitmap of burst sizes */ XB_BSIZE, /* min transfer */ - (uint64_t)XB_MAX_XFER, /* maximum transfer */ + (uint64_t)XB_MAX_XFER, /* maximum transfer */ (uint64_t)PAGEOFFSET, /* 1 page segment length */ BLKIF_MAX_SEGMENTS_PER_REQUEST, /* maximum number of segments */ XB_BSIZE, /* granularity */ @@ -203,16 +203,22 @@ xdf_timeout_handler(void *arg) * Note: we only register one callback function to grant table subsystem * since we only have one 'struct gnttab_free_callback' in xdf_t. */ -static int -xdf_dmacallback(caddr_t arg) +static void +xdf_gncallback(void *arg) { - xdf_t *vdp = (xdf_t *)arg; + xdf_t *vdp = arg; ASSERT(vdp != NULL); DPRINTF(DMA_DBG, ("xdf@%s: DMA callback started\n", vdp->xdf_addr)); ddi_trigger_softintr(vdp->xdf_softintr_id); +} + +static int +xdf_dmacallback(caddr_t arg) +{ + xdf_gncallback(arg); return (DDI_DMA_CALLBACK_DONE); } @@ -229,7 +235,7 @@ gs_get(xdf_t *vdp, int isread) SETDMACBON(vdp); gnttab_request_free_callback( &vdp->xdf_gnt_callback, - (void (*)(void *))xdf_dmacallback, + xdf_gncallback, (void *)vdp, BLKIF_MAX_SEGMENTS_PER_REQUEST); } @@ -1518,7 +1524,7 @@ xdf_setstate_init(xdf_t *vdp) xenbus_transaction_t xbt; grant_ref_t gref; char *xsname, *str; - int rv; + int rv; ASSERT(MUTEX_HELD(&vdp->xdf_cb_lk)); ASSERT(MUTEX_NOT_HELD(&vdp->xdf_dev_lk)); diff --git a/usr/src/uts/common/xen/io/xencons.c b/usr/src/uts/common/xen/io/xencons.c index 7862e7bbcb..f5b1772d29 100644 --- a/usr/src/uts/common/xen/io/xencons.c +++ b/usr/src/uts/common/xen/io/xencons.c @@ -136,7 +136,7 @@ static int xenconsgetchar(cons_polledio_arg_t); static boolean_t xenconsischar(cons_polledio_arg_t); static uint_t xenconsintr(caddr_t); -static uint_t xenconsintr_priv(caddr_t); +static uint_t xenconsintr_priv(caddr_t, caddr_t); /*PRINTFLIKE2*/ static void xenconserror(int, const char *, ...) __KPRINTFLIKE(2); static void xencons_soft_state_free(struct xencons *); @@ -162,7 +162,7 @@ xenconssetup_avintr(struct xencons *xcp, int attach) if (attach) { /* Setup our interrupt binding. */ - (void) add_avintr(NULL, IPL_CONS, (avfunc)xenconsintr_priv, + (void) add_avintr(NULL, IPL_CONS, xenconsintr_priv, "xencons", xcp->console_irq, (caddr_t)xcp, NULL, NULL, xcp->dip); } else { @@ -172,7 +172,7 @@ xenconssetup_avintr(struct xencons *xcp, int attach) * service routine is not currently executing and that it won't * be invoked again. */ - (void) rem_avintr(NULL, IPL_CONS, (avfunc)xenconsintr_priv, + (void) rem_avintr(NULL, IPL_CONS, xenconsintr_priv, xcp->console_irq); } @@ -748,7 +748,7 @@ xenconsintr(caddr_t arg) * Console interrupt routine for priviliged domains */ static uint_t -xenconsintr_priv(caddr_t arg) +xenconsintr_priv(caddr_t arg, caddr_t arg1 __unused) { struct xencons *xcp = (struct xencons *)arg; |
