public inbox for linux-ide@vger.kernel.org
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Tom Yan <tom.ty89@gmail.com>
Cc: Tejun Heo <tj@kernel.org>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	linux-ide@vger.kernel.org, linux-scsi@vger.kernel.org,
	linux-block@vger.kernel.org
Subject: Re: [PATCH 1/2] libata-scsi: use dev->max_sectors from libata-core appropriately
Date: Sat, 13 Aug 2016 13:10:15 +0300	[thread overview]
Message-ID: <e5daafbb-e0f4-94fa-6edf-8ba0c9cced88@cogentembedded.com> (raw)
In-Reply-To: <CAGnHSEn36OgegFJHzojOPYiMzfiLe6eDgSofYHGgmtmdoUQbww@mail.gmail.com>

Hello.

On 8/12/2016 5:36 PM, Tom Yan wrote:

>>> diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
>>> index be9c76c..4e2d8e7 100644
>>> --- a/drivers/ata/libata-scsi.c
>>> +++ b/drivers/ata/libata-scsi.c
>>> @@ -1204,14 +1204,26 @@ static int ata_scsi_dev_config(struct scsi_device
>>> *sdev,
>>>         if (!ata_id_has_unload(dev->id))
>>>                 dev->flags |= ATA_DFLAG_NO_UNLOAD;
>>>
>>> -       /* configure max sectors */
>>> -       blk_queue_max_hw_sectors(q, dev->max_sectors);
>>> -
>>>         if (dev->class == ATA_DEV_ATAPI) {
>>>                 void *buf;
>>>
>>>                 sdev->sector_size = ATA_SECT_SIZE;
>>>
>>> +               /*
>>> +                * We are setting the limit here merely because CD/DVD
>>> device does not
>>> +                * have Block Limits VPD.
>>> +                *
>>> +                * Supposedly dev->max_sectors should be left shifted by
>>> +                * (ilog2(sdev->sector_size) - 9). But since ATAPI class
>>> device has a
>>> +                * static logical sector size of 512 (ATA_SECT_SIZE), the
>>> shift became
>>> +                * unnecessary.
>>> +                */
>>> +               q->limits.max_dev_sectors = dev->max_sectors;
>>> +               /* Make max_dev_sectors effective by adjusting max_sectors
>>> accordingly,
>>> +                  while leave max_hw_sectors, which is supposed to be
>>> host controller
>>> +                  limit, untouched. */
>>
>>
>>    Why 2 different comment styles? The previous comment's style is actually
>> preferred in the kernel.
>>
>
> I just tried to follow the styles of the existing comments. Apparently
> the first style is used for multi-paragraph comments, while the other
> one is used for single-paragraph one.

    Nevertheless, only the 1st comment is formatted in the preferred manner; 
see Documentation/CodingStyle, chapter 8.

MBR, Sergei


  reply	other threads:[~2016-08-13 10:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-12 11:56 [PATCH 1/2] libata-scsi: use dev->max_sectors from libata-core appropriately tom.ty89
2016-08-12 11:56 ` [PATCH 2/2] sd: check BLK_DEF_MAX_SECTORS against max_dev_sectors tom.ty89
2016-08-12 13:42 ` [PATCH 1/2] libata-scsi: use dev->max_sectors from libata-core appropriately Sergei Shtylyov
2016-08-12 14:36   ` Tom Yan
2016-08-13 10:10     ` Sergei Shtylyov [this message]
2016-08-12 14:31 ` Tom Yan

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=e5daafbb-e0f4-94fa-6edf-8ba0c9cced88@cogentembedded.com \
    --to=sergei.shtylyov@cogentembedded.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=tj@kernel.org \
    --cc=tom.ty89@gmail.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