kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: tomas.winkler@intel.com, arnd@arndb.de,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] mei: switch from 'pci_' to 'dma_' API
Date: Fri, 27 Aug 2021 22:12:58 +0200	[thread overview]
Message-ID: <39e04750-a15d-37ec-6fa1-82591331702c@wanadoo.fr> (raw)
In-Reply-To: <YST3d2kFISWty5EI@kroah.com>

Le 24/08/2021 à 15:43, Greg KH a écrit :
> On Sun, Aug 22, 2021 at 10:02:59PM +0200, Christophe JAILLET wrote:
>> The wrappers in include/linux/pci-dma-compat.h should go away.
>>
>> The patch has been generated with the coccinelle script below.
>>
>> It has been compile tested.
>>
>>
>> @@
>> @@
>> -    PCI_DMA_BIDIRECTIONAL
>> +    DMA_BIDIRECTIONAL
>>
>> @@
>> @@
>> -    PCI_DMA_TODEVICE
>> +    DMA_TO_DEVICE
>>
>> @@
>> @@
>> -    PCI_DMA_FROMDEVICE
>> +    DMA_FROM_DEVICE
>>
>> @@
>> @@
>> -    PCI_DMA_NONE
>> +    DMA_NONE
>>
>> @@
>> expression e1, e2, e3;
>> @@
>> -    pci_alloc_consistent(e1, e2, e3)
>> +    dma_alloc_coherent(&e1->dev, e2, e3, GFP_)
>>
>> @@
>> expression e1, e2, e3;
>> @@
>> -    pci_zalloc_consistent(e1, e2, e3)
>> +    dma_alloc_coherent(&e1->dev, e2, e3, GFP_)
>>
>> @@
>> expression e1, e2, e3, e4;
>> @@
>> -    pci_free_consistent(e1, e2, e3, e4)
>> +    dma_free_coherent(&e1->dev, e2, e3, e4)
>>
>> @@
>> expression e1, e2, e3, e4;
>> @@
>> -    pci_map_single(e1, e2, e3, e4)
>> +    dma_map_single(&e1->dev, e2, e3, e4)
>>
>> @@
>> expression e1, e2, e3, e4;
>> @@
>> -    pci_unmap_single(e1, e2, e3, e4)
>> +    dma_unmap_single(&e1->dev, e2, e3, e4)
>>
>> @@
>> expression e1, e2, e3, e4, e5;
>> @@
>> -    pci_map_page(e1, e2, e3, e4, e5)
>> +    dma_map_page(&e1->dev, e2, e3, e4, e5)
>>
>> @@
>> expression e1, e2, e3, e4;
>> @@
>> -    pci_unmap_page(e1, e2, e3, e4)
>> +    dma_unmap_page(&e1->dev, e2, e3, e4)
>>
>> @@
>> expression e1, e2, e3, e4;
>> @@
>> -    pci_map_sg(e1, e2, e3, e4)
>> +    dma_map_sg(&e1->dev, e2, e3, e4)
>>
>> @@
>> expression e1, e2, e3, e4;
>> @@
>> -    pci_unmap_sg(e1, e2, e3, e4)
>> +    dma_unmap_sg(&e1->dev, e2, e3, e4)
>>
>> @@
>> expression e1, e2, e3, e4;
>> @@
>> -    pci_dma_sync_single_for_cpu(e1, e2, e3, e4)
>> +    dma_sync_single_for_cpu(&e1->dev, e2, e3, e4)
>>
>> @@
>> expression e1, e2, e3, e4;
>> @@
>> -    pci_dma_sync_single_for_device(e1, e2, e3, e4)
>> +    dma_sync_single_for_device(&e1->dev, e2, e3, e4)
>>
>> @@
>> expression e1, e2, e3, e4;
>> @@
>> -    pci_dma_sync_sg_for_cpu(e1, e2, e3, e4)
>> +    dma_sync_sg_for_cpu(&e1->dev, e2, e3, e4)
>>
>> @@
>> expression e1, e2, e3, e4;
>> @@
>> -    pci_dma_sync_sg_for_device(e1, e2, e3, e4)
>> +    dma_sync_sg_for_device(&e1->dev, e2, e3, e4)
>>
>> @@
>> expression e1, e2;
>> @@
>> -    pci_dma_mapping_error(e1, e2)
>> +    dma_mapping_error(&e1->dev, e2)
>>
>> @@
>> expression e1, e2;
>> @@
>> -    pci_set_dma_mask(e1, e2)
>> +    dma_set_mask(&e1->dev, e2)
>>
>> @@
>> expression e1, e2;
>> @@
>> -    pci_set_consistent_dma_mask(e1, e2)
>> +    dma_set_coherent_mask(&e1->dev, e2)
>>
>> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> 
> That is a lot of different things in one changelog text, yet you really
> only did a replacement for pci_set_dma_mask here.  Please clean up the
> changelog to reflect what you did, and most importantly, _WHY_ you are
> doing it.
> 
> thanks,
> 
> greg k-h
> 

Hi,

thx for the feed-back.

I've continued my serie and just sent "[PATCH] niu: switch from 'pci_' 
to 'dma_' API" where you are also in copy.

I've tried to improve the log message in it, giving references of why 
these clean-ups are done (proposed by Christoph Hellwig) and some 
reasons of why it is a good idea (argumentation from Julia Lawall)

The long coccinelle script has been reduced to only relevant parts.

I hope that this new version is good enough.


Comments on the "niu" drivers will also be taken into account when I 
will send a v2 for patches you have commented on.

CJ

  reply	other threads:[~2021-08-27 20:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-22 20:02 [PATCH] mei: switch from 'pci_' to 'dma_' API Christophe JAILLET
2021-08-24 13:43 ` Greg KH
2021-08-27 20:12   ` Christophe JAILLET [this message]
2021-08-27 20:36 ` Kari Argillander

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=39e04750-a15d-37ec-6fa1-82591331702c@wanadoo.fr \
    --to=christophe.jaillet@wanadoo.fr \
    --cc=arnd@arndb.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tomas.winkler@intel.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;
as well as URLs for NNTP newsgroup(s).