From: Hannes Reinecke <hare@suse.de>
To: Blue Swirl <blauwirbel@gmail.com>
Cc: qemu-devel@nongnu.org, "Nicholas A.Bellinger" <nab@linux-iscsi.org>
Subject: Re: [Qemu-devel] [PATCH] megasas: Update to version 1.01
Date: Fri, 11 Jun 2010 16:11:01 +0200 [thread overview]
Message-ID: <4C1243F5.90103@suse.de> (raw)
In-Reply-To: <AANLkTimKsaKGtTlWRICzqZdndRL5SFAH7alvRyN1vnFm@mail.gmail.com>
Blue Swirl wrote:
> On Tue, Jun 8, 2010 at 2:15 PM, Hannes Reinecke <hare@suse.de> wrote:
>> This patch updates the megasas HBA emulation to version 1.01.
>> It fixes the following issues:
>>
>> - Remove hand-crafted inquiry command
>> - Remove bounce-buffer for direct commands
>> - Implements qdev properties to set 'max_sge', 'max_cmds'.
>> - Implement JBOD mode
>> - Improve direct command handling
>> - Minor cleanups
>>
>> Signed-off-by: Hannes Reinecke <hare@suse.de>
>>
[ .. ]
>> +static uint64_t megasas_gen_sas_addr(unsigned long id)
>> +{
>> + uint64_t addr;
>> +
>> + addr = ((uint64_t)0x5001a4a << 36);
>
> With 0x5001a4aULL the cast could be avoided.
>
>> + addr |= ((uint64_t)id & 0xfffffffff);
>
> This cast could be avoided by making id uint64_t.
>
Ok. Fixed.
[ .. ]
>> + memcpy(info->product_name,"MegaRAID SAS 8708EM2", 20);
>> + sprintf(info->serial_number,"QEMU%08lx",(unsigned long)s & 0xFFFFFFFF);
>
> Please use snprintf(), OpenBSD linker issues warnings for all uses of sprintf().
>
>> + sprintf(info->package_version,"%s-QEMU", QEMU_VERSION);
>> + strcpy(info->image_component[0].name, "APP");
>
> Same problem with strcpy(), please use pstrcpy(), snprintf() or memcpy().
>
Ah. Ok, Fixed.
>> - return offset;
>> + if (info->vpd_page83[3] == 0) {
>> + req = scsi_req_get(sdev, (uint32_t) -1, lun);
>> + if (!req)
>
> This would be against CODING_STYLE but nobody seems to care.
>
... And quite some other places, notably the tabs vs. spaces issue.
Fixed now.
[ .. ]
>> +
>> +struct dcmd_cmd_tbl_t {
>
> static const?
>
If you feel like it, okay.
[ .. ]
>> + DPRINTF("Using %d sges, %d cmds, %s mode\n",
>> + s->fw_sge, s->fw_cmds, s->is_jbod?"jbod":"raid");
>
> Please add spaces around '?' and ':'.
>
Ok, fixed.
Thanks for the feedback. I'll be including the fixes with
the next patchset.
Cheers,
Hannes
--
Dr. Hannes Reinecke zSeries & Storage
hare@suse.de +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Markus Rex, HRB 16746 (AG Nürnberg)
prev parent reply other threads:[~2010-06-11 14:11 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-08 14:15 [Qemu-devel] [PATCH] megasas: Update to version 1.01 Hannes Reinecke
2010-06-09 10:14 ` [Qemu-devel] " Nicholas A. Bellinger
2010-06-09 10:32 ` Hannes Reinecke
2010-06-09 11:11 ` Nicholas A. Bellinger
2010-06-09 10:47 ` Nicholas A. Bellinger
2010-06-10 17:13 ` [Qemu-devel] " Blue Swirl
2010-06-11 14:11 ` Hannes Reinecke [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=4C1243F5.90103@suse.de \
--to=hare@suse.de \
--cc=blauwirbel@gmail.com \
--cc=nab@linux-iscsi.org \
--cc=qemu-devel@nongnu.org \
/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;
as well as URLs for NNTP newsgroup(s).