netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 2/2] drivers/isdn: eliminate duplicated test
@ 2009-12-22  0:25 akpm
  2010-01-04  5:26 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: akpm @ 2009-12-22  0:25 UTC (permalink / raw)
  To: isdn; +Cc: netdev, akpm, julia

From: Julia Lawall <julia@diku.dk>

The code checked slot_rx twice.  Check slot_tx by analogy with the bank
case.

The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression E;
@@

(
*E && E
|
*E || E
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Cc: Karsten Keil <isdn@linux-pingi.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 drivers/isdn/hardware/mISDN/hfcmulti.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN drivers/isdn/hardware/mISDN/hfcmulti.c~drivers-isdn-eliminate-duplicated-test drivers/isdn/hardware/mISDN/hfcmulti.c
--- a/drivers/isdn/hardware/mISDN/hfcmulti.c~drivers-isdn-eliminate-duplicated-test
+++ a/drivers/isdn/hardware/mISDN/hfcmulti.c
@@ -3152,7 +3152,7 @@ static void
 hfcmulti_pcm(struct hfc_multi *hc, int ch, int slot_tx, int bank_tx,
     int slot_rx, int bank_rx)
 {
-	if (slot_rx < 0 || slot_rx < 0 || bank_tx < 0 || bank_rx < 0) {
+	if (slot_tx < 0 || slot_rx < 0 || bank_tx < 0 || bank_rx < 0) {
 		/* disable PCM */
 		mode_hfcmulti(hc, ch, hc->chan[ch].protocol, -1, 0, -1, 0);
 		return;
_

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [patch 2/2] drivers/isdn: eliminate duplicated test
  2009-12-22  0:25 [patch 2/2] drivers/isdn: eliminate duplicated test akpm
@ 2010-01-04  5:26 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2010-01-04  5:26 UTC (permalink / raw)
  To: akpm; +Cc: isdn, netdev, julia

From: akpm@linux-foundation.org
Date: Mon, 21 Dec 2009 16:25:32 -0800

> From: Julia Lawall <julia@diku.dk>
> 
> The code checked slot_rx twice.  Check slot_tx by analogy with the bank
> case.
 ...
> Signed-off-by: Julia Lawall <julia@diku.dk>
> Cc: Karsten Keil <isdn@linux-pingi.de>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-01-04  5:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-22  0:25 [patch 2/2] drivers/isdn: eliminate duplicated test akpm
2010-01-04  5:26 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).