Skip to content

Commit 378ac80

Browse files
julianwiedmanndavem330
authored andcommitted
s390/qeth: static checker cleanups
- Add/delete some blanks, white spaces and braces. - Fix misindentations. - Adjust a deprecated header include, and htons() conversion. - Remove extra 'return' statements. Signed-off-by: Julian Wiedmann <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 84c9148 commit 378ac80

File tree

5 files changed

+22
-23
lines changed

5 files changed

+22
-23
lines changed

drivers/s390/net/qeth_core.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,8 @@ struct qeth_vnicc_info {
177177
/**
178178
* some more defs
179179
*/
180-
#define QETH_TX_TIMEOUT 100 * HZ
181-
#define QETH_RCD_TIMEOUT 60 * HZ
180+
#define QETH_TX_TIMEOUT (100 * HZ)
181+
#define QETH_RCD_TIMEOUT (60 * HZ)
182182
#define QETH_RECLAIM_WORK_TIME HZ
183183
#define QETH_MAX_PORTNO 15
184184

@@ -1069,7 +1069,8 @@ extern struct qeth_dbf_info qeth_dbf[QETH_DBF_INFOS];
10691069

10701070
struct net_device *qeth_clone_netdev(struct net_device *orig);
10711071
struct qeth_card *qeth_get_card_by_busid(char *bus_id);
1072-
void qeth_set_allowed_threads(struct qeth_card *, unsigned long , int);
1072+
void qeth_set_allowed_threads(struct qeth_card *card, unsigned long threads,
1073+
int clear_start_mask);
10731074
int qeth_threads_running(struct qeth_card *, unsigned long);
10741075
int qeth_set_offline(struct qeth_card *card, bool resetting);
10751076

drivers/s390/net/qeth_core_main.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include <linux/errno.h>
1818
#include <linux/kernel.h>
1919
#include <linux/log2.h>
20+
#include <linux/io.h>
2021
#include <linux/ip.h>
2122
#include <linux/tcp.h>
2223
#include <linux/mii.h>
@@ -35,7 +36,6 @@
3536

3637
#include <asm/ebcdic.h>
3738
#include <asm/chpid.h>
38-
#include <asm/io.h>
3939
#include <asm/sysinfo.h>
4040
#include <asm/diag.h>
4141
#include <asm/cio.h>
@@ -209,9 +209,8 @@ static void qeth_clear_working_pool_list(struct qeth_card *card)
209209

210210
QETH_CARD_TEXT(card, 5, "clwrklst");
211211
list_for_each_entry_safe(pool_entry, tmp,
212-
&card->qdio.in_buf_pool.entry_list, list){
213-
list_del(&pool_entry->list);
214-
}
212+
&card->qdio.in_buf_pool.entry_list, list)
213+
list_del(&pool_entry->list);
215214

216215
for (i = 0; i < ARRAY_SIZE(queue->bufs); i++)
217216
queue->bufs[i].pool_entry = NULL;
@@ -481,6 +480,7 @@ static void qeth_cleanup_handled_pending(struct qeth_qdio_out_q *q, int bidx,
481480
atomic_read(&c->state) ==
482481
QETH_QDIO_BUF_HANDLED_DELAYED) {
483482
struct qeth_qdio_out_buffer *f = c;
483+
484484
QETH_CARD_TEXT(f->q->card, 5, "fp");
485485
QETH_CARD_TEXT_(f->q->card, 5, "%lx", (long) f);
486486
/* release here to avoid interleaving between
@@ -507,7 +507,6 @@ static void qeth_cleanup_handled_pending(struct qeth_qdio_out_q *q, int bidx,
507507
}
508508
}
509509

510-
511510
static void qeth_qdio_handle_aob(struct qeth_card *card,
512511
unsigned long phys_aob_addr)
513512
{
@@ -884,6 +883,7 @@ static void qeth_issue_ipa_msg(struct qeth_ipa_cmd *cmd, int rc,
884883
{
885884
const char *ipa_name;
886885
int com = cmd->hdr.command;
886+
887887
ipa_name = qeth_get_ipa_cmd_name(com);
888888

889889
if (rc)
@@ -1253,7 +1253,7 @@ static int qeth_get_problem(struct qeth_card *card, struct ccw_device *cdev,
12531253
return 0;
12541254
}
12551255
QETH_CARD_TEXT(card, 2, "DGENCHK");
1256-
return -EIO;
1256+
return -EIO;
12571257
}
12581258
return 0;
12591259
}
@@ -1600,7 +1600,7 @@ static void qeth_start_kernel_thread(struct work_struct *work)
16001600
struct task_struct *ts;
16011601
struct qeth_card *card = container_of(work, struct qeth_card,
16021602
kernel_thread_starter);
1603-
QETH_CARD_TEXT(card , 2, "strthrd");
1603+
QETH_CARD_TEXT(card, 2, "strthrd");
16041604

16051605
if (card->read.state != CH_STATE_UP &&
16061606
card->write.state != CH_STATE_UP)
@@ -3416,7 +3416,6 @@ static void qeth_get_trap_id(struct qeth_card *card, struct qeth_trap_id *tid)
34163416
memcpy(tid->vmname, info322->vm[0].name, sizeof(tid->vmname));
34173417
}
34183418
free_page(info);
3419-
return;
34203419
}
34213420

34223421
static int qeth_hw_trap_cb(struct qeth_card *card,
@@ -4998,7 +4997,6 @@ static void qeth_determine_capabilities(struct qeth_card *card)
49984997
card->options.cq = QETH_CQ_NOTAVAILABLE;
49994998
}
50004999

5001-
50025000
out_offline:
50035001
if (ddev_offline == 1)
50045002
qeth_stop_channel(channel);
@@ -6050,6 +6048,7 @@ EXPORT_SYMBOL_GPL(qeth_send_simple_setassparms_prot);
60506048
static void qeth_unregister_dbf_views(void)
60516049
{
60526050
int x;
6051+
60536052
for (x = 0; x < QETH_DBF_INFOS; x++) {
60546053
debug_unregister(qeth_dbf[x].id);
60556054
qeth_dbf[x].id = NULL;
@@ -6413,6 +6412,7 @@ static int qeth_core_set_offline(struct ccwgroup_device *gdev)
64136412
static void qeth_core_shutdown(struct ccwgroup_device *gdev)
64146413
{
64156414
struct qeth_card *card = dev_get_drvdata(&gdev->dev);
6415+
64166416
qeth_set_allowed_threads(card, 0, 1);
64176417
if ((gdev->state == CCWGROUP_ONLINE) && card->info.hwtrap)
64186418
qeth_hw_trap(card, QETH_DIAGS_TRAP_DISARM);

drivers/s390/net/qeth_l2_main.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ static void qeth_l2_fill_header(struct qeth_qdio_out_q *queue,
183183
/* VSWITCH relies on the VLAN
184184
* information to be present in
185185
* the QDIO header */
186-
if (veth->h_vlan_proto == __constant_htons(ETH_P_8021Q)) {
186+
if (veth->h_vlan_proto == htons(ETH_P_8021Q)) {
187187
hdr->hdr.l2.flags[2] |= QETH_LAYER2_FLAG_VLAN;
188188
hdr->hdr.l2.vlan_id = ntohs(veth->h_vlan_TCI);
189189
}
@@ -877,7 +877,7 @@ static const struct net_device_ops qeth_l2_netdev_ops = {
877877
.ndo_set_mac_address = qeth_l2_set_mac_address,
878878
.ndo_vlan_rx_add_vid = qeth_l2_vlan_rx_add_vid,
879879
.ndo_vlan_rx_kill_vid = qeth_l2_vlan_rx_kill_vid,
880-
.ndo_tx_timeout = qeth_tx_timeout,
880+
.ndo_tx_timeout = qeth_tx_timeout,
881881
.ndo_fix_features = qeth_fix_features,
882882
.ndo_set_features = qeth_set_features,
883883
.ndo_bridge_getlink = qeth_l2_bridge_getlink,
@@ -1125,7 +1125,6 @@ void qeth_osn_deregister(struct net_device *dev)
11251125
QETH_CARD_TEXT(card, 2, "osndereg");
11261126
card->osn_info.assist_cb = NULL;
11271127
card->osn_info.data_cb = NULL;
1128-
return;
11291128
}
11301129
EXPORT_SYMBOL(qeth_osn_deregister);
11311130
#endif

drivers/s390/net/qeth_l3_main.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ static bool qeth_l3_is_addr_covered_by_ipato(struct qeth_card *card,
9797
return false;
9898

9999
qeth_l3_convert_addr_to_bits((u8 *) &addr->u, addr_bits,
100-
(addr->proto == QETH_PROT_IPV4)? 4:16);
100+
(addr->proto == QETH_PROT_IPV4) ? 4 : 16);
101101
list_for_each_entry(ipatoe, &card->ipato.entries, entry) {
102102
if (addr->proto != ipatoe->proto)
103103
continue;
@@ -540,7 +540,7 @@ int qeth_l3_add_ipato_entry(struct qeth_card *card,
540540
if (ipatoe->proto != new->proto)
541541
continue;
542542
if (!memcmp(ipatoe->addr, new->addr,
543-
(ipatoe->proto == QETH_PROT_IPV4)? 4:16) &&
543+
(ipatoe->proto == QETH_PROT_IPV4) ? 4 : 16) &&
544544
(ipatoe->mask_bits == new->mask_bits)) {
545545
rc = -EEXIST;
546546
break;
@@ -572,7 +572,7 @@ int qeth_l3_del_ipato_entry(struct qeth_card *card,
572572
if (ipatoe->proto != proto)
573573
continue;
574574
if (!memcmp(ipatoe->addr, addr,
575-
(proto == QETH_PROT_IPV4)? 4:16) &&
575+
(proto == QETH_PROT_IPV4) ? 4 : 16) &&
576576
(ipatoe->mask_bits == mask_bits)) {
577577
list_del(&ipatoe->entry);
578578
qeth_l3_update_ipato(card);
@@ -2139,7 +2139,6 @@ static struct qeth_card *qeth_l3_get_card_from_dev(struct net_device *dev)
21392139
static int qeth_l3_ip_event(struct notifier_block *this,
21402140
unsigned long event, void *ptr)
21412141
{
2142-
21432142
struct in_ifaddr *ifa = (struct in_ifaddr *)ptr;
21442143
struct net_device *dev = ifa->ifa_dev->dev;
21452144
struct qeth_ipaddr addr;

drivers/s390/net/qeth_l3_sys.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ static ssize_t qeth_l3_dev_ipato_enable_show(struct device *dev,
285285
{
286286
struct qeth_card *card = dev_get_drvdata(dev);
287287

288-
return sprintf(buf, "%i\n", card->ipato.enabled? 1:0);
288+
return sprintf(buf, "%u\n", card->ipato.enabled ? 1 : 0);
289289
}
290290

291291
static ssize_t qeth_l3_dev_ipato_enable_store(struct device *dev,
@@ -330,7 +330,7 @@ static ssize_t qeth_l3_dev_ipato_invert4_show(struct device *dev,
330330
{
331331
struct qeth_card *card = dev_get_drvdata(dev);
332332

333-
return sprintf(buf, "%i\n", card->ipato.invert4? 1:0);
333+
return sprintf(buf, "%u\n", card->ipato.invert4 ? 1 : 0);
334334
}
335335

336336
static ssize_t qeth_l3_dev_ipato_invert4_store(struct device *dev,
@@ -450,7 +450,7 @@ static ssize_t qeth_l3_dev_ipato_add_store(const char *buf, size_t count,
450450
return -ENOMEM;
451451

452452
ipatoe->proto = proto;
453-
memcpy(ipatoe->addr, addr, (proto == QETH_PROT_IPV4)? 4:16);
453+
memcpy(ipatoe->addr, addr, (proto == QETH_PROT_IPV4) ? 4 : 16);
454454
ipatoe->mask_bits = mask_bits;
455455

456456
rc = qeth_l3_add_ipato_entry(card, ipatoe);
@@ -501,7 +501,7 @@ static ssize_t qeth_l3_dev_ipato_invert6_show(struct device *dev,
501501
{
502502
struct qeth_card *card = dev_get_drvdata(dev);
503503

504-
return sprintf(buf, "%i\n", card->ipato.invert6? 1:0);
504+
return sprintf(buf, "%u\n", card->ipato.invert6 ? 1 : 0);
505505
}
506506

507507
static ssize_t qeth_l3_dev_ipato_invert6_store(struct device *dev,

0 commit comments

Comments
 (0)