Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1638156 > unrolled thread
| Started by | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| First post | 2017-05-09 16:30 +0200 |
| Last post | 2017-05-09 16:50 +0200 |
| Articles | 4 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH 0/4] hamradio: Fine-tuning for nine function implementations SF Markus Elfring <elfring@users.sourceforge.net> - 2017-05-09 16:30 +0200
[PATCH 4/4] hamradio: Adjust four function calls together with a variable assignment SF Markus Elfring <elfring@users.sourceforge.net> - 2017-05-09 16:30 +0200
[PATCH 2/4] hamradio: Adjust four function calls together with a variable assignment SF Markus Elfring <elfring@users.sourceforge.net> - 2017-05-09 16:30 +0200
Re: [PATCH 0/4] hamradio: Fine-tuning for nine function implementations David Miller <davem@davemloft.net> - 2017-05-09 16:50 +0200
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2017-05-09 16:30 +0200 |
| Subject | [PATCH 0/4] hamradio: Fine-tuning for nine function implementations |
| Message-ID | <tFejg-2TS-15@gated-at.bofh.it> |
From: Markus Elfring <elfring@users.sourceforge.net> Date: Tue, 9 May 2017 16:11:23 +0200 A few update suggestions were taken into account from static source code analysis. Markus Elfring (4): Combine two seq_printf() calls into one in yam_seq_show() Adjust four function calls together with a variable assignment Use seq_puts() in bpq_seq_show() Adjust four function calls together with a variable assignment drivers/net/hamradio/bpqether.c | 14 +++++++++----- drivers/net/hamradio/yam.c | 15 +++++++++------ 2 files changed, 18 insertions(+), 11 deletions(-) -- 2.12.2
[toc] | [next] | [standalone]
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2017-05-09 16:30 +0200 |
| Subject | [PATCH 4/4] hamradio: Adjust four function calls together with a variable assignment |
| Message-ID | <tFejg-2TS-19@gated-at.bofh.it> |
| In reply to | #1638156 |
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 9 May 2017 15:57:17 +0200
The script "checkpatch.pl" pointed information out like the following.
ERROR: do not use assignment in if condition
Thus fix affected source code places.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/net/hamradio/bpqether.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/net/hamradio/bpqether.c b/drivers/net/hamradio/bpqether.c
index eaa0f2e8e561..5e234e0ca256 100644
--- a/drivers/net/hamradio/bpqether.c
+++ b/drivers/net/hamradio/bpqether.c
@@ -185,7 +185,8 @@ static int bpq_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_ty
if (!net_eq(dev_net(dev), &init_net))
goto drop;
- if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL)
+ skb = skb_share_check(skb, GFP_ATOMIC);
+ if (!skb)
return NET_RX_DROP;
if (!pskb_may_pull(skb, sizeof(struct ethhdr)))
@@ -286,7 +287,8 @@ static netdev_tx_t bpq_xmit(struct sk_buff *skb, struct net_device *dev)
bpq = netdev_priv(dev);
orig_dev = dev;
- if ((dev = bpq_get_ether_dev(dev)) == NULL) {
+ dev = bpq_get_ether_dev(dev);
+ if (!dev) {
orig_dev->stats.tx_dropped++;
kfree_skb(skb);
return NETDEV_TX_OK;
@@ -565,12 +567,14 @@ static int bpq_device_event(struct notifier_block *this,
break;
case NETDEV_DOWN: /* ethernet device closed -> close BPQ interface */
- if ((dev = bpq_get_ax25_dev(dev)) != NULL)
+ dev = bpq_get_ax25_dev(dev);
+ if (dev)
dev_close(dev);
break;
case NETDEV_UNREGISTER: /* ethernet device removed -> free BPQ interface */
- if ((dev = bpq_get_ax25_dev(dev)) != NULL)
+ dev = bpq_get_ax25_dev(dev);
+ if (dev)
bpq_free_device(dev);
break;
default:
--
2.12.2
[toc] | [prev] | [next] | [standalone]
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2017-05-09 16:30 +0200 |
| Subject | [PATCH 2/4] hamradio: Adjust four function calls together with a variable assignment |
| Message-ID | <tFejg-2TS-23@gated-at.bofh.it> |
| In reply to | #1638156 |
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 9 May 2017 15:15:16 +0200
The script "checkpatch.pl" pointed information out like the following.
ERROR: do not use assignment in if condition
Thus fix affected source code places.
Improve a size determination.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/net/hamradio/yam.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/net/hamradio/yam.c b/drivers/net/hamradio/yam.c
index 542f1e511df1..c792b0f116a5 100644
--- a/drivers/net/hamradio/yam.c
+++ b/drivers/net/hamradio/yam.c
@@ -401,7 +401,8 @@ static unsigned char *add_mcs(unsigned char *bits, int bitrate,
}
/* Allocate a new mcs */
- if ((p = kmalloc(sizeof(struct yam_mcs), GFP_KERNEL)) == NULL) {
+ p = kmalloc(sizeof(*p), GFP_KERNEL);
+ if (!p) {
release_firmware(fw);
return NULL;
}
@@ -549,7 +550,8 @@ static inline void yam_rx_flag(struct net_device *dev, struct yam_port *yp)
if ((yp->rx_crch & yp->rx_crcl) != 0xFF) {
/* Bad crc */
} else {
- if (!(skb = dev_alloc_skb(pkt_len))) {
+ skb = dev_alloc_skb(pkt_len);
+ if (!skb) {
printk(KERN_WARNING "%s: memory squeeze, dropping packet\n", dev->name);
++dev->stats.rx_dropped;
} else {
@@ -670,7 +672,8 @@ static void yam_tx_byte(struct net_device *dev, struct yam_port *yp)
break;
case TX_HEAD:
if (--yp->tx_count <= 0) {
- if (!(skb = skb_dequeue(&yp->send_queue))) {
+ skb = skb_dequeue(&yp->send_queue);
+ if (!skb) {
ptt_off(dev);
yp->tx_state = TX_OFF;
break;
@@ -879,7 +882,8 @@ static int yam_open(struct net_device *dev)
printk(KERN_ERR "%s: cannot 0x%lx busy\n", dev->name, dev->base_addr);
return -EACCES;
}
- if ((u = yam_check_uart(dev->base_addr)) == c_uart_unknown) {
+ u = yam_check_uart(dev->base_addr);
+ if (u == c_uart_unknown) {
printk(KERN_ERR "%s: cannot find uart type\n", dev->name);
ret = -EIO;
goto out_release_base;
--
2.12.2
[toc] | [prev] | [next] | [standalone]
| From | David Miller <davem@davemloft.net> |
|---|---|
| Date | 2017-05-09 16:50 +0200 |
| Subject | Re: [PATCH 0/4] hamradio: Fine-tuning for nine function implementations |
| Message-ID | <tFeCC-32E-5@gated-at.bofh.it> |
| In reply to | #1638156 |
You can feel free to continue submitting these changes, even though people have asked you to back off on this, and that there is little to no value to this churn. But I personally am not going to apply any of your changes... Especially since you keep posting even though people are asking you to not make these changes. You can ignore feedback like that, and you are explicitly being notified that as a result, we can feel free to ignore you _too_. People who submit kernel changes in the way you do waste a lot of people's valuable time which could be spent on fixing real bugs, implementing new important features, adding new documentation to improve the understanding of the kernel for everyone, etc. But instead, that time is being invested to reviewing your extremely low value patches, many of which are undesirable. I will not stand for it as the networking maintainer and am going to ignore everything you submit until your approach and attitude towards kernel patch submission _fundamentally_ (not temporarily, or for one specific set of patches) changes. Thank you.
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web