mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Tilman Schmidt <tilman@imap.cc>
Cc: David Miller <davem@davemloft.net>,
	Karsten Keil <isdn@linux-pingi.de>,
	Hansjoerg Lipp <hjlipp@web.de>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	isdn4linux@listserv.isdn4linux.de,
	i4ldeveloper@listserv.isdn4linux.de
Subject: Re: [PATCH 6/9] ser_gigaset: checkpatch cleanup
Date: Sun, 25 Oct 2009 17:54:46 -0700	[thread overview]
Message-ID: <1256518486.14711.13.camel@Joe-Laptop.home> (raw)
In-Reply-To: <20091023-patch-gigaset-06.tilman@imap.cc>

On Sun, 2009-10-25 at 20:30 +0100, Tilman Schmidt wrote:
> Duly uglified as demanded by checkpatch.pl.
> diff --git a/drivers/isdn/gigaset/ser-gigaset.c b/drivers/isdn/gigaset/ser-gigaset.c
> index 3071a52..ac3409e 100644
> --- a/drivers/isdn/gigaset/ser-gigaset.c
> +++ b/drivers/isdn/gigaset/ser-gigaset.c
> @@ -164,9 +164,15 @@ static void gigaset_modem_fill(unsigned long data)
>  {
>  	struct cardstate *cs = (struct cardstate *) data;
>  	struct bc_state *bcs;
> +	struct sk_buff *nextskb;
>  	int sent = 0;
>  
> -	if (!cs || !(bcs = cs->bcs)) {
> +	if (!cs) {
> +		gig_dbg(DEBUG_OUTPUT, "%s: no cardstate", __func__);
> +		return;
> +	}
> +	bcs = cs->bcs;
> +	if (!bcs) {
>  		gig_dbg(DEBUG_OUTPUT, "%s: no cardstate", __func__);
>  		return;
>	}

perhaps:
	if (!cs || !cs->bcs) {
		gig_dbg(DEBUG_OUTPUT, "%s: no cardstate", __func__);
		return;
	}
	bcs = cs->bcs;

[]

> @@ -404,16 +412,20 @@ static void gigaset_device_release(struct device *dev)
>  static int gigaset_initcshw(struct cardstate *cs)
>  {
>  	int rc;
> +	struct ser_cardstate *scs;
>  
> -	if (!(cs->hw.ser = kzalloc(sizeof(struct ser_cardstate), GFP_KERNEL))) {
> +	scs = kzalloc(sizeof(struct ser_cardstate), GFP_KERNEL);
> +	if (!scs) {
>  		pr_err("out of memory\n");
>  		return 0;
>  	}
> +	cs->hw.ser = scs;

Why not no temporary and just:

	cs->hw.ser = kzalloc...
	if (!cs->hw.ser)



  parent reply	other threads:[~2009-10-26  0:54 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-25 19:29 [PATCH 0/9] Gigaset driver patches for 2.6.33 Tilman Schmidt
2009-10-25 19:29 ` [PATCH 1/9] gigaset: CAPI module readability improvements Tilman Schmidt
2009-10-25 19:29 ` [PATCH 2/9] gigaset: fix format string typo in CAPI dial command Tilman Schmidt
2009-10-25 19:29 ` [PATCH 3/9] gigaset: fix bad assumptions about CAPI skbuffs Tilman Schmidt
2009-10-25 19:30 ` [PATCH 4/9] usb_gigaset: code cleanup Tilman Schmidt
2009-10-25 19:30 ` [PATCH 5/9] gigaset: checkpatch cleanup Tilman Schmidt
2009-10-25 19:30 ` [PATCH 6/9] ser_gigaset: " Tilman Schmidt
2009-10-25 20:37   ` Alan Cox
2009-10-25 23:36     ` Tilman Schmidt
2009-10-26  0:54   ` Joe Perches [this message]
2009-10-26 23:59     ` Tilman Schmidt
2009-10-27  0:14       ` Joe Perches
2009-10-27 10:20       ` Karsten Keil
2009-10-25 19:30 ` [PATCH 7/9] bas_gigaset: " Tilman Schmidt
2009-10-25 19:30 ` [PATCH 8/9] gigaset: checkpatch cleanup of ev-layer.c Tilman Schmidt
2009-10-25 19:30 ` [PATCH 9/9] gigaset: convert strcmp chain to table lookup Tilman Schmidt
2009-10-29  8:37 ` [PATCH 0/9] Gigaset driver patches for 2.6.33 David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1256518486.14711.13.camel@Joe-Laptop.home \
    --to=joe@perches.com \
    --cc=davem@davemloft.net \
    --cc=hjlipp@web.de \
    --cc=i4ldeveloper@listserv.isdn4linux.de \
    --cc=isdn4linux@listserv.isdn4linux.de \
    --cc=isdn@linux-pingi.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=tilman@imap.cc \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®