diff options
author | Milan Jurik <milan.jurik@xylab.cz> | 2012-02-18 19:52:02 +0100 |
---|---|---|
committer | Milan Jurik <milan.jurik@xylab.cz> | 2012-02-18 19:52:02 +0100 |
commit | 33f5ff17089e3a43e6e730bf80384c233123dbd9 (patch) | |
tree | fe2258608d48d89964b62de39d7ba9c0ceea67f5 | |
parent | b54d0971a8fbfdfacbe9451070dd10e3a56a96ae (diff) | |
download | illumos-gate-33f5ff17089e3a43e6e730bf80384c233123dbd9.tar.gz |
2077 lots of unreachable breaks in illumos gate
Reviewed by: Dan McDonald <danmcd@nexenta.com>
Reviewed by: Garrett D'Amore <garrett@damore.org>
Approved by: Richard Lowe <richlowe@richlowe.net>
65 files changed, 139 insertions, 436 deletions
diff --git a/usr/src/cmd/auditreduce/token.c b/usr/src/cmd/auditreduce/token.c index 71a0a32a1a..c1d67d910c 100644 --- a/usr/src/cmd/auditreduce/token.c +++ b/usr/src/cmd/auditreduce/token.c @@ -21,6 +21,7 @@ /* * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2012 Milan Jurik. All rights reserved. */ @@ -224,7 +225,6 @@ arbitrary_data_token(adr_t *adr) break; default: return (-2); - break; } } return (-1); diff --git a/usr/src/cmd/availdevs/availdevs.c b/usr/src/cmd/availdevs/availdevs.c index 7ecec0a05c..6c39f394d1 100644 --- a/usr/src/cmd/availdevs/availdevs.c +++ b/usr/src/cmd/availdevs/availdevs.c @@ -21,6 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012 Milan Jurik. All rights reserved. */ #include "availdevs.h" @@ -217,7 +218,6 @@ main(int argc, char **argv) default: return (1); - break; } argc -= optind; diff --git a/usr/src/cmd/boot/bootadm/bootadm.c b/usr/src/cmd/boot/bootadm/bootadm.c index e86ff541f8..964f9b7751 100644 --- a/usr/src/cmd/boot/bootadm/bootadm.c +++ b/usr/src/cmd/boot/bootadm/bootadm.c @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012 Milan Jurik. All rights reserved. */ /* @@ -4961,7 +4962,6 @@ get_partition(char *device) free(wholedisk); libfdisk_fini(&epp); return (partno); - break; } } #endif diff --git a/usr/src/cmd/boot/installgrub/installgrub.c b/usr/src/cmd/boot/installgrub/installgrub.c index 452a188d9c..3df067420c 100644 --- a/usr/src/cmd/boot/installgrub/installgrub.c +++ b/usr/src/cmd/boot/installgrub/installgrub.c @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012 Milan Jurik. All rights reserved. */ #include <stdio.h> @@ -786,7 +787,6 @@ get_start_sector(ig_device_t *device) default: (void) fprintf(stderr, LIBFDISK_INIT_FAIL); return (BC_ERROR); - break; } } diff --git a/usr/src/cmd/cdrw/misc_scsi.c b/usr/src/cmd/cdrw/misc_scsi.c index fff0605f39..363ed85f16 100644 --- a/usr/src/cmd/cdrw/misc_scsi.c +++ b/usr/src/cmd/cdrw/misc_scsi.c @@ -21,10 +21,9 @@ /* * Copyright 2007 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2012 Milan Jurik. All rights reserved. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <sys/types.h> #include <stdlib.h> #include <string.h> @@ -917,13 +916,11 @@ cd_speed_ctrl(cd_device *dev, int cmd, int speed) rate = cd_speed_get(dev, GET_WRITE_SPEED); return (set_cd_speed(dev->d_fd, cdrw_x_to_bandwidth(speed), rate)); - break; case SET_WRITE_SPEED: rate = cd_speed_get(dev, GET_READ_SPEED); return (set_cd_speed(dev->d_fd, rate, cdrw_x_to_bandwidth(speed))); - break; default: return (0); diff --git a/usr/src/cmd/cmd-crypto/decrypt/decrypt.c b/usr/src/cmd/cmd-crypto/decrypt/decrypt.c index 94c208a87f..584a31cafb 100644 --- a/usr/src/cmd/cmd-crypto/decrypt/decrypt.c +++ b/usr/src/cmd/cmd-crypto/decrypt/decrypt.c @@ -22,6 +22,7 @@ /* * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2012 Milan Jurik. All rights reserved. */ /* @@ -792,7 +793,6 @@ execute_cmd(struct CommandInfo *cmd, char *algo_str) "input file - expected %d, got %d."), SUNW_ENCRYPT_FILE_VERSION, version); goto cleanup; - break; } } diff --git a/usr/src/cmd/cmd-crypto/pktool/delete.c b/usr/src/cmd/cmd-crypto/pktool/delete.c index de0a5da0be..676552baf5 100644 --- a/usr/src/cmd/cmd-crypto/pktool/delete.c +++ b/usr/src/cmd/cmd-crypto/pktool/delete.c @@ -21,10 +21,9 @@ /* * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2012 Milan Jurik. All rights reserved. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * This file implements the token object delete operation for this tool. * It loads the PKCS#11 modules, finds the object to delete, deletes it, @@ -805,7 +804,6 @@ pk_delete(int argc, char *argv[]) break; default: return (PK_ERR_USAGE); - break; } } diff --git a/usr/src/cmd/cmd-crypto/pktool/export.c b/usr/src/cmd/cmd-crypto/pktool/export.c index 35c3fad004..b1339850f2 100644 --- a/usr/src/cmd/cmd-crypto/pktool/export.c +++ b/usr/src/cmd/cmd-crypto/pktool/export.c @@ -19,6 +19,7 @@ * CDDL HEADER END * * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012 Milan Jurik. All rights reserved. */ /* @@ -777,7 +778,6 @@ pk_export(int argc, char *argv[]) break; default: return (PK_ERR_USAGE); - break; } } diff --git a/usr/src/cmd/cmd-crypto/pktool/import.c b/usr/src/cmd/cmd-crypto/pktool/import.c index 48427897ba..f11990e121 100644 --- a/usr/src/cmd/cmd-crypto/pktool/import.c +++ b/usr/src/cmd/cmd-crypto/pktool/import.c @@ -21,6 +21,7 @@ /* * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2012 Milan Jurik. All rights reserved. */ /* @@ -916,7 +917,6 @@ pk_import(int argc, char *argv[]) break; default: return (PK_ERR_USAGE); - break; } } diff --git a/usr/src/cmd/cmd-crypto/pktool/inittoken.c b/usr/src/cmd/cmd-crypto/pktool/inittoken.c index caf618865c..bc8b4ab825 100644 --- a/usr/src/cmd/cmd-crypto/pktool/inittoken.c +++ b/usr/src/cmd/cmd-crypto/pktool/inittoken.c @@ -21,6 +21,7 @@ /* * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2012 Milan Jurik. All rights reserved. */ /* @@ -69,7 +70,6 @@ pk_inittoken(int argc, char *argv[]) break; default: return (PK_ERR_USAGE); - break; } } diff --git a/usr/src/cmd/cmd-crypto/pktool/list.c b/usr/src/cmd/cmd-crypto/pktool/list.c index 67e262e311..369e1fbe45 100644 --- a/usr/src/cmd/cmd-crypto/pktool/list.c +++ b/usr/src/cmd/cmd-crypto/pktool/list.c @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012 Milan Jurik. All rights reserved. */ /* @@ -138,19 +139,14 @@ describeKey(KMF_KEY_HANDLE *key) switch (key->keyalg) { case KMF_AES: return (gettext("AES")); - break; case KMF_RC4: return (gettext("ARCFOUR")); - break; case KMF_DES: return (gettext("DES")); - break; case KMF_DES3: return (gettext("Triple-DES")); - break; default: return (gettext("symmetric")); - break; } } diff --git a/usr/src/cmd/cmd-crypto/pktool/setpin.c b/usr/src/cmd/cmd-crypto/pktool/setpin.c index c6a8688273..471e449ccc 100644 --- a/usr/src/cmd/cmd-crypto/pktool/setpin.c +++ b/usr/src/cmd/cmd-crypto/pktool/setpin.c @@ -21,6 +21,7 @@ /* * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2012 Milan Jurik. All rights reserved. */ /* @@ -275,7 +276,6 @@ pk_setpin(int argc, char *argv[]) break; default: return (PK_ERR_USAGE); - break; } } diff --git a/usr/src/cmd/cmd-inet/usr.lib/ilbd/ilbd_hc.c b/usr/src/cmd/cmd-inet/usr.lib/ilbd/ilbd_hc.c index da1ab63efe..fb95c6f67e 100644 --- a/usr/src/cmd/cmd-inet/usr.lib/ilbd/ilbd_hc.c +++ b/usr/src/cmd/cmd-inet/usr.lib/ilbd/ilbd_hc.c @@ -22,6 +22,7 @@ /* * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2012 Milan Jurik. All rights reserved. */ #include <sys/types.h> @@ -1083,13 +1084,10 @@ topo_2_str(ilb_topo_t topo) switch (topo) { case ILB_TOPO_DSR: return ("DSR"); - break; case ILB_TOPO_NAT: return ("NAT"); - break; case ILB_TOPO_HALF_NAT: return ("HALF_NAT"); - break; default: /* Should not happen. */ logerr("%s: unknown topology", __func__); @@ -1188,7 +1186,6 @@ create_argv(ilbd_hc_srv_t *srv, char *argv[]) default: logerr("%s: unknown protocol", __func__); goto cleanup; - break; } if (argv[3] == NULL) goto cleanup; @@ -1225,7 +1222,6 @@ create_argv(ilbd_hc_srv_t *srv, char *argv[]) default: logerr("%s: unknown HC flag", __func__); goto cleanup; - break; } (void) sprintf(buf, "%d", port); if ((argv[5] = strdup(buf)) == NULL) diff --git a/usr/src/cmd/cmd-inet/usr.lib/wanboot/wanboot-cgi/wanboot-cgi.c b/usr/src/cmd/cmd-inet/usr.lib/wanboot/wanboot-cgi/wanboot-cgi.c index c24626d9a9..c8f391031a 100644 --- a/usr/src/cmd/cmd-inet/usr.lib/wanboot/wanboot-cgi/wanboot-cgi.c +++ b/usr/src/cmd/cmd-inet/usr.lib/wanboot/wanboot-cgi/wanboot-cgi.c @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012 Milan Jurik. All rights reserved. */ #include <stdio.h> @@ -474,7 +475,6 @@ get_request_info(int *contentp, char **netp, char **cidp, char **noncep, default: print_status(400, "(illegal query string)"); return (B_FALSE); - break; } } diff --git a/usr/src/cmd/cmd-inet/usr.sbin/ilbadm/ilbadm_rules.c b/usr/src/cmd/cmd-inet/usr.sbin/ilbadm/ilbadm_rules.c index dc428c4998..f159a3b6d6 100644 --- a/usr/src/cmd/cmd-inet/usr.sbin/ilbadm/ilbadm_rules.c +++ b/usr/src/cmd/cmd-inet/usr.sbin/ilbadm/ilbadm_rules.c @@ -22,6 +22,7 @@ /* * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2012 Milan Jurik. All rights reserved. */ #include <stdio.h> @@ -662,8 +663,6 @@ ilbadm_show_rules(int argc, char *argv[]) (char)optopt); rc = ILBADM_LIBERR; goto out; - /* not reached */ - break; case '?': default: unknown_opt(argv, optind-1); @@ -864,8 +863,6 @@ ilbadm_show_server(int argc, char *argv[]) (char)optopt); rc = ILBADM_LIBERR; goto out; - /* not reached */ - break; case '?': default: unknown_opt(argv, optind-1); diff --git a/usr/src/cmd/cmd-inet/usr.sbin/ilbadm/ilbadm_sg.c b/usr/src/cmd/cmd-inet/usr.sbin/ilbadm/ilbadm_sg.c index d7009bf811..8a0d92bbd7 100644 --- a/usr/src/cmd/cmd-inet/usr.sbin/ilbadm/ilbadm_sg.c +++ b/usr/src/cmd/cmd-inet/usr.sbin/ilbadm/ilbadm_sg.c @@ -22,6 +22,7 @@ /* * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2012 Milan Jurik. All rights reserved. */ #include <stdio.h> @@ -258,8 +259,6 @@ ilbadm_show_servergroups(int argc, char *argv[]) " for %c"), (char)optopt); rc = ILBADM_LIBERR; goto out; - /* not reached */ - break; default: unknown_opt(argv, optind-1); /* not reached */ break; diff --git a/usr/src/cmd/cmd-inet/usr.sbin/ilbadm/ilbadm_stats.c b/usr/src/cmd/cmd-inet/usr.sbin/ilbadm/ilbadm_stats.c index 648ec1409e..416f28d23f 100644 --- a/usr/src/cmd/cmd-inet/usr.sbin/ilbadm/ilbadm_stats.c +++ b/usr/src/cmd/cmd-inet/usr.sbin/ilbadm/ilbadm_stats.c @@ -22,6 +22,7 @@ /* * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2012 Milan Jurik. All rights reserved. */ #include <stdio.h> @@ -361,13 +362,9 @@ of_itemize_stats(ofmt_arg_t *of_arg, char *buf, uint_t bufsize) (void) snprintf(buf, bufsize, "%s", sta->ilbst_rlist[rule_index].ird_rulename); return (B_TRUE); - /* not reached */ - break; case ILBST_ITEMIZE_SNAME: (void) snprintf(buf, bufsize, "%s", srv->isd_servername); return (B_TRUE); - /* not reached */ - break; } count = srv->isd_serverstats[stat_ind].is_value; diff --git a/usr/src/cmd/cmd-inet/usr.sbin/ilbadm/ilbadm_subr.c b/usr/src/cmd/cmd-inet/usr.sbin/ilbadm/ilbadm_subr.c index 940f82bc12..201023cea9 100644 --- a/usr/src/cmd/cmd-inet/usr.sbin/ilbadm/ilbadm_subr.c +++ b/usr/src/cmd/cmd-inet/usr.sbin/ilbadm/ilbadm_subr.c @@ -22,6 +22,7 @@ /* * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2012 Milan Jurik. All rights reserved. */ #include <stdio.h> @@ -186,7 +187,6 @@ i_match_onehost(const char *val, ilb_ip_addr_t *ip, addr_type_t *a_type) } default: return (ILBADM_INVAL_AF); - break; } if (a_type != NULL) @@ -328,12 +328,10 @@ i_expand_iprange(ilbadm_sgroup_t *sg, ilb_server_data_t *sr, return (ILBADM_TOOMANYIPADDR); switch (ip1->ia_af) { - case AF_INET: return (i_expand_ipv4range(sg, sr, ip1, ip2)); - /* not reached */ - break; - case AF_INET6: return (i_expand_ipv6range(sg, sr, ip1, ip2)); - /* not reached */ - break; + case AF_INET: + return (i_expand_ipv4range(sg, sr, ip1, ip2)); + case AF_INET6: + return (i_expand_ipv6range(sg, sr, ip1, ip2)); } return (ILBADM_INVAL_AF); } diff --git a/usr/src/cmd/cpio/cpio.c b/usr/src/cmd/cpio/cpio.c index 899c97fe85..4aca72b0c5 100644 --- a/usr/src/cmd/cpio/cpio.c +++ b/usr/src/cmd/cpio/cpio.c @@ -20,6 +20,7 @@ */ /* * Copyright (c) 1988, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012 Milan Jurik. All rights reserved. */ /* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */ @@ -9120,7 +9121,6 @@ sl_insert(dev_t device, ino_t inode, int ftype) case 0: /* found it */ return (p); - break; case 1: /* move right */ diff --git a/usr/src/cmd/dfs.cmds/sharectl/sharectl.c b/usr/src/cmd/dfs.cmds/sharectl/sharectl.c index 2e400829ff..469ba82544 100644 --- a/usr/src/cmd/dfs.cmds/sharectl/sharectl.c +++ b/usr/src/cmd/dfs.cmds/sharectl/sharectl.c @@ -22,6 +22,7 @@ /* * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2012 Milan Jurik. All rights reserved. */ #include <stdlib.h> @@ -146,7 +147,6 @@ sc_get(sa_handle_t handle, int flags, int argc, char *argv[]) (void) printf(gettext("usage: %s\n"), sc_get_usage(USAGE_CTL_GET)); return (SA_OK); - break; } } @@ -291,7 +291,6 @@ sc_set(sa_handle_t handle, int flags, int argc, char *argv[]) (void) printf(gettext("usage: %s\n"), sc_get_usage(USAGE_CTL_SET)); return (SA_OK); - break; } } diff --git a/usr/src/cmd/dfs.cmds/sharemgr/commands.c b/usr/src/cmd/dfs.cmds/sharemgr/commands.c index a26312e4e1..15e9cee992 100644 --- a/usr/src/cmd/dfs.cmds/sharemgr/commands.c +++ b/usr/src/cmd/dfs.cmds/sharemgr/commands.c @@ -22,6 +22,7 @@ /* * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2012 Milan Jurik. All rights reserved. */ #include <sys/types.h> @@ -1220,7 +1221,6 @@ sa_create(sa_handle_t handle, int flags, int argc, char *argv[]) (void) printf(gettext( "Invalid protocol specified: %s\n"), protocol); return (SA_INVALID_PROTOCOL); - break; case 'p': ret = add_opt(&optlist, optarg, 0); switch (ret) { diff --git a/usr/src/cmd/fm/modules/common/eversholt/fme.c b/usr/src/cmd/fm/modules/common/eversholt/fme.c index d6858c9916..8113230bf3 100644 --- a/usr/src/cmd/fm/modules/common/eversholt/fme.c +++ b/usr/src/cmd/fm/modules/common/eversholt/fme.c @@ -21,6 +21,7 @@ /* * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012 Milan Jurik. All rights reserved. * * fme.c -- fault management exercise module * @@ -2949,7 +2950,6 @@ undiag_2defect_str(int ud) case UD_VAL_BADOBS: case UD_VAL_CFGMISMATCH: return (UNDIAG_DEFECT_CHKPT); - break; case UD_VAL_BADEVENTI: case UD_VAL_BADEVENTPATH: @@ -2958,16 +2958,13 @@ undiag_2defect_str(int ud) case UD_VAL_NOPATH: case UD_VAL_UNSOLVD: return (UNDIAG_DEFECT_FME); - break; case UD_VAL_MAXFME: return (UNDIAG_DEFECT_LIMIT); - break; case UD_VAL_UNKNOWN: default: return (UNDIAG_DEFECT_UNKNOWN); - break; } } diff --git a/usr/src/cmd/format/menu_command.c b/usr/src/cmd/format/menu_command.c index e1ca030e66..29f95af78b 100644 --- a/usr/src/cmd/format/menu_command.c +++ b/usr/src/cmd/format/menu_command.c @@ -20,6 +20,7 @@ */ /* * Copyright (c) 1993, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012 Milan Jurik. All rights reserved. */ /* @@ -497,10 +498,9 @@ c_type() } } return (0); - break; default: - /* Should never happen */ - return (-1); + /* Should never happen */ + return (-1); } } else if ((index == other_choice) && (cur_label == L_TYPE_SOLARIS)) { /* diff --git a/usr/src/cmd/iscsid/iscsid.c b/usr/src/cmd/iscsid/iscsid.c index 6d134689e4..b8ffaab4b5 100644 --- a/usr/src/cmd/iscsid/iscsid.c +++ b/usr/src/cmd/iscsid/iscsid.c @@ -21,6 +21,7 @@ /* * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2012 Milan Jurik. All rights reserved. */ #include <sys/types.h> @@ -280,7 +281,6 @@ main( " service exited with sessions left.")); } return (0); - break; default: break; } diff --git a/usr/src/cmd/ldap/ns_ldap/ldapaddent.c b/usr/src/cmd/ldap/ns_ldap/ldapaddent.c index 4a9016cf70..62c028c481 100644 --- a/usr/src/cmd/ldap/ns_ldap/ldapaddent.c +++ b/usr/src/cmd/ldap/ns_ldap/ldapaddent.c @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012 Milan Jurik. All rights reserved. */ /* @@ -4113,7 +4114,6 @@ addfile() exit_val = 2; free(line.str); return; - break; case GENENT_ERR: (void) fprintf(stderr, gettext("Internal Error while adding line: %s\n"), @@ -4121,7 +4121,6 @@ addfile() exit_val = 3; free(line.str); return; - break; } } free(line.str); @@ -4726,16 +4725,12 @@ h_errno2str(int h_errno) { switch (h_errno) { case HOST_NOT_FOUND: return ("HOST_NOT_FOUND"); - break; case TRY_AGAIN: return ("TRY_AGAIN"); - break; case NO_RECOVERY: return ("NO_RECOVERY"); - break; case NO_DATA: return ("NO_DATA"); - break; default: break; } diff --git a/usr/src/cmd/ldap/ns_ldap/ldapclient.c b/usr/src/cmd/ldap/ns_ldap/ldapclient.c index 2221df0de8..e0159ccbc3 100644 --- a/usr/src/cmd/ldap/ns_ldap/ldapclient.c +++ b/usr/src/cmd/ldap/ns_ldap/ldapclient.c @@ -21,6 +21,7 @@ /* * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2012 Milan Jurik. All rights reserved. */ /* @@ -1703,7 +1704,6 @@ client_init(clientopts_t *arglist) break; default: continue; - break; } if (strcmp(cred, arglist->credentialLevel) == 0) { diff --git a/usr/src/cmd/mdb/common/modules/pmcs/pmcs.c b/usr/src/cmd/mdb/common/modules/pmcs/pmcs.c index 30ec30cbb6..ddd42cf781 100644 --- a/usr/src/cmd/mdb/common/modules/pmcs/pmcs.c +++ b/usr/src/cmd/mdb/common/modules/pmcs/pmcs.c @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012 Milan Jurik. All rights reserved. */ #include <limits.h> @@ -1243,13 +1244,10 @@ obq_type(int qnum) switch (qnum) { case PMCS_OQ_IODONE: return ("I/O"); - break; case PMCS_OQ_GENERAL: return ("General"); - break; case PMCS_OQ_EVENTS: return ("Events"); - break; default: return ("UNKNOWN"); } @@ -1261,16 +1259,12 @@ iomb_cat(uint32_t cat) switch (cat) { case PMCS_IOMB_CAT_NET: return ("NET"); - break; case PMCS_IOMB_CAT_FC: return ("FC"); - break; case PMCS_IOMB_CAT_SAS: return ("SAS"); - break; case PMCS_IOMB_CAT_SCSI: return ("SCSI"); - break; default: return ("???"); } @@ -1282,73 +1276,50 @@ iomb_event(uint8_t event) switch (event) { case IOP_EVENT_PHY_STOP_STATUS: return ("PHY STOP"); - break; case IOP_EVENT_SAS_PHY_UP: return ("PHY UP"); - break; case IOP_EVENT_SATA_PHY_UP: return ("SATA PHY UP"); - break; case IOP_EVENT_SATA_SPINUP_HOLD: return ("SATA SPINUP HOLD"); - break; case IOP_EVENT_PHY_DOWN: return ("PHY DOWN"); - break; case IOP_EVENT_BROADCAST_CHANGE: return ("BROADCAST CHANGE"); - break; case IOP_EVENT_BROADCAST_SES: return ("BROADCAST SES"); - break; case IOP_EVENT_PHY_ERR_INBOUND_CRC: return ("INBOUND CRC ERROR"); - break; case IOP_EVENT_HARD_RESET_RECEIVED: return ("HARD RESET"); - break; case IOP_EVENT_EVENT_ID_FRAME_TIMO: return ("IDENTIFY FRAME TIMEOUT"); - break; case IOP_EVENT_BROADCAST_EXP: return ("BROADCAST EXPANDER"); - break; case IOP_EVENT_PHY_START_STATUS: return ("PHY START"); - break; case IOP_EVENT_PHY_ERR_INVALID_DWORD: return ("INVALID DWORD"); - break; case IOP_EVENT_PHY_ERR_DISPARITY_ERROR: return ("DISPARITY ERROR"); - break; case IOP_EVENT_PHY_ERR_CODE_VIOLATION: return ("CODE VIOLATION"); - break; case IOP_EVENT_PHY_ERR_LOSS_OF_DWORD_SYN: return ("LOSS OF DWORD SYNC"); - break; case IOP_EVENT_PHY_ERR_PHY_RESET_FAILD: return ("PHY RESET FAILED"); - break; case IOP_EVENT_PORT_RECOVERY_TIMER_TMO: return ("PORT RECOVERY TIMEOUT"); - break; case IOP_EVENT_PORT_RECOVER: return ("PORT RECOVERY"); - break; case IOP_EVENT_PORT_RESET_TIMER_TMO: return ("PORT RESET TIMEOUT"); - break; case IOP_EVENT_PORT_RESET_COMPLETE: return ("PORT RESET COMPLETE"); - break; case IOP_EVENT_BROADCAST_ASYNC_EVENT: return ("BROADCAST ASYNC"); - break; case IOP_EVENT_IT_NEXUS_LOSS: return ("I/T NEXUS LOSS"); - break; default: return ("Unknown Event"); } @@ -1360,124 +1331,84 @@ inbound_iomb_opcode(uint32_t opcode) switch (opcode) { case PMCIN_ECHO: return ("ECHO"); - break; case PMCIN_GET_INFO: return ("GET_INFO"); - break; case PMCIN_GET_VPD: return ("GET_VPD"); - break; case PMCIN_PHY_START: return ("PHY_START"); - break; case PMCIN_PHY_STOP: return ("PHY_STOP"); - break; case PMCIN_SSP_INI_IO_START: return ("INI_IO_START"); - break; case PMCIN_SSP_INI_TM_START: return ("INI_TM_START"); - break; case PMCIN_SSP_INI_EXT_IO_START: return ("INI_EXT_IO_START"); - break; case PMCIN_DEVICE_HANDLE_ACCEPT: return ("DEVICE_HANDLE_ACCEPT"); - break; case PMCIN_SSP_TGT_IO_START: return ("TGT_IO_START"); - break; case PMCIN_SSP_TGT_RESPONSE_START: return ("TGT_RESPONSE_START"); - break; case PMCIN_SSP_INI_EDC_EXT_IO_START: return ("INI_EDC_EXT_IO_START"); - break; case PMCIN_SSP_INI_EDC_EXT_IO_START1: return ("INI_EDC_EXT_IO_START1"); - break; case PMCIN_SSP_TGT_EDC_IO_START: return ("TGT_EDC_IO_START"); - break; case PMCIN_SSP_ABORT: return ("SSP_ABORT"); - break; case PMCIN_DEREGISTER_DEVICE_HANDLE: return ("DEREGISTER_DEVICE_HANDLE"); - break; case PMCIN_GET_DEVICE_HANDLE: return ("GET_DEVICE_HANDLE"); - break; case PMCIN_SMP_REQUEST: return ("SMP_REQUEST"); - break; case PMCIN_SMP_RESPONSE: return ("SMP_RESPONSE"); - break; case PMCIN_SMP_ABORT: return ("SMP_ABORT"); - break; case PMCIN_ASSISTED_DISCOVERY: return ("ASSISTED_DISCOVERY"); - break; case PMCIN_REGISTER_DEVICE: return ("REGISTER_DEVICE"); - break; case PMCIN_SATA_HOST_IO_START: return ("SATA_HOST_IO_START"); - break; case PMCIN_SATA_ABORT: return ("SATA_ABORT"); - break; case PMCIN_LOCAL_PHY_CONTROL: return ("LOCAL_PHY_CONTROL"); - break; case PMCIN_GET_DEVICE_INFO: return ("GET_DEVICE_INFO"); - break; case PMCIN_TWI: return ("TWI"); - break; case PMCIN_FW_FLASH_UPDATE: return ("FW_FLASH_UPDATE"); - break; case PMCIN_SET_VPD: return ("SET_VPD"); - break; case PMCIN_GPIO: return ("GPIO"); - break; case PMCIN_SAS_DIAG_MODE_START_END: return ("SAS_DIAG_MODE_START_END"); - break; case PMCIN_SAS_DIAG_EXECUTE: return ("SAS_DIAG_EXECUTE"); - break; case PMCIN_SAS_HW_EVENT_ACK: return ("SAS_HW_EVENT_ACK"); - break; case PMCIN_GET_TIME_STAMP: return ("GET_TIME_STAMP"); - break; case PMCIN_PORT_CONTROL: return ("PORT_CONTROL"); - break; case PMCIN_GET_NVMD_DATA: return ("GET_NVMD_DATA"); - break; case PMCIN_SET_NVMD_DATA: return ("SET_NVMD_DATA"); - break; case PMCIN_SET_DEVICE_STATE: return ("SET_DEVICE_STATE"); - break; case PMCIN_GET_DEVICE_STATE: return ("GET_DEVICE_STATE"); - break; default: return ("UNKNOWN"); - break; } } @@ -1487,124 +1418,84 @@ outbound_iomb_opcode(uint32_t opcode) switch (opcode) { case PMCOUT_ECHO: return ("ECHO"); - break; case PMCOUT_GET_INFO: return ("GET_INFO"); - break; case PMCOUT_GET_VPD: return ("GET_VPD"); - break; case PMCOUT_SAS_HW_EVENT: return ("SAS_HW_EVENT"); - break; case PMCOUT_SSP_COMPLETION: return ("SSP_COMPLETION"); - break; case PMCOUT_SMP_COMPLETION: return ("SMP_COMPLETION"); - break; case PMCOUT_LOCAL_PHY_CONTROL: return ("LOCAL_PHY_CONTROL"); - break; case PMCOUT_SAS_ASSISTED_DISCOVERY_EVENT: return ("SAS_ASSISTED_DISCOVERY_SENT"); - break; case PMCOUT_SATA_ASSISTED_DISCOVERY_EVENT: return ("SATA_ASSISTED_DISCOVERY_SENT"); - break; case PMCOUT_DEVICE_REGISTRATION: return ("DEVICE_REGISTRATION"); - break; case PMCOUT_DEREGISTER_DEVICE_HANDLE: return ("DEREGISTER_DEVICE_HANDLE"); - break; case PMCOUT_GET_DEVICE_HANDLE: return ("GET_DEVICE_HANDLE"); - break; case PMCOUT_SATA_COMPLETION: return ("SATA_COMPLETION"); - break; case PMCOUT_SATA_EVENT: return ("SATA_EVENT"); - break; case PMCOUT_SSP_EVENT: return ("SSP_EVENT"); - break; case PMCOUT_DEVICE_HANDLE_ARRIVED: return ("DEVICE_HANDLE_ARRIVED"); - break; case PMCOUT_SSP_REQUEST_RECEIVED: return ("SSP_REQUEST_RECEIVED"); - break; case PMCOUT_DEVICE_INFO: return ("DEVICE_INFO"); - break; case PMCOUT_FW_FLASH_UPDATE: return ("FW_FLASH_UPDATE"); - break; case PMCOUT_SET_VPD: return ("SET_VPD"); - break; case PMCOUT_GPIO: return ("GPIO"); - break; case PMCOUT_GPIO_EVENT: return ("GPIO_EVENT"); - break; case PMCOUT_GENERAL_EVENT: return ("GENERAL_EVENT"); - break; case PMCOUT_TWI: return ("TWI"); - break; case PMCOUT_SSP_ABORT: return ("SSP_ABORT"); - break; case PMCOUT_SATA_ABORT: return ("SATA_ABORT"); - break; case PMCOUT_SAS_DIAG_MODE_START_END: return ("SAS_DIAG_MODE_START_END"); - break; case PMCOUT_SAS_DIAG_EXECUTE: return ("SAS_DIAG_EXECUTE"); - break; case PMCOUT_GET_TIME_STAMP: return ("GET_TIME_STAMP"); - break; case PMCOUT_SAS_HW_EVENT_ACK_ACK: return ("SAS_HW_EVENT_ACK_ACK"); - break; case PMCOUT_PORT_CONTROL: return ("PORT_CONTROL"); - break; case PMCOUT_SKIP_ENTRIES: return ("SKIP_ENTRIES"); - break; case PMCOUT_SMP_ABORT: return ("SMP_ABORT"); - break; case PMCOUT_GET_NVMD_DATA: return ("GET_NVMD_DATA"); - break; case PMCOUT_SET_NVMD_DATA: return ("SET_NVMD_DATA"); - break; case PMCOUT_DEVICE_HANDLE_REMOVED: return ("DEVICE_HANDLE_REMOVED"); - break; case PMCOUT_SET_DEVICE_STATE: return ("SET_DEVICE_STATE"); - break; case PMCOUT_GET_DEVICE_STATE: return ("GET_DEVICE_STATE"); - break; case PMCOUT_SET_DEVICE_INFO: return ("SET_DEVICE_INFO"); - break; default: return ("UNKNOWN"); - break; } } diff --git a/usr/src/cmd/ndmpd/tlm/tlm_util.c b/usr/src/cmd/ndmpd/tlm/tlm_util.c index 910dcc9abb..d2215e9cdc 100644 --- a/usr/src/cmd/ndmpd/tlm/tlm_util.c +++ b/usr/src/cmd/ndmpd/tlm/tlm_util.c @@ -1,6 +1,7 @@ /* * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2012 Milan Jurik. All rights reserved. */ /* @@ -222,10 +223,8 @@ match(char *patn, char *str) str++; patn++; continue; - } else { - return (FALSE); } - break; + return (FALSE); case '*': patn++; @@ -276,11 +275,8 @@ match_ci(char *patn, char *str) str++; patn++; continue; - } else { - return (FALSE); } - break; - + return (FALSE); case '*': patn++; diff --git a/usr/src/cmd/nscd/nscd_config.c b/usr/src/cmd/nscd/nscd_config.c index 4ab90cfa43..4668ca685f 100644 --- a/usr/src/cmd/nscd/nscd_config.c +++ b/usr/src/cmd/nscd/nscd_config.c @@ -21,6 +21,7 @@ /* * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2012 Milan Jurik. All rights reserved. */ #include <stdio.h> @@ -132,7 +133,6 @@ _nscd_cfg_get_list( (me, "invalid argument: type (%d)\n", type); return (NSCD_INVALID_ARGUMENT); - break; } size = sizeof (nscd_cfg_list_t) + sizeof (nscd_cfg_id_t *) * (num + 1); diff --git a/usr/src/cmd/nscd/nscd_selfcred.c b/usr/src/cmd/nscd/nscd_selfcred.c index b5ebda937e..fb3f877b5b 100644 --- a/usr/src/cmd/nscd/nscd_selfcred.c +++ b/usr/src/cmd/nscd/nscd_selfcred.c @@ -21,6 +21,7 @@ /* * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012 Milan Jurik. All rights reserved. */ #include <stdio.h> @@ -456,14 +457,12 @@ forker_monitor( (void) smf_maintain_instance(fmri, SMF_TEMPORARY); } return ((void *)1); - break; case 0: _NSCD_LOG(NSCD_LOG_SELF_CRED, NSCD_LOG_LEVEL_DEBUG) (me, "execv path = %s\n", execpath); (void) execv(execpath, execargv); exit(0); - break; default: _NSCD_LOG(NSCD_LOG_SELF_CRED, NSCD_LOG_LEVEL_DEBUG) (me, "new forker's pid is %d\n", fpid); diff --git a/usr/src/cmd/pcitool/pcitool_ui.c b/usr/src/cmd/pcitool/pcitool_ui.c index d47fe7fefa..b3c2888b46 100644 --- a/usr/src/cmd/pcitool/pcitool_ui.c +++ b/usr/src/cmd/pcitool/pcitool_ui.c @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012 Milan Jurik. All rights reserved. */ /* @@ -823,10 +824,8 @@ get_confirmation() case 'y': case 'Y': return (B_TRUE); - break; default: return (B_FALSE); - break; } } } diff --git a/usr/src/cmd/power/sys-suspend.c b/usr/src/cmd/power/sys-suspend.c index c618dcf35e..c9116cd23a 100644 --- a/usr/src/cmd/power/sys-suspend.c +++ b/usr/src/cmd/power/sys-suspend.c @@ -21,6 +21,7 @@ /* * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2012 Milan Jurik. All rights reserved. */ /* @@ -641,7 +642,6 @@ main(int argc, char **argv) (void) printf(gettext("USAGE: suspend " "[-fnxh] [-d <display>]\n")); return (1); - break; } } diff --git a/usr/src/cmd/sbdadm/sbdadm.c b/usr/src/cmd/sbdadm/sbdadm.c index c0680816a5..c2323e11b1 100644 --- a/usr/src/cmd/sbdadm/sbdadm.c +++ b/usr/src/cmd/sbdadm/sbdadm.c @@ -21,6 +21,7 @@ /* * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2012 Milan Jurik. All rights reserved. */ #include <stdlib.h> #include <stdio.h> @@ -653,7 +654,6 @@ print_lu_attr(stmfGuid *guid) case STMF_ERROR_NOT_FOUND: /* No error here */ return (0); - break; default: (void) fprintf(stderr, "%s: %s\n", cmdName, gettext("get extended properties failed")); diff --git a/usr/src/cmd/sgs/elfedit/modules/common/cap.c b/usr/src/cmd/sgs/elfedit/modules/common/cap.c index fd55b563fc..6b94a6f8f4 100644 --- a/usr/src/cmd/sgs/elfedit/modules/common/cap.c +++ b/usr/src/cmd/sgs/elfedit/modules/common/cap.c @@ -22,6 +22,7 @@ /* * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2012 Milan Jurik. All rights reserved. */ #include <ctype.h> @@ -227,7 +228,6 @@ cap_group_id(ARGSTATE *argstate) argstate_add_str(argstate, TRUE); return (elfedit_offset_to_str(argstate->str.sec, cap->c_un.c_val, ELFEDIT_MSG_ERR, 0)); - break; } if (cap->c_tag == CA_SUNW_NULL) diff --git a/usr/src/cmd/svc/startd/fork.c b/usr/src/cmd/svc/startd/fork.c index da37bba5bf..4717d491b3 100644 --- a/usr/src/cmd/svc/startd/fork.c +++ b/usr/src/cmd/svc/startd/fork.c @@ -21,6 +21,7 @@ /* * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2012 Milan Jurik. All rights reserved. */ /* @@ -762,7 +763,6 @@ retry: fork_sulogin(B_FALSE, "Could not set state of " "%s: %s\n", SCF_INSTANCE_EMI, strerror(r)); goto retry; - break; case EINVAL: default: diff --git a/usr/src/cmd/syslogd/syslogd.c b/usr/src/cmd/syslogd/syslogd.c index ba184caf93..7b9e352d48 100644 --- a/usr/src/cmd/syslogd/syslogd.c +++ b/usr/src/cmd/syslogd/syslogd.c @@ -21,6 +21,7 @@ /* * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2012 Milan Jurik. All rights reserved. */ /* @@ -504,7 +505,6 @@ main(int argc, char **argv) close_door(); delete_doorfiles(); return (0); - break; case SIGUSR1: /* secret debug dump mode */ /* if in debug mode, use stdout */ diff --git a/usr/src/cmd/zfs/zfs_main.c b/usr/src/cmd/zfs/zfs_main.c index bafbfc22a9..1fa16f0574 100644 --- a/usr/src/cmd/zfs/zfs_main.c +++ b/usr/src/cmd/zfs/zfs_main.c @@ -23,6 +23,7 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2012 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2011 by Delphix. All rights reserved. + * Copyright 2012 Milan Jurik. All rights reserved. */ #include <assert.h> @@ -742,7 +743,6 @@ zfs_do_create(int argc, char **argv) (void) fprintf(stderr, gettext("missing size " "argument\n")); goto badusage; - break; case '?': (void) fprintf(stderr, gettext("invalid option '%c'\n"), optopt); diff --git a/usr/src/lib/auditd_plugins/syslog/systoken.c b/usr/src/lib/auditd_plugins/syslog/systoken.c index d068514675..7df46acf03 100644 --- a/usr/src/lib/auditd_plugins/syslog/systoken.c +++ b/usr/src/lib/auditd_plugins/syslog/systoken.c @@ -21,6 +21,7 @@ /* * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2012 Milan Jurik. All rights reserved. */ @@ -245,7 +246,6 @@ arbitrary_data_token(parse_context_t *ctx) break; default: return (-1); - break; } return (0); } diff --git a/usr/src/lib/libc/amd64/unwind/call_frame_inst.c b/usr/src/lib/libc/amd64/unwind/call_frame_inst.c index f803556066..82d357fb0c 100644 --- a/usr/src/lib/libc/amd64/unwind/call_frame_inst.c +++ b/usr/src/lib/libc/amd64/unwind/call_frame_inst.c @@ -22,10 +22,9 @@ /* * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2012 Milan Jurik. All rights reserved. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * interface used by unwind support to query frame descriptor info */ @@ -373,10 +372,8 @@ _Unw_get_val(void **datap, ptrdiff_t reloc, break; case ULEB128_FAC: return (daf * extractuleb(datap)); - break; case ULEB128: return (extractuleb(datap)); - break; case ULEB128_SREG: res = (uint64_t)(*((uint8_t *)data)); data += 1; @@ -449,10 +446,8 @@ _Unw_get_val(void **datap, ptrdiff_t reloc, break; case SLEB128_FAC: return (daf * extractsleb(datap)); - break; case SLEB128: return (extractsleb(datap)); - break; case ZTSTRING: /* max length of augmentation string is 4 */ rp = (char *)&res; @@ -463,7 +458,6 @@ _Unw_get_val(void **datap, ptrdiff_t reloc, break; case ADDR: return (get_encoded_val(datap, reloc, enc)); - break; case SIZE: return (get_encoded_val(datap, reloc, enc & 0x7)); case BLOCK: diff --git a/usr/src/lib/libc/amd64/unwind/unwind.c b/usr/src/lib/libc/amd64/unwind/unwind.c index 788d7b2d68..064e241df3 100644 --- a/usr/src/lib/libc/amd64/unwind/unwind.c +++ b/usr/src/lib/libc/amd64/unwind/unwind.c @@ -22,10 +22,9 @@ /* * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2012 Milan Jurik. All rights reserved. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * UNWIND - Unwind library */ @@ -313,7 +312,6 @@ _Unwind_RaiseException_Body(struct _Unwind_Exception *exception_object, break; default: return (res); - break; } } else { finish_capture(entry_ctx, 1); @@ -419,7 +417,6 @@ _Unwind_ForcedUnwind_Body(struct _Unwind_Exception *exception_object, exception_object->exception_class, exception_object, ctx, stop_parameter); return (_URC_END_OF_STACK); - break; default: again = 0; break; diff --git a/usr/src/lib/libc/port/locale/engine.c b/usr/src/lib/libc/port/locale/engine.c index b189ba6bc5..9d9f33cd3f 100644 --- a/usr/src/lib/libc/port/locale/engine.c +++ b/usr/src/lib/libc/port/locale/engine.c @@ -1,5 +1,6 @@ /* * Copyright 2010 Nexenta Systems, Inc. All rights reserved. + * Copyright 2012 Milan Jurik. All rights reserved. * Copyright (c) 1992, 1993, 1994 Henry Spencer. * Copyright (c) 1992, 1993, 1994 * The Regents of the University of California. All rights reserved. @@ -607,18 +608,14 @@ backref(struct match *m, const char *start, const char *stop, sopno startst, (m->g->cflags®_NEWLINE))) { break; } - else - return (NULL); - break; + return (NULL); case OEOL: if ((sp == m->endp && !(m->eflags®_NOTEOL)) || (sp < m->endp && *sp == '\n' && (m->g->cflags®_NEWLINE))) { break; } - else - return (NULL); - break; + return (NULL); case OBOW: if (((sp == m->beginp && !(m->eflags®_NOTBOL)) || (sp < m->endp && *(sp-1) == '\n' && @@ -626,9 +623,8 @@ backref(struct match *m, const char *start, const char *stop, sopno startst, (sp > m->beginp && !ISWORD(*(sp-1)))) && (sp < m->endp && ISWORD(*sp))) { break; - } else - return (NULL); - break; + } + return (NULL); case OEOW: if (((sp == m->endp && !(m->eflags®_NOTEOL)) || (sp < m->endp && *sp == '\n' && @@ -636,9 +632,8 @@ backref(struct match *m, const char *start, const char *stop, sopno startst, (sp < m->endp && !ISWORD(*sp))) && (sp > m->beginp && ISWORD(*(sp-1)))) { break; - } else - return (NULL); - break; + } + return (NULL); case O_QUEST: break; case OOR1: /* matches null but needs to skip */ @@ -683,19 +678,16 @@ backref(struct match *m, const char *start, const char *stop, sopno startst, while (m->g->strip[ss] != SOP(O_BACK, i)) ss++; return (backref(m, sp+len, stop, ss+1, stopst, lev, rec)); - break; case OQUEST_: /* to null or not */ dp = backref(m, sp, stop, ss+1, stopst, lev, rec); if (dp != NULL) return (dp); /* not */ return (backref(m, sp, stop, ss+OPND(s)+1, stopst, lev, rec)); - break; case OPLUS_: assert(m->lastpos != NULL); assert(lev+1 <= m->g->nplus); m->lastpos[lev+1] = sp; return (backref(m, sp, stop, ss+1, stopst, lev+1, rec)); - break; case O_PLUS: if (sp == m->lastpos[lev]) /* last pass matched null */ return (backref(m, sp, stop, ss+1, stopst, lev-1, rec)); @@ -704,9 +696,7 @@ backref(struct match *m, const char *start, const char *stop, sopno startst, dp = backref(m, sp, stop, ss-OPND(s)+1, stopst, lev, rec); if (dp == NULL) return (backref(m, sp, stop, ss+1, stopst, lev-1, rec)); - else - return (dp); - break; + return (dp); case OCH_: /* find the right one, if any */ ssub = ss + 1; esub = ss + OPND(s) - 1; @@ -727,6 +717,7 @@ backref(struct match *m, const char *start, const char *stop, sopno startst, else assert(OP(m->g->strip[esub]) == O_CH); } + /* NOTREACHED */ break; case OLPAREN: /* must undo assignment if rest fails */ i = OPND(s); @@ -738,7 +729,6 @@ backref(struct match *m, const char *start, const char *stop, sopno startst, return (dp); m->pmatch[i].rm_so = offsave; return (NULL); - break; case ORPAREN: /* must undo assignment if rest fails */ i = OPND(s); assert(0 < i && i <= m->g->nsub); @@ -749,7 +739,6 @@ backref(struct match *m, const char *start, const char *stop, sopno startst, return (dp); m->pmatch[i].rm_eo = offsave; return (NULL); - break; default: /* uh oh */ assert(0); break; diff --git a/usr/src/lib/libc/port/locale/regcomp.c b/usr/src/lib/libc/port/locale/regcomp.c index 33ca5511e4..f67e5cadf7 100644 --- a/usr/src/lib/libc/port/locale/regcomp.c +++ b/usr/src/lib/libc/port/locale/regcomp.c @@ -1,5 +1,6 @@ /* * Copyright 2010 Nexenta Systems, Inc. All rights reserved. + * Copyright 2012 Milan Jurik. All rights reserved. * Copyright (c) 1992, 1993, 1994 Henry Spencer. * Copyright (c) 1992, 1993, 1994 * The Regents of the University of California. All rights reserved. @@ -733,7 +734,6 @@ p_b_term(struct parse *p, cset *cs) case '-': SETERROR(REG_ERANGE); return; /* NOTE RETURN */ - break; default: c = '\0'; break; diff --git a/usr/src/lib/libcmdutils/common/process_xattrs.c b/usr/src/lib/libcmdutils/common/process_xattrs.c index dc37d586a8..1264d467bd 100644 --- a/usr/src/lib/libcmdutils/common/process_xattrs.c +++ b/usr/src/lib/libcmdutils/common/process_xattrs.c @@ -22,10 +22,9 @@ /* * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2012 Milan Jurik. All rights reserved. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "libcmdutils.h" @@ -318,7 +317,6 @@ sysattr_list(char *cmd, int fd, char *fname) case DATA_TYPE_NVLIST: default: return (response); - break; } } if (response != NULL) diff --git a/usr/src/lib/libcryptoutil/common/mechkeygen.c b/usr/src/lib/libcryptoutil/common/mechkeygen.c index 586b913510..48e9ad1ffc 100644 --- a/usr/src/lib/libcryptoutil/common/mechkeygen.c +++ b/usr/src/lib/libcryptoutil/common/mechkeygen.c @@ -21,10 +21,9 @@ /* * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2012 Milan Jurik. All rights reserved. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <cryptoutil.h> /* @@ -355,7 +354,6 @@ pkcs11_mech2keygen(CK_MECHANISM_TYPE mech_type, CK_MECHANISM_TYPE *gen_mech) default: return (CKR_MECHANISM_INVALID); - break; } return (CKR_OK); diff --git a/usr/src/lib/libcryptoutil/common/pkcserror.c b/usr/src/lib/libcryptoutil/common/pkcserror.c index e829a2db1b..4215330967 100644 --- a/usr/src/lib/libcryptoutil/common/pkcserror.c +++ b/usr/src/lib/libcryptoutil/common/pkcserror.c @@ -22,10 +22,9 @@ /* * Copyright 2004 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2012 Milan Jurik. All rights reserved. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * Block comment which describes the contents of this file. */ @@ -46,264 +45,178 @@ pkcs11_strerror(CK_RV rv) switch (rv) { case CKR_OK: return ("CKR_OK"); - break; case CKR_CANCEL: return ("CKR_CANCEL"); - break; case CKR_HOST_MEMORY: return ("CKR_HOST_MEMORY"); - break; case CKR_SLOT_ID_INVALID: return ("CKR_SLOT_ID_INVALID"); - break; case CKR_GENERAL_ERROR: return ("CKR_GENERAL_ERROR"); - break; case CKR_FUNCTION_FAILED: return ("CKR_FUNCTION_FAILED"); - break; case CKR_ARGUMENTS_BAD: return ("CKR_ARGUMENTS_BAD"); - break; case CKR_NO_EVENT: return ("CKR_NO_EVENT"); - break; case CKR_NEED_TO_CREATE_THREADS: return ("CKR_NEED_TO_CREATE_THREADS"); - break; case CKR_CANT_LOCK: return ("CKR_CANT_LOCK"); - break; case CKR_ATTRIBUTE_READ_ONLY: return ("CKR_ATTRIBUTE_READ_ONLY"); - break; case CKR_ATTRIBUTE_SENSITIVE: return ("CKR_ATTRIBUTE_SENSITIVE"); - break; case CKR_ATTRIBUTE_TYPE_INVALID: return ("CKR_ATTRIBUTE_TYPE_INVALID"); - break; case CKR_ATTRIBUTE_VALUE_INVALID: return ("CKR_ATTRIBUTE_VALUE_INVALID"); - break; case CKR_DATA_INVALID: return ("CKR_DATA_INVALID"); - break; case CKR_DATA_LEN_RANGE: return ("CKR_DATA_LEN_RANGE"); - break; case CKR_DEVICE_ERROR: return ("CKR_DEVICE_ERROR"); - break; case CKR_DEVICE_MEMORY: return ("CKR_DEVICE_MEMORY"); - break; case CKR_DEVICE_REMOVED: return ("CKR_DEVICE_REMOVED"); - break; case CKR_ENCRYPTED_DATA_INVALID: return ("CKR_ENCRYPTED_DATA_INVALID"); - break; case CKR_ENCRYPTED_DATA_LEN_RANGE: return ("CKR_ENCRYPTED_DATA_LEN_RANGE"); - break; case CKR_FUNCTION_CANCELED: return ("CKR_FUNCTION_CANCELED"); - break; case CKR_FUNCTION_NOT_PARALLEL: return ("CKR_FUNCTION_NOT_PARALLEL"); - break; case CKR_FUNCTION_NOT_SUPPORTED: return ("CKR_FUNCTION_NOT_SUPPORTED"); - break; case CKR_KEY_HANDLE_INVALID: return ("CKR_KEY_HANDLE_INVALID"); - break; case CKR_KEY_SIZE_RANGE: return ("CKR_KEY_SIZE_RANGE"); - break; case CKR_KEY_TYPE_INCONSISTENT: return ("CKR_KEY_TYPE_INCONSISTENT"); - break; case CKR_KEY_NOT_NEEDED: return ("CKR_KEY_NOT_NEEDED"); - break; case CKR_KEY_CHANGED: return ("CKR_KEY_CHANGED"); - break; case CKR_KEY_NEEDED: return ("CKR_KEY_NEEDED"); - break; case CKR_KEY_INDIGESTIBLE: return ("CKR_KEY_INDIGESTIBLE"); - break; case CKR_KEY_FUNCTION_NOT_PERMITTED: return ("CKR_KEY_FUNCTION_NOT_PERMITTED"); - break; case CKR_KEY_NOT_WRAPPABLE: return ("CKR_KEY_NOT_WRAPPABLE"); - break; case CKR_KEY_UNEXTRACTABLE: return ("CKR_KEY_UNEXTRACTABLE"); - break; case CKR_MECHANISM_INVALID: return ("CKR_MECHANISM_INVALID"); - break; case CKR_MECHANISM_PARAM_INVALID: return ("CKR_MECHANISM_PARAM_INVALID"); - break; case CKR_OBJECT_HANDLE_INVALID: return ("CKR_OBJECT_HANDLE_INVALID"); - break; case CKR_OPERATION_ACTIVE: return ("CKR_OPERATION_ACTIVE"); - break; case CKR_OPERATION_NOT_INITIALIZED: return ("CKR_OPERATION_NOT_INITIALIZED"); - break; case CKR_PIN_INCORRECT: return ("CKR_PIN_INCORRECT"); - break; case CKR_PIN_INVALID: return ("CKR_PIN_INVALID"); - break; case CKR_PIN_LEN_RANGE: return ("CKR_PIN_LEN_RANGE"); - break; case CKR_PIN_EXPIRED: return ("CKR_PIN_EXPIRED"); - break; case CKR_PIN_LOCKED: return ("CKR_PIN_LOCKED"); - break; case CKR_SESSION_CLOSED: return ("CKR_SESSION_CLOSED"); - break; case CKR_SESSION_COUNT: return ("CKR_SESSION_COUNT"); - break; case CKR_SESSION_HANDLE_INVALID: return ("CKR_SESSION_HANDLE_INVALID"); - break; case CKR_SESSION_PARALLEL_NOT_SUPPORTED: return ("CKR_SESSION_PARALLEL_NOT_SUPPORTED"); - break; case CKR_SESSION_READ_ONLY: return ("CKR_SESSION_READ_ONLY"); - break; case CKR_SESSION_EXISTS: return ("CKR_SESSION_EXISTS"); - break; case CKR_SESSION_READ_ONLY_EXISTS: return ("CKR_SESSION_READ_ONLY_EXISTS"); - break; case CKR_SESSION_READ_WRITE_SO_EXISTS: return ("CKR_SESSION_READ_WRITE_SO_EXISTS"); - break; case CKR_SIGNATURE_INVALID: return ("CKR_SIGNATURE_INVALID"); - break; case CKR_SIGNATURE_LEN_RANGE: return ("CKR_SIGNATURE_LEN_RANGE"); - break; case CKR_TEMPLATE_INCOMPLETE: return ("CKR_TEMPLATE_INCOMPLETE"); - break; case CKR_TEMPLATE_INCONSISTENT: return ("CKR_TEMPLATE_INCONSISTENT"); - break; case CKR_TOKEN_NOT_PRESENT: return ("CKR_TOKEN_NOT_PRESENT"); - break; case CKR_TOKEN_NOT_RECOGNIZED: return ("CKR_TOKEN_NOT_RECOGNIZED"); - break; case CKR_TOKEN_WRITE_PROTECTED: return ("CKR_TOKEN_WRITE_PROTECTED"); - break; case CKR_UNWRAPPING_KEY_HANDLE_INVALID: return ("CKR_UNWRAPPING_KEY_HANDLE_INVALID"); - break; case CKR_UNWRAPPING_KEY_SIZE_RANGE: return ("CKR_UNWRAPPING_KEY_SIZE_RANGE"); - break; case CKR_UNWRAPPING_KEY_TYPE_INCONSISTENT: return ("CKR_UNWRAPPING_KEY_TYPE_INCONSISTENT"); - break; case CKR_USER_ALREADY_LOGGED_IN: return ("CKR_USER_ALREADY_LOGGED_IN"); - break; case CKR_USER_NOT_LOGGED_IN: return ("CKR_USER_NOT_LOGGED_IN"); - break; case CKR_USER_PIN_NOT_INITIALIZED: return ("CKR_USER_PIN_NOT_INITIALIZED"); - break; case CKR_USER_TYPE_INVALID: return ("CKR_USER_TYPE_INVALID"); - break; case CKR_USER_ANOTHER_ALREADY_LOGGED_IN: return ("CKR_USER_ANOTHER_ALREADY_LOGGED_IN"); - break; case CKR_USER_TOO_MANY_TYPES: return ("CKR_USER_TOO_MANY_TYPES"); - break; case CKR_WRAPPED_KEY_INVALID: return ("CKR_WRAPPED_KEY_INVALID"); - break; case CKR_WRAPPED_KEY_LEN_RANGE: return ("CKR_WRAPPED_KEY_LEN_RANGE"); - break; case CKR_WRAPPING_KEY_HANDLE_INVALID: return ("CKR_WRAPPING_KEY_HANDLE_INVALID"); - break; case CKR_WRAPPING_KEY_SIZE_RANGE: return ("CKR_WRAPPING_KEY_SIZE_RANGE"); - break; case CKR_WRAPPING_KEY_TYPE_INCONSISTENT: return ("CKR_WRAPPING_KEY_TYPE_INCONSISTENT"); - break; case CKR_RANDOM_SEED_NOT_SUPPORTED: return ("CKR_RANDOM_SEED_NOT_SUPPORTED"); - break; case CKR_RANDOM_NO_RNG: return ("CKR_RANDOM_NO_RNG"); - break; case CKR_DOMAIN_PARAMS_INVALID: return ("CKR_DOMAIN_PARAMS_INVALID"); - break; case CKR_BUFFER_TOO_SMALL: return ("CKR_BUFFER_TOO_SMALL"); - break; case CKR_SAVED_STATE_INVALID: return ("CKR_SAVED_STATE_INVALID"); - break; case CKR_INFORMATION_SENSITIVE: return ("CKR_INFORMATION_SENSITIVE"); - break; case CKR_STATE_UNSAVEABLE: return ("CKR_STATE_UNSAVEABLE"); - break; case CKR_CRYPTOKI_NOT_INITIALIZED: return ("CKR_CRYPTOKI_NOT_INITIALIZED"); - break; case CKR_CRYPTOKI_ALREADY_INITIALIZED: return ("CKR_CRYPTOKI_ALREADY_INITIALIZED"); - break; case CKR_MUTEX_BAD: return ("CKR_MUTEX_BAD"); - break; case CKR_MUTEX_NOT_LOCKED: return ("CKR_MUTEX_NOT_LOCKED"); - break; case CKR_VENDOR_DEFINED: return ("CKR_VENDOR_DEFINED"); - break; default: /* rv not found */ (void) snprintf(errstr, sizeof (errstr), "Unknown return code: 0x%lx", rv); return (errstr); - break; } } diff --git a/usr/src/lib/libipsecutil/common/ipsec_util.c b/usr/src/lib/libipsecutil/common/ipsec_util.c index c9db65858b..e5f8f16d81 100644 --- a/usr/src/lib/libipsecutil/common/ipsec_util.c +++ b/usr/src/lib/libipsecutil/common/ipsec_util.c @@ -22,6 +22,7 @@ /* * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2012 Milan Juri. All rights reserved. */ #include <unistd.h> @@ -3389,7 +3390,6 @@ ipsecutil_exit(exit_type_t type, char *fmri, FILE *fp, const char *fmt, ...) break; case SERVICE_DEGRADE: return; - break; case SERVICE_BADPERM: case SERVICE_BADCONF: case SERVICE_MAINTAIN: @@ -3411,7 +3411,6 @@ ipsecutil_exit(exit_type_t type, char *fmri, FILE *fp, const char *fmt, ...) case DEBUG_FATAL: /* Keep running, don't exit(). */ return; - break; case SERVICE_BADPERM: warnxfp(fp, dgettext(TEXT_DOMAIN, "Permission error with %s."), fmri); diff --git a/usr/src/lib/libndmp/common/libndmp_prop.c b/usr/src/lib/libndmp/common/libndmp_prop.c index 523de41ed8..210cfc12f8 100644 --- a/usr/src/lib/libndmp/common/libndmp_prop.c +++ b/usr/src/lib/libndmp/common/libndmp_prop.c @@ -1,6 +1,7 @@ /* * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2012 Milan Jurik. All rights reserved. */ /* @@ -330,11 +331,9 @@ ndmp_smf_create_service_pgroup(ndmp_scfhandle_t *handle, char *pgroup) case SCF_ERROR_PERMISSION_DENIED: ndmp_errno = ENDMP_SMF_PERM; return (-1); - break; default: ndmp_errno = ENDMP_SMF_INTERNAL; return (-1); - break; } } } diff --git a/usr/src/lib/libnwam/common/libnwam_values.c b/usr/src/lib/libnwam/common/libnwam_values.c index 7f4b3365fe..6c9d08a3ce 100644 --- a/usr/src/lib/libnwam/common/libnwam_values.c +++ b/usr/src/lib/libnwam/common/libnwam_values.c @@ -21,6 +21,7 @@ /* * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012 Milan Jurik. All rights reserved. */ #include <assert.h> @@ -905,7 +906,6 @@ nwam_condition_to_condition_string(nwam_condition_object_type_t object_type, break; default: return (NWAM_INVALID_ARG); - break; } if ((string = malloc(NWAM_MAX_VALUE_LEN)) == NULL) return (NWAM_NO_MEMORY); diff --git a/usr/src/lib/libpool/common/pool_kernel.c b/usr/src/lib/libpool/common/pool_kernel.c index eeab60f312..2e1375e499 100644 --- a/usr/src/lib/libpool/common/pool_kernel.c +++ b/usr/src/lib/libpool/common/pool_kernel.c @@ -22,6 +22,7 @@ /* * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2012 Milan Jurik. All rights reserved. */ #include <assert.h> @@ -2907,7 +2908,6 @@ log_item_commit(log_item_t *li) li->li_state = LS_UNDO; pool_seterror(POE_BADPARAM); return (PO_FAIL); - break; case POOL_XTRANSFER: xtransfer = (pool_xtransfer_undo_t *)li->li_details; @@ -3062,7 +3062,6 @@ log_item_undo(log_item_t *li) case POOL_TRANSFER: pool_seterror(POE_BADPARAM); return (PO_FAIL); - break; case POOL_XTRANSFER: xtransfer = (pool_xtransfer_undo_t *)li->li_details; @@ -3285,7 +3284,6 @@ log_item_undo(log_item_t *li) li->li_state = LS_DO; pool_seterror(POE_BADPARAM); return (PO_FAIL); - break; case POOL_XTRANSFER: xtransfer = (pool_xtransfer_undo_t *)li->li_details; @@ -3452,7 +3450,6 @@ log_item_release(log_item_t *li) case POOL_TRANSFER: pool_seterror(POE_BADPARAM); return (PO_FAIL); - break; case POOL_XTRANSFER: xtransfer = (pool_xtransfer_undo_t *)li->li_details; diff --git a/usr/src/lib/libraidcfg/common/raidcfg.c b/usr/src/lib/libraidcfg/common/raidcfg.c index 74ed6f9018..59e8942dcd 100644 --- a/usr/src/lib/libraidcfg/common/raidcfg.c +++ b/usr/src/lib/libraidcfg/common/raidcfg.c @@ -22,6 +22,7 @@ /* * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2012 Milan Jurik. All rights reserved. */ #include <fcntl.h> @@ -775,7 +776,6 @@ raidcfg_get_attr(int handle, void *attr) (void) mutex_unlock(&raidcfg_mp); return (SUCCESS); } - break; default: (void) mutex_unlock(&raidcfg_mp); return (ERR_DEVICE_TYPE); @@ -1315,7 +1315,6 @@ raid_space_noalign(raid_obj_tab_t *raid_tab, uint32_t raid_level, int num, break; default: return (ERR_ARRAY_LEVEL); - break; } return (capacity); diff --git a/usr/src/lib/librstp/common/portinfo.c b/usr/src/lib/librstp/common/portinfo.c index 67af0b3320..e15168a711 100644 --- a/usr/src/lib/librstp/common/portinfo.c +++ b/usr/src/lib/librstp/common/portinfo.c @@ -458,7 +458,6 @@ Bool STP_info_check_conditions (STATE_MACH_T* this) break; case ENABLED: /* IEEE 802.1y, 17.21, Z.14 */ return STP_hop_2_state (this, AGED); - break; case AGED: if (port->selected && port->updtInfo) { return STP_hop_2_state (this, UPDATE); @@ -466,7 +465,6 @@ Bool STP_info_check_conditions (STATE_MACH_T* this) break; case UPDATE: return STP_hop_2_state (this, CURRENT); - break; case CURRENT: if (port->selected && port->updtInfo) { return STP_hop_2_state (this, UPDATE); @@ -493,16 +491,12 @@ Bool STP_info_check_conditions (STATE_MACH_T* this) default: return STP_hop_2_state (this, CURRENT); } - break; case SUPERIOR: return STP_hop_2_state (this, CURRENT); - break; case REPEAT: return STP_hop_2_state (this, CURRENT); - break; case AGREEMENT: return STP_hop_2_state (this, CURRENT); - break; } return False; diff --git a/usr/src/lib/libshare/common/parser.c b/usr/src/lib/libshare/common/parser.c index 50f98de5b6..d326c52b8e 100644 --- a/usr/src/lib/libshare/common/parser.c +++ b/usr/src/lib/libshare/common/parser.c @@ -22,6 +22,7 @@ /* * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2012 Milan Jurik. All rights reserved. */ #include <stdio.h> @@ -81,10 +82,8 @@ _sa_get_token(char *string) if (*curp) { curp++; break; - } else { - return (ret); } - break; + return (ret); default: if (*curp == '\0' || isspace(c)) { *curp++ = '\0'; diff --git a/usr/src/lib/libsldap/common/ns_standalone.c b/usr/src/lib/libsldap/common/ns_standalone.c index 9f1cec12d6..169efc9f3b 100644 --- a/usr/src/lib/libsldap/common/ns_standalone.c +++ b/usr/src/lib/libsldap/common/ns_standalone.c @@ -21,6 +21,7 @@ /* * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2012 Milan Jurik. All rights reserved. */ #define __STANDALONE_MODULE__ @@ -865,7 +866,6 @@ getDirBaseDN(LDAP *ld, const char *domain_name, char **dir_base_dn) } return (NS_LDAP_OP_FAILED); - break; } if ((ret_code = convert_to_door_line(ld, @@ -1010,7 +1010,6 @@ getDUAProfile(LDAP *ld, } return (NS_LDAP_OP_FAILED); - break; } ret_code = convert_to_door_line(ld, @@ -1805,16 +1804,13 @@ createDirServerList(dir_server_list_t **new_list, (*new_list)->nsServers[i]->status = INFO_SERVER_ERROR; continue; - break; case ENOMEM: (*new_list)->nsServers[i]->status = INFO_SERVER_ERROR; continue; - break; default: thrPool[i] = thrID; continue; - break; } } @@ -2437,7 +2433,6 @@ __ns_ldap_pingOfflineServers(void) case EAGAIN: current_list->nsServers[i]->status = INFO_SERVER_ERROR; continue; - break; case ENOMEM: current_list->nsServers[i]->status = INFO_SERVER_ERROR; retCode = NS_LDAP_MEMORY; @@ -2445,7 +2440,6 @@ __ns_ldap_pingOfflineServers(void) default: thrPool[i] = thrID; continue; - break; } /* A memory allocation error has occured */ break; diff --git a/usr/src/lib/libsldap/common/ns_writes.c b/usr/src/lib/libsldap/common/ns_writes.c index 9505280c5c..44f4570f38 100644 --- a/usr/src/lib/libsldap/common/ns_writes.c +++ b/usr/src/lib/libsldap/common/ns_writes.c @@ -21,6 +21,7 @@ /* * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012 Milan Jurik. All rights reserved. */ #include <stdio.h> @@ -4142,7 +4143,6 @@ send_to_cachemgr( MKERROR(LOG_WARNING, *errorp, NS_CONFIG_CACHEMGR, strdup(errstr), NULL); return (NS_LDAP_OP_FAILED); - break; default: return (NS_LDAP_OP_FAILED); } diff --git a/usr/src/lib/libstmf/common/stmf.c b/usr/src/lib/libstmf/common/stmf.c index 39cebf6f05..e12c189926 100644 --- a/usr/src/lib/libstmf/common/stmf.c +++ b/usr/src/lib/libstmf/common/stmf.c @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012 Milan Jurik. All rights reserved. */ #include <stdlib.h> @@ -1823,10 +1824,8 @@ validateModifyDiskProp(uint32_t prop) case STMF_LU_PROP_WRITE_PROTECT: case STMF_LU_PROP_WRITE_CACHE_DISABLE: return (STMF_STATUS_SUCCESS); - break; default: return (STMF_STATUS_ERROR); - break; } } @@ -2545,7 +2544,6 @@ setDiskGlobalProp(uint32_t resourceProp, const char *propVal) break; default: return (STMF_ERROR_INVALID_PROP); - break; } /* diff --git a/usr/src/lib/libuuid/common/uuid.c b/usr/src/lib/libuuid/common/uuid.c index 07670499e7..8c5171e2f3 100644 --- a/usr/src/lib/libuuid/common/uuid.c +++ b/usr/src/lib/libuuid/common/uuid.c @@ -21,6 +21,7 @@ /* * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2012 Milan Jurik. All rights reserved. */ /* @@ -143,7 +144,6 @@ uuid_create(struct uuid *uuid) break; case ENOTRECOVERABLE: return (ret); - break; } } diff --git a/usr/src/lib/pkcs11/libpkcs11/common/metaAttrManager.c b/usr/src/lib/pkcs11/libpkcs11/common/metaAttrManager.c index 6b066036e6..76fae97a64 100644 --- a/usr/src/lib/pkcs11/libpkcs11/common/metaAttrManager.c +++ b/usr/src/lib/pkcs11/libpkcs11/common/metaAttrManager.c @@ -21,10 +21,9 @@ /* * Copyright 2007 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2012 Milan Jurik. All rights reserved. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <string.h> #include <stdlib.h> #include <strings.h> @@ -79,7 +78,6 @@ get_master_attributes_by_object(slot_session_t *session, break; case CKO_DATA: goto get_attr; - break; default: /* should never be here */ return (CKR_ATTRIBUTE_VALUE_INVALID); @@ -148,7 +146,7 @@ get_master_attributes_by_template( } return (get_master_attributes_by_type(class, subtype, - attributes, num_attributes)); + attributes, num_attributes)); } /* @@ -166,125 +164,125 @@ get_master_template_by_type(CK_OBJECT_CLASS class, CK_ULONG subtype, size_t master_template_size = 0; switch (class) { - case CKO_HW_FEATURE: + case CKO_HW_FEATURE: switch (subtype) { - case CKO_HW_FEATURE: + case CKO_HW_FEATURE: master_template = (generic_attr_t *)OBJ_HW_CLOCK; master_template_size = sizeof (OBJ_HW_CLOCK); break; - case CKH_MONOTONIC_COUNTER: + case CKH_MONOTONIC_COUNTER: master_template = (generic_attr_t *)OBJ_HW_MONOTONIC; master_template_size = sizeof (OBJ_HW_MONOTONIC); break; - default: + default: /* Unsupported. */ break; } break; - case CKO_DATA: + case CKO_DATA: /* Objects of this class have no subtype. */ master_template = (generic_attr_t *)OBJ_DATA; master_template_size = sizeof (OBJ_DATA); break; - case CKO_CERTIFICATE: + case CKO_CERTIFICATE: switch (subtype) { - case CKC_X_509: + case CKC_X_509: master_template = (generic_attr_t *)OBJ_CERT_X509; master_template_size = sizeof (OBJ_CERT_X509); break; - case CKC_X_509_ATTR_CERT: + case CKC_X_509_ATTR_CERT: master_template = (generic_attr_t *)OBJ_CERT_X509ATTR; master_template_size = sizeof (OBJ_CERT_X509ATTR); break; - default: + default: /* Unsupported. */ break; } break; - case CKO_PUBLIC_KEY: + case CKO_PUBLIC_KEY: switch (subtype) { - case CKK_RSA: + case CKK_RSA: master_template = (generic_attr_t *)OBJ_PUBKEY_RSA; master_template_size = sizeof (OBJ_PUBKEY_RSA); break; - case CKK_DSA: + case CKK_DSA: master_template = (generic_attr_t *)OBJ_PUBKEY_DSA; master_template_size = sizeof (OBJ_PUBKEY_DSA); break; - case CKK_EC: + case CKK_EC: master_template = (generic_attr_t *)OBJ_PUBKEY_EC; master_template_size = sizeof (OBJ_PUBKEY_EC); break; - case CKK_DH: + case CKK_DH: master_template = (generic_attr_t *)OBJ_PUBKEY_DH; master_template_size = sizeof (OBJ_PUBKEY_DH); break; - case CKK_X9_42_DH: + case CKK_X9_42_DH: master_template = (generic_attr_t *)OBJ_PUBKEY_X942DH; master_template_size = sizeof (OBJ_PUBKEY_X942DH); break; - case CKK_KEA: + case CKK_KEA: master_template = (generic_attr_t *)OBJ_PUBKEY_KEA; master_template_size = sizeof (OBJ_PUBKEY_KEA); break; - default: + default: /* Unsupported. */ break; } break; - case CKO_PRIVATE_KEY: + case CKO_PRIVATE_KEY: switch (subtype) { - case CKK_RSA: + case CKK_RSA: master_template = (generic_attr_t *)OBJ_PRIVKEY_RSA; master_template_size = sizeof (OBJ_PRIVKEY_RSA); break; - case CKK_DSA: + case CKK_DSA: master_template = (generic_attr_t *)OBJ_PRIVKEY_DSA; master_template_size = sizeof (OBJ_PRIVKEY_DSA); break; - case CKK_EC: + case CKK_EC: master_template = (generic_attr_t *)OBJ_PRIVKEY_EC; master_template_size = sizeof (OBJ_PRIVKEY_EC); break; - case CKK_DH: + case CKK_DH: master_template = (generic_attr_t *)OBJ_PRIVKEY_DH; master_template_size = sizeof (OBJ_PRIVKEY_DH); break; - case CKK_X9_42_DH: + case CKK_X9_42_DH: master_template = (generic_attr_t *)OBJ_PRIVKEY_X942DH; master_template_size = sizeof (OBJ_PRIVKEY_X942DH); break; - case CKK_KEA: + case CKK_KEA: master_template = (generic_attr_t *)OBJ_PRIVKEY_KEA; master_template_size = sizeof (OBJ_PRIVKEY_KEA); break; - default: + default: /* Unsupported. */ break; } break; - case CKO_SECRET_KEY: + case CKO_SECRET_KEY: /* * The only difference between secret keys is that some * are valiable length (eg CKK_AES), while others are not @@ -302,61 +300,61 @@ get_master_template_by_type(CK_OBJECT_CLASS class, CK_ULONG subtype, * */ switch (subtype) { - case CKK_DES: - case CKK_DES2: - case CKK_DES3: - case CKK_IDEA: - case CKK_CDMF: - case CKK_SKIPJACK: - case CKK_BATON: - case CKK_JUNIPER: + case CKK_DES: + case CKK_DES2: + case CKK_DES3: + case CKK_IDEA: + case CKK_CDMF: + case CKK_SKIPJACK: + case CKK_BATON: + case CKK_JUNIPER: master_template = (generic_attr_t *)OBJ_SECKEY; master_template_size = sizeof (OBJ_SECKEY); break; - case CKK_GENERIC_SECRET: - case CKK_RC2: - case CKK_RC4: - case CKK_RC5: - case CKK_AES: - case CKK_BLOWFISH: - case CKK_CAST: - case CKK_CAST3: - case CKK_CAST128: + case CKK_GENERIC_SECRET: + case CKK_RC2: + case CKK_RC4: + case CKK_RC5: + case CKK_AES: + case CKK_BLOWFISH: + case CKK_CAST: + case CKK_CAST3: + case CKK_CAST128: master_template = (generic_attr_t *)OBJ_SECKEY_WITHLEN; master_template_size = sizeof (OBJ_SECKEY_WITHLEN); break; - default: + default: /* Unsupported. */ break; } break; - case CKO_DOMAIN_PARAMETERS: + case CKO_DOMAIN_PARAMETERS: switch (subtype) { - case CKK_DSA: + case CKK_DSA: master_template = (generic_attr_t *)OBJ_DOM_DSA; master_template_size = sizeof (OBJ_DOM_DSA); break; - case CKK_DH: + case CKK_DH: master_template = (generic_attr_t *)OBJ_DOM_DH; master_template_size = sizeof (OBJ_DOM_DH); break; - case CKK_X9_42_DH: + case CKK_X9_42_DH: master_template = (generic_attr_t *)OBJ_DOM_X942DH; master_template_size = sizeof (OBJ_DOM_X942DH); break; - default: + default: /* Unsupported. */ break; } break; - default: + default: /* Unsupported. */ break; } @@ -390,7 +388,7 @@ get_master_attributes_by_type(CK_OBJECT_CLASS class, CK_ULONG subtype, /* Determine the appropriate master template needed. */ rv = get_master_template_by_type(class, subtype, - &master_template, &master_template_size); + &master_template, &master_template_size); if (rv != CKR_OK) return (rv); @@ -465,7 +463,7 @@ get_master_attributes_by_duplication( if (src->isMalloced) { dst->attribute.pValue = - malloc(src->attribute.ulValueLen); + malloc(src->attribute.ulValueLen); if (dst->attribute.pValue == NULL) { /* @@ -492,7 +490,7 @@ get_master_attributes_by_duplication( } (void) memcpy(dst->attribute.pValue, src->attribute.pValue, - src->attribute.ulValueLen); + src->attribute.ulValueLen); } if (rv != CKR_OK) { @@ -566,7 +564,7 @@ attribute_set_value(CK_ATTRIBUTE *new_attr, /* bzero() out any data that won't be overwritten. */ bzero((char *)attr->attribute.pValue + new_attr->ulValueLen, - attr->attribute.ulValueLen - new_attr->ulValueLen); + attr->attribute.ulValueLen - new_attr->ulValueLen); } else if (new_attr->ulValueLen <= sizeof (attr->generic_data)) { /* Use generic storage to avoid a malloc. */ @@ -602,7 +600,7 @@ attribute_set_value(CK_ATTRIBUTE *new_attr, } (void) memcpy(attr->attribute.pValue, new_attr->pValue, - new_attr->ulValueLen); + new_attr->ulValueLen); attr->attribute.ulValueLen = new_attr->ulValueLen; attr->hasValueForClone = B_TRUE; diff --git a/usr/src/lib/pkcs11/pkcs11_kernel/common/kernelAttributeUtil.c b/usr/src/lib/pkcs11/pkcs11_kernel/common/kernelAttributeUtil.c index c53b09a00d..73dd9e0949 100644 --- a/usr/src/lib/pkcs11/pkcs11_kernel/common/kernelAttributeUtil.c +++ b/usr/src/lib/pkcs11/pkcs11_kernel/common/kernelAttributeUtil.c @@ -21,6 +21,7 @@ /* * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2012 Milan Jurik. All rights reserved. */ #include <stdlib.h> @@ -2243,7 +2244,6 @@ kernel_get_common_attrs(kernel_object_t *object_p, CK_ATTRIBUTE_PTR template) case CKA_LABEL: return (get_extra_attr_from_object(object_p, template)); - break; default: /* diff --git a/usr/src/lib/pkcs11/pkcs11_kms/common/kmsAttributeUtil.c b/usr/src/lib/pkcs11/pkcs11_kms/common/kmsAttributeUtil.c index 69d62bec2b..9a50d5f084 100644 --- a/usr/src/lib/pkcs11/pkcs11_kms/common/kmsAttributeUtil.c +++ b/usr/src/lib/pkcs11/pkcs11_kms/common/kmsAttributeUtil.c @@ -19,6 +19,7 @@ * CDDL HEADER END * * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012 Milan Jurik. All rights reserved. */ #include <stdlib.h> #include <string.h> @@ -976,7 +977,6 @@ kms_get_common_attrs(kms_object_t *object_p, CK_ATTRIBUTE_PTR template) case CKA_LABEL: return (get_extra_attr_from_object(object_p, template)); - break; default: /* diff --git a/usr/src/lib/pkcs11/pkcs11_kms/common/kmsKeys.c b/usr/src/lib/pkcs11/pkcs11_kms/common/kmsKeys.c index 80d34542aa..c0edc35898 100644 --- a/usr/src/lib/pkcs11/pkcs11_kms/common/kmsKeys.c +++ b/usr/src/lib/pkcs11/pkcs11_kms/common/kmsKeys.c @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012 Milan Jurik. All rights reserved. */ #include <strings.h> @@ -78,7 +79,6 @@ C_GenerateKey(CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR pMechanism, default: rv = CKR_MECHANISM_INVALID; goto failed_exit; - break; } /* Create an object record */ diff --git a/usr/src/lib/pkcs11/pkcs11_softtoken/common/softASN1.c b/usr/src/lib/pkcs11/pkcs11_softtoken/common/softASN1.c index 77f10e56d3..4e5f5ddca4 100644 --- a/usr/src/lib/pkcs11/pkcs11_softtoken/common/softASN1.c +++ b/usr/src/lib/pkcs11/pkcs11_softtoken/common/softASN1.c @@ -21,6 +21,7 @@ /* * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012 Milan Jurik. All rights reserved. */ #include <stdlib.h> @@ -941,8 +942,6 @@ soft_object_to_asn1(soft_object_t *objp, uchar_t *buf, ulong_t *buf_len) return (CKR_FUNCTION_NOT_SUPPORTED); } /* keytype */ - break; - default: return (CKR_FUNCTION_NOT_SUPPORTED); diff --git a/usr/src/lib/pkcs11/pkcs11_softtoken/common/softAttributeUtil.c b/usr/src/lib/pkcs11/pkcs11_softtoken/common/softAttributeUtil.c index d1829207d7..d6e77c8016 100644 --- a/usr/src/lib/pkcs11/pkcs11_softtoken/common/softAttributeUtil.c +++ b/usr/src/lib/pkcs11/pkcs11_softtoken/common/softAttributeUtil.c @@ -21,6 +21,7 @@ /* * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2012 Milan Jurik. All rights reserved. */ #include <stdlib.h> @@ -4568,7 +4569,6 @@ soft_get_certificate_attribute(soft_object_t *object_p, src.value = (CK_BYTE *)&certtype; src.length = sizeof (certtype); return (get_cert_attr_from_object(&src, template)); - break; case CKA_TRUSTED: return (get_bool_attr_from_object(object_p, TRUSTED_BOOL_ON, template)); @@ -4579,11 +4579,9 @@ soft_get_certificate_attribute(soft_object_t *object_p, case CKA_ATTR_TYPES: return (get_extra_attr_from_object(object_p, template)); - break; default: return (soft_get_common_attrs(object_p, template, object_p->object_type)); - break; } /* @@ -4615,7 +4613,6 @@ soft_set_certificate_attribute(soft_object_t *object_p, case CKA_VALUE: /* VALUE attr cannot be modified. */ return (CKR_ATTRIBUTE_READ_ONLY); - break; case CKA_ID: case CKA_ISSUER: if (certtype == CKC_X_509) { @@ -4634,11 +4631,9 @@ soft_set_certificate_attribute(soft_object_t *object_p, case CKA_LABEL: return (set_extra_attr_to_object(object_p, template->type, template)); - break; default: return (soft_set_common_storage_attribute( object_p, template, copy)); - break; } /* diff --git a/usr/src/lib/pkcs11/pkcs11_tpm/common/cert.c b/usr/src/lib/pkcs11/pkcs11_tpm/common/cert.c index 6a4f007cd0..77f24a42a3 100644 --- a/usr/src/lib/pkcs11/pkcs11_tpm/common/cert.c +++ b/usr/src/lib/pkcs11/pkcs11_tpm/common/cert.c @@ -289,6 +289,7 @@ /* * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2012 Milan Jurik. All rights reserved. */ #include "tpmtok_int.h" @@ -330,7 +331,6 @@ cert_validate_attribute(TEMPLATE *tmpl, CK_ATTRIBUTE *attr, CK_ULONG mode) switch (attr->type) { case CKA_CERTIFICATE_TYPE: - { if (mode != MODE_CREATE) { return (CKR_ATTRIBUTE_READ_ONLY); } @@ -340,11 +340,9 @@ cert_validate_attribute(TEMPLATE *tmpl, CK_ATTRIBUTE *attr, CK_ULONG mode) else { return (CKR_ATTRIBUTE_VALUE_INVALID); } - } - break; - default: - return (template_validate_base_attribute(tmpl, attr, mode)); + return ( + template_validate_base_attribute(tmpl, attr, mode)); } } diff --git a/usr/src/lib/pkcs11/pkcs11_tpm/common/tpm_specific.c b/usr/src/lib/pkcs11/pkcs11_tpm/common/tpm_specific.c index 6730dd5666..0b4f85d3bc 100644 --- a/usr/src/lib/pkcs11/pkcs11_tpm/common/tpm_specific.c +++ b/usr/src/lib/pkcs11/pkcs11_tpm/common/tpm_specific.c @@ -21,6 +21,7 @@ /* * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2012 Milan Jurik. All rights reserved. */ #include <pthread.h> @@ -440,13 +441,10 @@ util_get_keysize_flag(CK_ULONG size) switch (size) { case 512: return (TSS_KEY_SIZE_512); - break; case 1024: return (TSS_KEY_SIZE_1024); - break; case 2048: return (TSS_KEY_SIZE_2048); - break; default: break; } @@ -1275,7 +1273,6 @@ token_generate_leaf_key(TSS_HCONTEXT hContext, default: stlogit("Unknown key type 0x%0x", key_type); goto done; - break; } if (result = tss_generate_key(hContext, initFlags, passHash, diff --git a/usr/src/lib/smbsrv/libmlrpc/common/ndr_process.c b/usr/src/lib/smbsrv/libmlrpc/common/ndr_process.c index f7046700f3..945b02e699 100644 --- a/usr/src/lib/smbsrv/libmlrpc/common/ndr_process.c +++ b/usr/src/lib/smbsrv/libmlrpc/common/ndr_process.c @@ -21,6 +21,7 @@ /* * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2012 Milan Jurik. All rights reserved. */ /* @@ -619,7 +620,6 @@ ndr_outer(ndr_ref_t *outer_ref) return (ndr_outer_conformant_construct(outer_ref)); return (ndr_outer_fixed(outer_ref)); - break; case NDR_F_SIZE_IS: case NDR_F_DIMENSION_IS: @@ -634,7 +634,6 @@ ndr_outer(ndr_ref_t *outer_ref) return (ndr_outer_conformant_array(outer_ref)); else return (ndr_outer_fixed_array(outer_ref)); - break; default: error = NDR_ERR_OUTER_PARAMS_BAD; @@ -1561,7 +1560,6 @@ ndr_inner(ndr_ref_t *arg_ref) break; } return (*ti->ndr_func)(arg_ref); - break; case NDR_F_SIZE_IS: case NDR_F_DIMENSION_IS: @@ -1581,7 +1579,6 @@ ndr_inner(ndr_ref_t *arg_ref) return (ndr_inner_reference(arg_ref)); else return (ndr_inner_array(arg_ref)); - break; case NDR_F_IS_POINTER: /* type is pointer to one something */ if (is_union) { @@ -1589,7 +1586,6 @@ ndr_inner(ndr_ref_t *arg_ref) break; } return (ndr_inner_pointer(arg_ref)); - break; case NDR_F_IS_REFERENCE: /* type is pointer to one something */ if (is_union) { @@ -1597,7 +1593,6 @@ ndr_inner(ndr_ref_t *arg_ref) break; } return (ndr_inner_reference(arg_ref)); - break; case NDR_F_SWITCH_IS: if (!is_union) { @@ -1605,7 +1600,6 @@ ndr_inner(ndr_ref_t *arg_ref) break; } return (*ti->ndr_func)(arg_ref); - break; default: error = NDR_ERR_INNER_PARAMS_BAD; |