From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sergei Shtylyov Subject: Re: [PATCHv2] ide: Use NULL to compare with pointer-typed value rather than 0 Date: Sat, 18 Aug 2018 19:21:03 +0300 Message-ID: <94bdada0-e0f9-4dd2-ed6d-ad84f7114954@cogentembedded.com> References: <1534572961-16423-1-git-send-email-zhongjiang@huawei.com> <8badfdf8-ce69-1722-a489-fee161a1f4aa@cogentembedded.com> <14b562e7acdb37158190e14045fe276e9899422e.camel@perches.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <14b562e7acdb37158190e14045fe276e9899422e.camel@perches.com> Content-Language: en-MW Sender: linux-kernel-owner@vger.kernel.org To: Joe Perches , zhong jiang , davem@davemloft.net Cc: benh@kernel.crashing.org, paulus@samba.org, mpe@ellerman.id.au, linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org List-Id: linux-ide@vger.kernel.org On 08/18/2018 07:15 PM, Joe Perches wrote: >>> We should use NULL to compare with pointer-typed value rather than >>> 0. The issue is detected with the help of Coccinelle. >> >> Your description stopped to match the patch in v2. >> Actually, this X == NULL to !x preference is largely spocific to netdev... >> Although, IDE maintainer is the same now person. :-) >> >>> Signed-off-by: zhong jiang >>> --- >>> drivers/ide/pmac.c | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >>> >>> diff --git a/drivers/ide/pmac.c b/drivers/ide/pmac.c >>> index c5b902b..ca36a97 100644 >>> --- a/drivers/ide/pmac.c >>> +++ b/drivers/ide/pmac.c >>> @@ -1682,7 +1682,7 @@ static int pmac_ide_init_dma(ide_hwif_t *hwif, const struct ide_port_info *d) >>> /* We won't need pci_dev if we switch to generic consistent >>> * DMA routines ... >>> */ >>> - if (dev == NULL || pmif->dma_regs == 0) >>> + if (!dev || !pmif->dma_regs) >>> return -ENODEV; >>> /* >>> * Allocate space for the DBDMA commands. >> >> MBR, Sergei > > Perhaps discourage trivial changes to this old subsystem. > > checkpatch could bleat something if a patch was submitted for ide > if the IDE MAINTAINERS entry was marked obsolete. Note that the IDE fixes are still OK... > --- > diff --git a/MAINTAINERS b/MAINTAINERS > index e9336962d0f2..3c4992cf5249 100644 > --- a/MAINTAINERS > +++ b/MAINTAINERS > @@ -6933,7 +6933,7 @@ M: "David S. Miller" > L: linux-ide@vger.kernel.org > Q: http://patchwork.ozlabs.org/project/linux-ide/list/ > T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide.git > -S: Maintained > +S: Maintained / Obsolete (prefer LIBATA) What about "S: Odd Fixes"? Perhaps it better reflects the reality... > F: Documentation/ide/ > F: drivers/ide/ > F: include/linux/ide.h MBR, Sergei