All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Varsha Rao <rvarsha016@gmail.com>
Cc: Sathya Prakash <sathya.prakash@broadcom.com>,
	Chaitra P B <chaitra.basappa@broadcom.com>,
	Suganath Prabu Subramani <suganath-prabu.subramani@broadcom.com>,
	MPT-FusionLinux.pdl@broadcom.com, linux-scsi@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Nicholas Mc Guire <der.herr@hofr.at>,
	Lukas Bulwahn <lukas.bulwahn@gmail.com>
Subject: Re: [PATCH 3/3] message: fusion: Fix line over 80 characters
Date: Sun, 03 Jun 2018 13:03:03 -0700	[thread overview]
Message-ID: <1800e18130f7f768128feea2755f2c6ea0af7241.camel@perches.com> (raw)
In-Reply-To: <ae9327e821e82a9c9e6a41c1fa12ec02496189f2.1528031458.git.rvarsha016@gmail.com>

On Sun, 2018-06-03 at 18:52 +0530, Varsha Rao wrote:
> Line over 80 characters is split to fix the following checkpatch issue:
> 
> WARNING: line over 80 characters
[]
> diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c
[]
> @@ -5690,7 +5690,8 @@ mpt_inactive_raid_volumes(MPT_ADAPTER *ioc, u8 channel, u8 id)
>  		    buffer->PhysDisk[i].PhysDiskNum, &phys_disk) != 0)
>  			continue;
>  
> -		if (!(component_info = kmalloc(sizeof(*component_info), GFP_KERNEL)))
> +		if (!(component_info = kmalloc(sizeof(*component_info),
> +		      GFP_KERNEL)))
>  			continue;

It's much more common to split this into multiple statements like

		component_info = kmalloc(sizeof(*component_info), GFP_KERNEL);
		if (!component_info)
			continue;

but the continue in a loop with a known alloc failure
seems silly as the next alloc is also extremely likely
to fail as well.

btw: Are you actually using this code?

If not, perhaps it's better to send cleanup only patches
for files in drivers/staging as practice instead.

      reply	other threads:[~2018-06-03 20:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-03 13:20 [PATCH 0/3] message: fusion: Fix clang and checkpatch warnings Varsha Rao
2018-06-03 13:21 ` [PATCH 1/3] message: fusion: Remove extra parentheses Varsha Rao
2018-06-03 13:22 ` [PATCH 2/3] message: fusion: Replace NULL comparison Varsha Rao
2018-06-03 13:22 ` [PATCH 3/3] message: fusion: Fix line over 80 characters Varsha Rao
2018-06-03 20:03   ` Joe Perches [this message]

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=1800e18130f7f768128feea2755f2c6ea0af7241.camel@perches.com \
    --to=joe@perches.com \
    --cc=MPT-FusionLinux.pdl@broadcom.com \
    --cc=chaitra.basappa@broadcom.com \
    --cc=der.herr@hofr.at \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=lukas.bulwahn@gmail.com \
    --cc=rvarsha016@gmail.com \
    --cc=sathya.prakash@broadcom.com \
    --cc=suganath-prabu.subramani@broadcom.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.