diff options
Diffstat (limited to 'drivers/s390/net')
-rw-r--r-- | drivers/s390/net/claw.c | 5 | ||||
-rw-r--r-- | drivers/s390/net/fsm.c | 10 | ||||
-rw-r--r-- | drivers/s390/net/iucv.c | 11 | ||||
-rw-r--r-- | drivers/s390/net/lcs.c | 11 | ||||
-rw-r--r-- | drivers/s390/net/netiucv.c | 7 | ||||
-rw-r--r-- | drivers/s390/net/qeth_eddp.c | 13 | ||||
-rw-r--r-- | drivers/s390/net/qeth_main.c | 77 | ||||
-rw-r--r-- | drivers/s390/net/qeth_proc.c | 56 | ||||
-rw-r--r-- | drivers/s390/net/qeth_sys.c | 5 |
9 files changed, 61 insertions, 134 deletions
diff --git a/drivers/s390/net/claw.c b/drivers/s390/net/claw.c index a86436a7a60..23d53bf9daf 100644 --- a/drivers/s390/net/claw.c +++ b/drivers/s390/net/claw.c @@ -310,7 +310,7 @@ claw_probe(struct ccwgroup_device *cgdev) printk(KERN_INFO "claw: variable cgdev =\n"); dumpit((char *)cgdev, sizeof(struct ccwgroup_device)); #endif - privptr = kmalloc(sizeof(struct claw_privbk), GFP_KERNEL); + privptr = kzalloc(sizeof(struct claw_privbk), GFP_KERNEL); if (privptr == NULL) { probe_error(cgdev); put_device(&cgdev->dev); @@ -319,7 +319,6 @@ claw_probe(struct ccwgroup_device *cgdev) CLAW_DBF_TEXT_(2,setup,"probex%d",-ENOMEM); return -ENOMEM; } - memset(privptr,0x00,sizeof(struct claw_privbk)); privptr->p_mtc_envelope= kmalloc( MAX_ENVELOPE_SIZE, GFP_KERNEL); privptr->p_env = kmalloc(sizeof(struct claw_env), GFP_KERNEL); if ((privptr->p_mtc_envelope==NULL) || (privptr->p_env==NULL)) { @@ -1404,7 +1403,7 @@ add_claw_reads(struct net_device *dev, struct ccwbk* p_first, if ( privptr-> p_read_active_first ==NULL ) { #ifdef DEBUGMSG - printk(KERN_INFO "%s:%s p_read_active_frist == NULL \n", + printk(KERN_INFO "%s:%s p_read_active_first == NULL \n", dev->name,__FUNCTION__); printk(KERN_INFO "%s:%s Read active first/last changed \n", dev->name,__FUNCTION__); diff --git a/drivers/s390/net/fsm.c b/drivers/s390/net/fsm.c index 6caf5fa6a3b..7145e2134cf 100644 --- a/drivers/s390/net/fsm.c +++ b/drivers/s390/net/fsm.c @@ -21,38 +21,34 @@ init_fsm(char *name, const char **state_names, const char **event_names, int nr_ fsm_function_t *m; fsm *f; - this = (fsm_instance *)kmalloc(sizeof(fsm_instance), order); + this = kzalloc(sizeof(fsm_instance), order); if (this == NULL) { printk(KERN_WARNING "fsm(%s): init_fsm: Couldn't alloc instance\n", name); return NULL; } - memset(this, 0, sizeof(fsm_instance)); strlcpy(this->name, name, sizeof(this->name)); - f = (fsm *)kmalloc(sizeof(fsm), order); + f = kzalloc(sizeof(fsm), order); if (f == NULL) { printk(KERN_WARNING "fsm(%s): init_fsm: Couldn't alloc fsm\n", name); kfree_fsm(this); return NULL; } - memset(f, 0, sizeof(fsm)); f->nr_events = nr_events; f->nr_states = nr_states; f->event_names = event_names; f->state_names = state_names; this->f = f; - m = (fsm_function_t *)kmalloc( - sizeof(fsm_function_t) * nr_states * nr_events, order); + m = kcalloc(nr_states*nr_events, sizeof(fsm_function_t), order); if (m == NULL) { printk(KERN_WARNING "fsm(%s): init_fsm: Couldn't alloc jumptable\n", name); kfree_fsm(this); return NULL; } - memset(m, 0, sizeof(fsm_function_t) * f->nr_states * f->nr_events); f->jumpmatrix = m; for (i = 0; i < tmpl_len; i++) { diff --git a/drivers/s390/net/iucv.c b/drivers/s390/net/iucv.c index 760e77ec5a1..6190be9dca9 100644 --- a/drivers/s390/net/iucv.c +++ b/drivers/s390/net/iucv.c @@ -386,7 +386,7 @@ iucv_init(void) } /* Note: GFP_DMA used used to get memory below 2G */ - iucv_external_int_buffer = kmalloc(sizeof(iucv_GeneralInterrupt), + iucv_external_int_buffer = kzalloc(sizeof(iucv_GeneralInterrupt), GFP_KERNEL|GFP_DMA); if (!iucv_external_int_buffer) { printk(KERN_WARNING @@ -396,10 +396,9 @@ iucv_init(void) bus_unregister(&iucv_bus); return -ENOMEM; } - memset(iucv_external_int_buffer, 0, sizeof(iucv_GeneralInterrupt)); /* Initialize parameter pool */ - iucv_param_pool = kmalloc(sizeof(iucv_param) * PARAM_POOL_SIZE, + iucv_param_pool = kzalloc(sizeof(iucv_param) * PARAM_POOL_SIZE, GFP_KERNEL|GFP_DMA); if (!iucv_param_pool) { printk(KERN_WARNING "%s: Could not allocate param pool\n", @@ -410,7 +409,6 @@ iucv_init(void) bus_unregister(&iucv_bus); return -ENOMEM; } - memset(iucv_param_pool, 0, sizeof(iucv_param) * PARAM_POOL_SIZE); /* Initialize irq queue */ INIT_LIST_HEAD(&iucv_irq_queue); @@ -793,15 +791,14 @@ iucv_register_program (__u8 pgmname[16], } max_connections = iucv_query_maxconn(); - iucv_pathid_table = kmalloc(max_connections * sizeof(handler *), - GFP_ATOMIC); + iucv_pathid_table = kcalloc(max_connections, sizeof(handler *), + GFP_ATOMIC); if (iucv_pathid_table == NULL) { printk(KERN_WARNING "%s: iucv_pathid_table storage " "allocation failed\n", __FUNCTION__); kfree(new_handler); return NULL; } - memset (iucv_pathid_table, 0, max_connections * sizeof(handler *)); } memset(new_handler, 0, sizeof (handler)); memcpy(new_handler->id.user_data, pgmname, diff --git a/drivers/s390/net/lcs.c b/drivers/s390/net/lcs.c index 9cf88d7201d..edcf05d5d56 100644 --- a/drivers/s390/net/lcs.c +++ b/drivers/s390/net/lcs.c @@ -115,11 +115,10 @@ lcs_alloc_channel(struct lcs_channel *channel) LCS_DBF_TEXT(2, setup, "ichalloc"); for (cnt = 0; cnt < LCS_NUM_BUFFS; cnt++) { /* alloc memory fo iobuffer */ - channel->iob[cnt].data = (void *) - kmalloc(LCS_IOBUFFERSIZE, GFP_DMA | GFP_KERNEL); + channel->iob[cnt].data = + kzalloc(LCS_IOBUFFERSIZE, GFP_DMA | GFP_KERNEL); if (channel->iob[cnt].data == NULL) break; - memset(channel->iob[cnt].data, 0, LCS_IOBUFFERSIZE); channel->iob[cnt].state = BUF_STATE_EMPTY; } if (cnt < LCS_NUM_BUFFS) { @@ -182,10 +181,9 @@ lcs_alloc_card(void) LCS_DBF_TEXT(2, setup, "alloclcs"); - card = kmalloc(sizeof(struct lcs_card), GFP_KERNEL | GFP_DMA); + card = kzalloc(sizeof(struct lcs_card), GFP_KERNEL | GFP_DMA); if (card == NULL) return NULL; - memset(card, 0, sizeof(struct lcs_card)); card->lan_type = LCS_FRAME_TYPE_AUTO; card->pkt_seq = 0; card->lancmd_timeout = LCS_LANCMD_TIMEOUT_DEFAULT; @@ -793,10 +791,9 @@ lcs_alloc_reply(struct lcs_cmd *cmd) LCS_DBF_TEXT(4, trace, "getreply"); - reply = kmalloc(sizeof(struct lcs_reply), GFP_ATOMIC); + reply = kzalloc(sizeof(struct lcs_reply), GFP_ATOMIC); if (!reply) return NULL; - memset(reply,0,sizeof(struct lcs_reply)); atomic_set(&reply->refcnt,1); reply->sequence_no = cmd->sequence_no; reply->received = 0; diff --git a/drivers/s390/net/netiucv.c b/drivers/s390/net/netiucv.c index 71d3853e868..260a93c8c44 100644 --- a/drivers/s390/net/netiucv.c +++ b/drivers/s390/net/netiucv.c @@ -1728,14 +1728,13 @@ static int netiucv_register_device(struct net_device *ndev) { struct netiucv_priv *priv = ndev->priv; - struct device *dev = kmalloc(sizeof(struct device), GFP_KERNEL); + struct device *dev = kzalloc(sizeof(struct device), GFP_KERNEL); int ret; IUCV_DBF_TEXT(trace, 3, __FUNCTION__); if (dev) { - memset(dev, 0, sizeof(struct device)); snprintf(dev->bus_id, BUS_ID_SIZE, "net%s", ndev->name); dev->bus = &iucv_bus; dev->parent = iucv_root; @@ -1784,11 +1783,9 @@ netiucv_new_connection(struct net_device *dev, char *username) { struct iucv_connection **clist = &iucv_connections; struct iucv_connection *conn = - (struct iucv_connection *) - kmalloc(sizeof(struct iucv_connection), GFP_KERNEL); + kzalloc(sizeof(struct iucv_connection), GFP_KERNEL); if (conn) { - memset(conn, 0, sizeof(struct iucv_connection)); skb_queue_head_init(&conn->collect_queue); skb_queue_head_init(&conn->commit_queue); conn->max_buffsize = NETIUCV_BUFSIZE_DEFAULT; diff --git a/drivers/s390/net/qeth_eddp.c b/drivers/s390/net/qeth_eddp.c index 82cb4af2f0e..44e226f211e 100644 --- a/drivers/s390/net/qeth_eddp.c +++ b/drivers/s390/net/qeth_eddp.c @@ -389,9 +389,8 @@ qeth_eddp_create_eddp_data(struct qeth_hdr *qh, u8 *nh, u8 nhl, u8 *th, u8 thl) struct qeth_eddp_data *eddp; QETH_DBF_TEXT(trace, 5, "eddpcrda"); - eddp = kmalloc(sizeof(struct qeth_eddp_data), GFP_ATOMIC); + eddp = kzalloc(sizeof(struct qeth_eddp_data), GFP_ATOMIC); if (eddp){ - memset(eddp, 0, sizeof(struct qeth_eddp_data)); eddp->nhl = nhl; eddp->thl = thl; memcpy(&eddp->qh, qh, sizeof(struct qeth_hdr)); @@ -542,12 +541,11 @@ qeth_eddp_create_context_generic(struct qeth_card *card, struct sk_buff *skb, QETH_DBF_TEXT(trace, 5, "creddpcg"); /* create the context and allocate pages */ - ctx = kmalloc(sizeof(struct qeth_eddp_context), GFP_ATOMIC); + ctx = kzalloc(sizeof(struct qeth_eddp_context), GFP_ATOMIC); if (ctx == NULL){ QETH_DBF_TEXT(trace, 2, "ceddpcn1"); return NULL; } - memset(ctx, 0, sizeof(struct qeth_eddp_context)); ctx->type = QETH_LARGE_SEND_EDDP; qeth_eddp_calc_num_pages(ctx, skb, hdr_len); if (ctx->elements_per_skb > QETH_MAX_BUFFER_ELEMENTS(card)){ @@ -555,13 +553,12 @@ qeth_eddp_create_context_generic(struct qeth_card *card, struct sk_buff *skb, kfree(ctx); return NULL; } - ctx->pages = kmalloc(ctx->num_pages * sizeof(u8 *), GFP_ATOMIC); + ctx->pages = kcalloc(ctx->num_pages, sizeof(u8 *), GFP_ATOMIC); if (ctx->pages == NULL){ QETH_DBF_TEXT(trace, 2, "ceddpcn2"); kfree(ctx); return NULL; } - memset(ctx->pages, 0, ctx->num_pages * sizeof(u8 *)); for (i = 0; i < ctx->num_pages; ++i){ addr = (u8 *)__get_free_page(GFP_ATOMIC); if (addr == NULL){ @@ -573,15 +570,13 @@ qeth_eddp_create_context_generic(struct qeth_card *card, struct sk_buff *skb, memset(addr, 0, PAGE_SIZE); ctx->pages[i] = addr; } - ctx->elements = kmalloc(ctx->num_elements * + ctx->elements = kcalloc(ctx->num_elements, sizeof(struct qeth_eddp_element), GFP_ATOMIC); if (ctx->elements == NULL){ QETH_DBF_TEXT(trace, 2, "ceddpcn4"); qeth_eddp_free_context(ctx); return NULL; } - memset(ctx->elements, 0, - ctx->num_elements * sizeof(struct qeth_eddp_element)); /* reset num_elements; will be incremented again in fill_buffer to * reflect number of actually used elements */ ctx->num_elements = 0; diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c index dba7f7f02e7..b3c6e790779 100644 --- a/drivers/s390/net/qeth_main.c +++ b/drivers/s390/net/qeth_main.c @@ -297,12 +297,10 @@ qeth_alloc_card(void) struct qeth_card *card; QETH_DBF_TEXT(setup, 2, "alloccrd"); - card = (struct qeth_card *) kmalloc(sizeof(struct qeth_card), - GFP_DMA|GFP_KERNEL); + card = kzalloc(sizeof(struct qeth_card), GFP_DMA|GFP_KERNEL); if (!card) return NULL; QETH_DBF_HEX(setup, 2, &card, sizeof(void *)); - memset(card, 0, sizeof(struct qeth_card)); if (qeth_setup_channel(&card->read)) { kfree(card); return NULL; @@ -1364,7 +1362,7 @@ qeth_wait_for_buffer(struct qeth_channel *channel) static void qeth_clear_cmd_buffers(struct qeth_channel *channel) { - int cnt = 0; + int cnt; for (cnt=0; cnt < QETH_CMD_BUFFER_NO; cnt++) qeth_release_buffer(channel,&channel->iob[cnt]); @@ -1632,9 +1630,8 @@ qeth_alloc_reply(struct qeth_card *card) { struct qeth_reply *reply; - reply = kmalloc(sizeof(struct qeth_reply), GFP_ATOMIC); + reply = kzalloc(sizeof(struct qeth_reply), GFP_ATOMIC); if (reply){ - memset(reply, 0, sizeof(struct qeth_reply)); atomic_set(&reply->refcnt, 1); reply->card = card; }; @@ -2814,11 +2811,11 @@ qeth_handle_send_error(struct qeth_card *card, QETH_DBF_TEXT_(trace,1,"%s",CARD_BUS_ID(card)); return QETH_SEND_ERROR_LINK_FAILURE; case 3: + default: QETH_DBF_TEXT(trace, 1, "SIGAcc3"); QETH_DBF_TEXT_(trace,1,"%s",CARD_BUS_ID(card)); return QETH_SEND_ERROR_KICK_IT; } - return QETH_SEND_ERROR_LINK_FAILURE; } void @@ -3348,13 +3345,11 @@ qeth_qdio_establish(struct qeth_card *card) QETH_DBF_TEXT(setup, 2, "qdioest"); - qib_param_field = kmalloc(QDIO_MAX_BUFFERS_PER_Q * sizeof(char), + qib_param_field = kzalloc(QDIO_MAX_BUFFERS_PER_Q * sizeof(char), GFP_KERNEL); if (!qib_param_field) return -ENOMEM; - memset(qib_param_field, 0, QDIO_MAX_BUFFERS_PER_Q * sizeof(char)); - qeth_create_qib_param_field(card, qib_param_field); qeth_create_qib_param_field_blkt(card, qib_param_field); @@ -3865,6 +3860,7 @@ qeth_get_cast_type(struct qeth_card *card, struct sk_buff *skb) if ((hdr_mac == QETH_TR_MAC_NC) || (hdr_mac == QETH_TR_MAC_C)) return RTN_MULTICAST; + break; /* eth or so multicast? */ default: if ((hdr_mac == QETH_ETH_MAC_V4) || @@ -4419,6 +4415,7 @@ qeth_send_packet(struct qeth_card *card, struct sk_buff *skb) int elements_needed = 0; enum qeth_large_send_types large_send = QETH_LARGE_SEND_NO; struct qeth_eddp_context *ctx = NULL; + int tx_bytes = skb->len; int rc; QETH_DBF_TEXT(trace, 6, "sendpkt"); @@ -4499,7 +4496,7 @@ qeth_send_packet(struct qeth_card *card, struct sk_buff *skb) elements_needed, ctx); if (!rc){ card->stats.tx_packets++; - card->stats.tx_bytes += skb->len; + card->stats.tx_bytes += tx_bytes; #ifdef CONFIG_QETH_PERF_STATS if (skb_shinfo(skb)->tso_size && !(large_send == QETH_LARGE_SEND_NO)) { @@ -4585,38 +4582,11 @@ qeth_mdio_read(struct net_device *dev, int phy_id, int regnum) case MII_NCONFIG: /* network interface config */ break; default: - rc = 0; break; } return rc; } -static void -qeth_mdio_write(struct net_device *dev, int phy_id, int regnum, int value) -{ - switch(regnum){ - case MII_BMCR: /* Basic mode control register */ - case MII_BMSR: /* Basic mode status register */ - case MII_PHYSID1: /* PHYS ID 1 */ - case MII_PHYSID2: /* PHYS ID 2 */ - case MII_ADVERTISE: /* Advertisement control reg */ - case MII_LPA: /* Link partner ability reg */ - case MII_EXPANSION: /* Expansion register */ - case MII_DCOUNTER: /* disconnect counter */ - case MII_FCSCOUNTER: /* false carrier counter */ - case MII_NWAYTEST: /* N-way auto-neg test register */ - case MII_RERRCOUNTER: /* rx error counter */ - case MII_SREVISION: /* silicon revision */ - case MII_RESV1: /* reserved 1 */ - case MII_LBRERROR: /* loopback, rx, bypass error */ - case MII_PHYADDR: /* physical address */ - case MII_RESV2: /* reserved 2 */ - case MII_TPISTATUS: /* TPI status for 10mbps */ - case MII_NCONFIG: /* network interface config */ - default: - break; - } -} static inline const char * qeth_arp_get_error_cause(int *rc) @@ -4844,9 +4814,8 @@ qeth_arp_query(struct qeth_card *card, char *udata) /* get size of userspace buffer and mask_bits -> 6 bytes */ if (copy_from_user(&qinfo, udata, 6)) return -EFAULT; - if (!(qinfo.udata = kmalloc(qinfo.udata_len, GFP_KERNEL))) + if (!(qinfo.udata = kzalloc(qinfo.udata_len, GFP_KERNEL))) return -ENOMEM; - memset(qinfo.udata, 0, qinfo.udata_len); qinfo.udata_offset = QETH_QARP_ENTRIES_OFFSET; iob = qeth_get_setassparms_cmd(card, IPA_ARP_PROCESSING, IPA_CMD_ASS_ARP_QUERY_INFO, @@ -4994,11 +4963,10 @@ qeth_snmp_command(struct qeth_card *card, char *udata) return -EFAULT; } qinfo.udata_len = ureq->hdr.data_len; - if (!(qinfo.udata = kmalloc(qinfo.udata_len, GFP_KERNEL))){ + if (!(qinfo.udata = kzalloc(qinfo.udata_len, GFP_KERNEL))){ kfree(ureq); return -ENOMEM; } - memset(qinfo.udata, 0, qinfo.udata_len); qinfo.udata_offset = sizeof(struct qeth_snmp_ureq_hdr); iob = qeth_get_adapter_cmd(card, IPA_SETADP_SET_SNMP_CONTROL, @@ -5236,21 +5204,6 @@ qeth_do_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) mii_data->val_out = qeth_mdio_read(dev,mii_data->phy_id, mii_data->reg_num); break; - case SIOCSMIIREG: - rc = -EOPNOTSUPP; - break; - /* TODO: remove return if qeth_mdio_write does something */ - if (!capable(CAP_NET_ADMIN)){ - rc = -EPERM; - break; - } - mii_data = if_mii(rq); - if (mii_data->phy_id != 0) - rc = -EINVAL; - else - qeth_mdio_write(dev, mii_data->phy_id, mii_data->reg_num, - mii_data->val_in); - break; default: rc = -EOPNOTSUPP; } @@ -5604,12 +5557,11 @@ qeth_get_addr_buffer(enum qeth_prot_versions prot) { struct qeth_ipaddr *addr; - addr = kmalloc(sizeof(struct qeth_ipaddr), GFP_ATOMIC); + addr = kzalloc(sizeof(struct qeth_ipaddr), GFP_ATOMIC); if (addr == NULL) { PRINT_WARN("Not enough memory to add address\n"); return NULL; } - memset(addr,0,sizeof(struct qeth_ipaddr)); addr->type = QETH_IP_TYPE_NORMAL; addr->proto = prot; return addr; @@ -6900,7 +6852,7 @@ qeth_send_setassparms(struct qeth_card *card, struct qeth_cmd_buffer *iob, cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE); if (len <= sizeof(__u32)) cmd->data.setassparms.data.flags_32bit = (__u32) data; - else if (len > sizeof(__u32)) + else /* (len > sizeof(__u32)) */ memcpy(&cmd->data.setassparms.data, (void *) data, len); rc = qeth_send_ipa_cmd(card, iob, reply_cb, reply_param); @@ -7379,11 +7331,6 @@ qeth_setrouting_v6(struct qeth_card *card) qeth_correct_routing_type(card, &card->options.route6.type, QETH_PROT_IPV6); - if ((card->options.route6.type == NO_ROUTER) || - ((card->info.type == QETH_CARD_TYPE_OSAE) && - (card->options.route6.type == MULTICAST_ROUTER) && - !qeth_is_supported6(card,IPA_OSA_MC_ROUTER))) - return 0; rc = qeth_send_setrouting(card, card->options.route6.type, QETH_PROT_IPV6); if (rc) { diff --git a/drivers/s390/net/qeth_proc.c b/drivers/s390/net/qeth_proc.c index 3c6339df879..360d782c7ad 100644 --- a/drivers/s390/net/qeth_proc.c +++ b/drivers/s390/net/qeth_proc.c @@ -74,7 +74,7 @@ qeth_procfile_seq_next(struct seq_file *s, void *it, loff_t *offset) static inline const char * qeth_get_router_str(struct qeth_card *card, int ipv) { - int routing_type = 0; + enum qeth_routing_types routing_type = NO_ROUTER; if (ipv == 4) { routing_type = card->options.route4.type; @@ -86,26 +86,26 @@ qeth_get_router_str(struct qeth_card *card, int ipv) #endif /* CONFIG_QETH_IPV6 */ } - if (routing_type == PRIMARY_ROUTER) + switch (routing_type){ + case PRIMARY_ROUTER: return "pri"; - else if (routing_type == SECONDARY_ROUTER) + case SECONDARY_ROUTER: return "sec"; - else if (routing_type == MULTICAST_ROUTER) { + case MULTICAST_ROUTER: if (card->info.broadcast_capable == QETH_BROADCAST_WITHOUT_ECHO) return "mc+"; return "mc"; - } else if (routing_type == PRIMARY_CONNECTOR) { + case PRIMARY_CONNECTOR: if (card->info.broadcast_capable == QETH_BROADCAST_WITHOUT_ECHO) return "p+c"; return "p.c"; - } else if (routing_type == SECONDARY_CONNECTOR) { + case SECONDARY_CONNECTOR: if (card->info.broadcast_capable == QETH_BROADCAST_WITHOUT_ECHO) return "s+c"; return "s.c"; - } else if (routing_type == NO_ROUTER) + default: /* NO_ROUTER */ return "no"; - else - return "unk"; + } } static int @@ -192,27 +192,27 @@ qeth_perf_procfile_seq_show(struct seq_file *s, void *it) CARD_DDEV_ID(card), QETH_CARD_IFNAME(card) ); - seq_printf(s, " Skb's/buffers received : %li/%i\n" - " Skb's/buffers sent : %li/%i\n\n", + seq_printf(s, " Skb's/buffers received : %lu/%u\n" + " Skb's/buffers sent : %lu/%u\n\n", card->stats.rx_packets, card->perf_stats.bufs_rec, card->stats.tx_packets, card->perf_stats.bufs_sent ); - seq_printf(s, " Skb's/buffers sent without packing : %li/%i\n" - " Skb's/buffers sent with packing : %i/%i\n\n", + seq_printf(s, " Skb's/buffers sent without packing : %lu/%u\n" + " Skb's/buffers sent with packing : %u/%u\n\n", card->stats.tx_packets - card->perf_stats.skbs_sent_pack, card->perf_stats.bufs_sent - card->perf_stats.bufs_sent_pack, card->perf_stats.skbs_sent_pack, card->perf_stats.bufs_sent_pack ); - seq_printf(s, " Skbs sent in SG mode : %i\n" - " Skb fragments sent in SG mode : %i\n\n", + seq_printf(s, " Skbs sent in SG mode : %u\n" + " Skb fragments sent in SG mode : %u\n\n", card->perf_stats.sg_skbs_sent, card->perf_stats.sg_frags_sent); - seq_printf(s, " large_send tx (in Kbytes) : %i\n" - " large_send count : %i\n\n", + seq_printf(s, " large_send tx (in Kbytes) : %u\n" + " large_send count : %u\n\n", card->perf_stats.large_send_bytes >> 10, card->perf_stats.large_send_cnt); - seq_printf(s, " Packing state changes no pkg.->packing : %i/%i\n" + seq_printf(s, " Packing state changes no pkg.->packing : %u/%u\n" " Watermarks L/H : %i/%i\n" " Current buffer usage (outbound q's) : " "%i/%i/%i/%i\n\n", @@ -229,16 +229,16 @@ qeth_perf_procfile_seq_show(struct seq_file *s, void *it) atomic_read(&card->qdio.out_qs[3]->used_buffers) : 0 ); - seq_printf(s, " Inbound handler time (in us) : %i\n" - " Inbound handler count : %i\n" - " Inbound do_QDIO time (in us) : %i\n" - " Inbound do_QDIO count : %i\n\n" - " Outbound handler time (in us) : %i\n" - " Outbound handler count : %i\n\n" - " Outbound time (in us, incl QDIO) : %i\n" - " Outbound count : %i\n" - " Outbound do_QDIO time (in us) : %i\n" - " Outbound do_QDIO count : %i\n\n", + seq_printf(s, " Inbound handler time (in us) : %u\n" + " Inbound handler count : %u\n" + " Inbound do_QDIO time (in us) : %u\n" + " Inbound do_QDIO count : %u\n\n" + " Outbound handler time (in us) : %u\n" + " Outbound handler count : %u\n\n" + " Outbound time (in us, incl QDIO) : %u\n" + " Outbound count : %u\n" + " Outbound do_QDIO time (in us) : %u\n" + " Outbound do_QDIO count : %u\n\n", card->perf_stats.inbound_time, card->perf_stats.inbound_cnt, card->perf_stats.inbound_do_qdio_time, diff --git a/drivers/s390/net/qeth_sys.c b/drivers/s390/net/qeth_sys.c index c1831f57258..882d419e416 100644 --- a/drivers/s390/net/qeth_sys.c +++ b/drivers/s390/net/qeth_sys.c @@ -115,7 +115,7 @@ qeth_dev_portno_store(struct device *dev, struct device_attribute *attr, const c return -EPERM; portno = simple_strtoul(buf, &tmp, 16); - if ((portno < 0) || (portno > MAX_PORTNO)){ + if (portno > MAX_PORTNO){ PRINT_WARN("portno 0x%X is out of range\n", portno); return -EINVAL; } @@ -1145,11 +1145,10 @@ qeth_dev_ipato_add_store(const char *buf, size_t count, if ((rc = qeth_parse_ipatoe(buf, proto, addr, &mask_bits))) return rc; - if (!(ipatoe = kmalloc(sizeof(struct qeth_ipato_entry), GFP_KERNEL))){ + if (!(ipatoe = kzalloc(sizeof(struct qeth_ipato_entry), GFP_KERNEL))){ PRINT_WARN("No memory to allocate ipato entry\n"); return -ENOMEM; } - memset(ipatoe, 0, sizeof(struct qeth_ipato_entry)); ipatoe->proto = proto; memcpy(ipatoe->addr, addr, (proto == QETH_PROT_IPV4)? 4:16); ipatoe->mask_bits = mask_bits; |