public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Richard Knutsson <ricknu-0@student.ltu.se>
To: Denys Vlasenko <vda.linux@googlemail.com>
Cc: James.Bottomley@steeleye.com, James.Smart@emulex.com,
	linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org
Subject: Re: [PATCH] drivers/scsi/lpfc/lpfc_hw.h: Some minor cleanup.
Date: Tue, 30 Oct 2007 17:41:25 +0100	[thread overview]
Message-ID: <47275EB5.1070704@student.ltu.se> (raw)
In-Reply-To: <200710301544.02765.vda.linux@googlemail.com>

Denys Vlasenko wrote:
> On Tuesday 30 October 2007 10:54, Richard Knutsson wrote:
>   
>> Signed-off-by: Richard Knutsson <ricknu-0@student.ltu.se>
>> ---
>> Diffed against linus-git
>> Checked with script/checkpatch.pl
>>
>>
>> diff --git a/drivers/scsi/lpfc/lpfc_hw.h b/drivers/scsi/lpfc/lpfc_hw.h
>> index 451accd..6f56528 100644
>> --- a/drivers/scsi/lpfc/lpfc_hw.h
>> +++ b/drivers/scsi/lpfc/lpfc_hw.h
>> @@ -3158,31 +3158,30 @@ struct lpfc_sli2_slim {
>>   *
>>   * Parameters:
>>   * device : struct pci_dev 's device field
>> - *
>> - * return 1 => TRUE
>> - *        0 => FALSE
>>   */
>> -static inline int
>> +static inline bool
>>  lpfc_is_LC_HBA(unsigned short device)
>>  {
>> -	if ((device == PCI_DEVICE_ID_TFLY) ||
>> -	    (device == PCI_DEVICE_ID_PFLY) ||
>> -	    (device == PCI_DEVICE_ID_LP101) ||
>> -	    (device == PCI_DEVICE_ID_BMID) ||
>> -	    (device == PCI_DEVICE_ID_BSMB) ||
>> -	    (device == PCI_DEVICE_ID_ZMID) ||
>> -	    (device == PCI_DEVICE_ID_ZSMB) ||
>> -	    (device == PCI_DEVICE_ID_RFLY))
>> -		return 1;
>> -	else
>> -		return 0;
>> +	switch (device) {
>> +	case PCI_DEVICE_ID_TFLY:
>> +	case PCI_DEVICE_ID_PFLY:
>> +	case PCI_DEVICE_ID_LP101:
>> +	case PCI_DEVICE_ID_BMID:
>> +	case PCI_DEVICE_ID_BSMB:
>> +	case PCI_DEVICE_ID_ZMID:
>> +	case PCI_DEVICE_ID_ZSMB:
>> +	case PCI_DEVICE_ID_RFLY:
>> +		return true;
>> +	}
>> +
>> +	return false;
>>  }
>>     
>
> Why is this patch useful? 
Just simpler to read, no?
> I'd rather do this instead:
>
> -static inline int
> +static int
>
> (this function has three callsites, thus de-inlining will
> make code smaller)
>   
It is returning (and the results are used as) a boolean so why should it 
be an integer? But I have no objection to de-inline it.
Alright with:
-static inline int
+static bool
?

Richard Knutsson


      reply	other threads:[~2007-10-30 17:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-30 10:54 [PATCH] drivers/scsi/lpfc/lpfc_hw.h: Some minor cleanup Richard Knutsson
2007-10-30 15:44 ` Denys Vlasenko
2007-10-30 16:41   ` Richard Knutsson [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=47275EB5.1070704@student.ltu.se \
    --to=ricknu-0@student.ltu.se \
    --cc=James.Bottomley@steeleye.com \
    --cc=James.Smart@emulex.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=vda.linux@googlemail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox