lkml.org 
[lkml]   [2021]   [Mar]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] scsi: pm8001: avoid -Wrestrict warning
Date
On Tue, 23 Mar 2021 13:54:23 +0100, Arnd Bergmann wrote:

> On some configurations, gcc warns about overlapping source and
> destination arguments to snprintf:
>
> drivers/scsi/pm8001/pm8001_init.c: In function 'pm8001_request_msix':
> drivers/scsi/pm8001/pm8001_init.c:977:3: error: 'snprintf' argument 4 may overlap destination object 'pm8001_ha' [-Werror=restrict]
> 977 | snprintf(drvname, len, "%s-%d", pm8001_ha->name, i);
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/scsi/pm8001/pm8001_init.c:962:56: note: destination object referenced by 'restrict'-qualified argument 1 was declared here
> 962 | static u32 pm8001_request_msix(struct pm8001_hba_info *pm8001_ha)
> | ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
>
> [...]

Applied to 5.13/scsi-queue, thanks!

[1/1] scsi: pm8001: avoid -Wrestrict warning
https://git.kernel.org/mkp/scsi/c/c2255ece2be2

--
Martin K. Petersen Oracle Linux Engineering

\
 
 \ /
  Last update: 2021-03-30 05:56    [W:0.058 / U:0.124 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site