From patchwork Fri Feb 2 13:12:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 126703 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp630785ljc; Fri, 2 Feb 2018 05:12:55 -0800 (PST) X-Google-Smtp-Source: AH8x224DBLU5lPTJe+Fd+J3jsMIFO/+nQqU+7xm2kdKGxHsGfUR3ZCFrtaKmGKX9OdbzaFH4Ntc9 X-Received: by 10.99.100.7 with SMTP id y7mr4226993pgb.359.1517577175532; Fri, 02 Feb 2018 05:12:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517577175; cv=none; d=google.com; s=arc-20160816; b=vKFoDWG6JTmTe9Bqcgbx9ZJ9z0VquD+zEf7HzbUSxxkg0AfSxqXDI6rLLekWmP+C6K 3/i+x8Eng1yGdgaotu3VxMUMMvCXuMcR2B6wSzh0lV+EiADa99GBnBFd35OY1BN8Z2DN cd94opbA4ubICcY36+V4NntlMlLB5sWs9PpS+acJXnUuEiJmeHcyWoGVHQ/ffXPE769K qPAYYKyLnqRrCfEuVh9Cc5nb2pyFfUHR3asLzQAqid5LJPycnDDD/E2c7Y9pTOCH0xau Gm+idK8jFEDl4KWdHaVlgqxw2MtLrJuo4xtcsxLcMNg/a29qFhNzDa8UxrDab4ua+XE3 SlYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=0PJ2tA9YB1WOtYQkDEIBeEp0SNvAshA9Epy/BgiZ0JY=; b=iZOa9aws8Yp81MCiiYoBkpo++RPFWpLfQsXnBTOfEPL6Nw48r66L49cczk4fe44XEG aD6j5PSfZVVLhksGWiYHG3mRrG4Il15oQWod8SOtsyqlld6d6zigFiCmN1Nod046N8MR t92G6Ltxm0y+EXCNbEEAGBh777wj6dJSanEUmzaNsC1YSbnSnc1qOkEAYBhjWHlScXEL S+Ln3nKK9c4M5Y0oqtMB50w66reYfsbVU92hIV+PzhMo8swmRUcdwe99BUU0jWUOvi1c DZJati6QAAB+uVY8zkifA/pAx9Tk+A/hrxYTo6piHW2VE5seMnalXDbJL+qWYbsISjlz ti8g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b59-v6si1766612plc.302.2018.02.02.05.12.55; Fri, 02 Feb 2018 05:12:55 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751697AbeBBNMy (ORCPT + 1 other); Fri, 2 Feb 2018 08:12:54 -0500 Received: from mout.kundenserver.de ([212.227.126.135]:52581 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751634AbeBBNMx (ORCPT ); Fri, 2 Feb 2018 08:12:53 -0500 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue003 [212.227.15.129]) with ESMTPA (Nemesis) id 0M4VfU-1evzli3pD2-00ykVR; Fri, 02 Feb 2018 14:12:39 +0100 From: Arnd Bergmann To: linux-scsi@vger.kernel.org, "James E . J . Bottomley" , Johannes Thumshirn , "Martin K. Petersen" Cc: Nicolas Pitre , Andi Kleen , Arnd Bergmann , linux-kernel@vger.kernel.org Subject: [PATCH 1/6] scsi: fc_encode: work around strncpy size warnings Date: Fri, 2 Feb 2018 14:12:15 +0100 Message-Id: <20180202131225.1658853-2-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180202131225.1658853-1-arnd@arndb.de> References: <20180202131225.1658853-1-arnd@arndb.de> X-Provags-ID: V03:K0:dz8PWAnrvHGNo9daKGFlUcYqCoVYuoWYUOMtFcbnMQBPU9c86Jo w0fkQ/pjpPOF/DX85KYhKQhESxyxv3BA2FFIvE+MAY8umP/7CPXtXXLeRyfU4VOeovpExOs NJqpUDcYA04h4QhZltCYvbUnMrSt8zh3vPI5Ery/HfzDIh0+wluegoIWQ35fPkO//Dlw7NH boKEZYnZjk+RYsHVnMmtw== X-UI-Out-Filterresults: notjunk:1; V01:K0:FhCeIQgWm3I=:tQgb50UJ3E7LBP/syMLpXp 3TktEnVx67yolLqPNlrtaUq97y2cAD7yaigo4j760XiaPMemiAz9QDMQKTsU5aapE/GMbdQZp 5LYFKf2VgjD7qT8Ol7vZpWVZA+F1cybUGeTuSI83axwgyEp8zSu8DLjkiSCUhrNeiBRyuE10v BWeWOFocvlGhnQ7XXJhmLQIW+cvhqRMcVO6DkXLHRyhzEgLLT4RL0HIvELK98MIPfwYr+OETt 6VGtstnbojD32hptGpABemxv579qmGRbE0c3a4riGl2oCooPANjcsQFEX4xRMQaO93mBcPrY+ Pz/m+IqoMnHV5pr50FiBRos/F4jyp8xsfcVdAsCJ2TMJQJEaZnx04Py0O7NlRY3WVw8hbh8+4 1vkzSrtuWEszs/5O+0wuWcEbtQaBxVBNtRR1Ss9Bkr76rfg0jdM9ER60GZ1GqbDMOh/7CJDtZ TxBUeY9mG7udsIMLtdxvvDgtYcYjYGJo1mHOwjrIuDwB9c9avNRPNEWFpH8HqMUGahd5zOy0y eSohg5Sm4EMvEIHjMSMsBocdndWyvhwcXJYcx/J9+U8kwsGGUxWOnWduIggF1/B3K0Wbjdtkn cBAWq2+zbueDLqikYAer37MDEZAko6+zPizZT0Q53mykExIqvpwthOsmao2kxFNKTOPNWuhAx ALCA7bRj6baO56SOERIJ5g66p7+wKhKYEPv7X/nKMOLUEbRXVWQagY9fZgB1a18FI6BjPG3n4 BVMHDFln6pCNO7Q6qx5vPAhunUosnvnBmvqIMA== Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org struct fc_fdmi_attr_entry contains a variable-length string at the end, which is encoded as a one-byte array. gcc-8 notices that we copy strings into it that obviously go beyond that one byte: In function 'fc_ct_ms_fill', inlined from 'fc_elsct_send' at include/scsi/fc_encode.h:518:8: include/scsi/fc_encode.h:275:3: error: 'strncpy' writing 64 bytes into a region of size 1 overflows the destination [-Werror=stringop-overflow=] strncpy((char *)&entry->value, ^ include/scsi/fc_encode.h:287:3: error: 'strncpy' writing 64 bytes into a region of size 1 overflows the destination [-Werror=stringop-overflow=] strncpy((char *)&entry->value, ^ No idea what the right fix is. Signed-off-by: Arnd Bergmann --- include/scsi/fc/fc_ms.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.9.0 diff --git a/include/scsi/fc/fc_ms.h b/include/scsi/fc/fc_ms.h index f52b921b5c70..c5614e725a0e 100644 --- a/include/scsi/fc/fc_ms.h +++ b/include/scsi/fc/fc_ms.h @@ -128,7 +128,7 @@ struct fc_fdmi_port_name { struct fc_fdmi_attr_entry { __be16 type; __be16 len; - __u8 value[1]; + __u8 value[]; } __attribute__((__packed__)); /* From patchwork Fri Feb 2 13:12:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 126704 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp631195ljc; Fri, 2 Feb 2018 05:13:24 -0800 (PST) X-Google-Smtp-Source: AH8x225ofPEkruF5qEP7rCJPb9v2NcO1PYVVlPyUfzsu/Ai5dEYFCXns2GImA3JjYZpuN54/q07G X-Received: by 2002:a17:902:223:: with SMTP id 32-v6mr35919456plc.77.1517577204253; Fri, 02 Feb 2018 05:13:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517577204; cv=none; d=google.com; s=arc-20160816; b=Fz5lkUuLwTbTDBmYfLtxrSErTmSIxtbrl6FC9FlX0ZWoNUHAqb+KzUqwXmUPXhg4Sb 5UaiLZp3KvE/cciKiaJIRrqkghK5sw04qCx3LJ5Pvet0RobnS+Bneh6eCIsfk0Ux1Trl CDhBiyGm8ukhDGzlDKty+o+/6TLLwVughgGeMuh+11I/ynpA5LsfDHJHniVixYgs7MGy 5jPqdTYsZP6+yMI8jXrwwxO4Sv1wlw3RdkRQ3/4NHx6OPH+Pw6t1V1IEvMPeh3+jXswD 9dYr+SpqwVPq3+JLMOPIjOfetmr3jsxNa/cF0j3vXzfZ5meAX+bQEnrBbi4F9+cQkXda 4/7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=QIx0mgyePEZPHCLf2ZeBkUTSIPicfL31Gs+0wuXpiMs=; b=O84iz4LuaML4Aw7pL53+n3dyIK+kURQKgI32E/7FoztSeVNoBxlzhyMVm/VrSKFxad 97nELXaAnQ/P28QmafPcdNNLlliCgVtCX+CKXGVO8VBtB6p9T34epEHSmg8n2VJaosiR JN1cUbo7zc0sfJznK3bB+Twd47KhsS6DnauydZr/Pw6WP2J2+6hBcVlRL6IdOCLtqEiY axbwfeqznlWvTeYyFqqrTatqfjbD4O00Hgur99xkCWLKjenvMMJrvMuaMg0pU1OvNJcg EbtcqkVDkGXRVhSJDJJclqO5pK8ZUYhlhPdcbzAWInWfxUX7tOIp7vPbNsLuTYG6OyW2 uGpA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m15-v6si1864917pln.714.2018.02.02.05.13.24; Fri, 02 Feb 2018 05:13:24 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751638AbeBBNNV (ORCPT + 1 other); Fri, 2 Feb 2018 08:13:21 -0500 Received: from mout.kundenserver.de ([212.227.126.131]:62108 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751416AbeBBNNV (ORCPT ); Fri, 2 Feb 2018 08:13:21 -0500 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue003 [212.227.15.129]) with ESMTPA (Nemesis) id 0MYJ7N-1eCzJl1Dwv-00V8uW; Fri, 02 Feb 2018 14:12:44 +0100 From: Arnd Bergmann To: linux-scsi@vger.kernel.org, "James E . J . Bottomley" , "Martin K. Petersen" Cc: Nicolas Pitre , Andi Kleen , Arnd Bergmann , linux-kernel@vger.kernel.org Subject: [PATCH 2/6] scsi: NCR53c406a: avoid section mismatch with LTO Date: Fri, 2 Feb 2018 14:12:16 +0100 Message-Id: <20180202131225.1658853-3-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180202131225.1658853-1-arnd@arndb.de> References: <20180202131225.1658853-1-arnd@arndb.de> X-Provags-ID: V03:K0:YiX/S4C7AZzl1ZRkL/ZfgKL7eJ+TgFZ3OOrBDk4TV8DDokgB7+2 RxA+2xbU6E2LHoKV4M/4er11qchYq3vq1YA8yjVNLTB1BY+EL10nAt9KNTF0kqNNCHaH0Tl yG0UdW++i1C2lGEmmBCMdJoPtrKRqipVVFT8iE1oZWS3qdm1g3FCtkXRyyudASryi9ritL9 Ed3UMiu4/RJrnfoaVr1tA== X-UI-Out-Filterresults: notjunk:1; V01:K0:4xtqviWg+ak=:eOHwGyy+h1NGu2t/NTAeDG /0dEkb4bIltlV1/DN5/Oq7zLZB7N7bCqSJfoE5kuGwomQgIeeiPG5ju5tfUhPboxz5ekb7EyE SbaYsvYCMT7qMw3RTHbn5yCMI8RadUOfVK1RsHYw4GRen7sqgvqq/xC5A+pB/H3Zb7zird575 avws5xga0NR67O6MLc9RT49FEkB56N6j+pd7/K7troOr10ilt7NcP6JToUd+k0L7rSwJwJ0Wp nJawRs98UmcxB1igKNNBvMj3JMmdzhUcPDvDGTmu/98Qu/G71g6/A9Fc0vuvb1/qLTX6hDwmK tfw0UTGP6wj35MeiYPRu6jOgox+vjRtdozIPqahJ8Q01PhgLOrEHZKuBOzp7YKPIvV3uWf9kc sxzgbyHcuk7gxH4t6S6bTfdfRoA0dhh6zRQ2aFdlm5WYSBDqVThJ4bXLBHvgdhMa9Ymp/pJ/T PoV5/B7OrSVKvh40JIgQg+Jxh9fSd8pYe2fuQvMgsXWrRZcvDguKLXy0IurmQ+DSWAnoOn8f0 S8Hmx3ebpCaDbISCGnxHpS8qz4WMl09cFP8uysEIt9ivPoch3fiiJJsmfPLS9xSviidPNy14C DNJrm0Nstp7lK4SwpircbpA1iLEHKfXNW8PuR9ejKQa5IGvUihCwSnQ/nYwKFugMMP7ISPUh8 jbNHEtMIUdl8U+vmD6CGdyp/2GwF8SvToLOOtwu1ZrZ3/Sn0Ovamj3i7j/6b0/PnlSJap0Jo/ yU7JHvrDhCCO/2V9vKW7evkQ0/GCLM0MlNZ54A== Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Building with link time optimizations produces a false-postive section mismatch warning: WARNING: vmlinux.o(.data+0xf7e8): Section mismatch in reference from the variable driver_template.lto_priv.6914 to the function .init.text:NCR53c406a_detect() The variable driver_template.lto_priv.6914 references the function __init NCR53c406a_detect() If the reference is valid then annotate the variable with __init* or __refdata (see linux/init.h) or name the variable: *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console The ->detect callback is always entered from the init_this_scsi_driver() init function, but apparently LTO turns the optimized direct function call into an indirect call through a non-__initdata pointer. All drivers using init_this_scsi_driver() are for ancient hardware, and most don't mark the detect() callback as __init(), so I'm just removing the annotation here to kill off the warning instead of doing a larger rework. Signed-off-by: Arnd Bergmann --- drivers/scsi/NCR53c406a.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.9.0 diff --git a/drivers/scsi/NCR53c406a.c b/drivers/scsi/NCR53c406a.c index 6e110c630d2c..44b09870bf51 100644 --- a/drivers/scsi/NCR53c406a.c +++ b/drivers/scsi/NCR53c406a.c @@ -448,7 +448,7 @@ static __inline__ int NCR53c406a_pio_write(unsigned char *request, unsigned int } #endif /* USE_PIO */ -static int __init NCR53c406a_detect(struct scsi_host_template * tpnt) +static int NCR53c406a_detect(struct scsi_host_template * tpnt) { int present = 0; struct Scsi_Host *shpnt = NULL; From patchwork Fri Feb 2 13:12:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 126707 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp635178ljc; Fri, 2 Feb 2018 05:18:16 -0800 (PST) X-Google-Smtp-Source: AH8x225b5vhOBVHrLRKRsL8bCkDT2LD8TcMrW/1zU4cU8N0noC/Pn411WXb0r//Ef/jGUEdrJAl8 X-Received: by 2002:a17:902:3363:: with SMTP id a90-v6mr34126943plc.159.1517577496767; Fri, 02 Feb 2018 05:18:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517577496; cv=none; d=google.com; s=arc-20160816; b=fyk0TfAtx39uCpXb9hW2FV28+IJBRK3Swes0M2mZ7Nhi7I6aL4uBMLbkJ4IDonnu+F Sk7clfocK5rv2nottSNIWfUdpNxxhjOl16kwcvfJBz/3ZUGKGlMDNUAa/C3gSCWe+2I2 QXl62iSzS6rOHFsfM6pFIlo68VV3i4+ZpCdF2vJTofuHkPQ+E5+rcURDAJXYylQZMJyg iYehRApcw1SOgll+pfl8x19cNa4tHJPHw0NkTdAN+5FKbbYYcxsAWEZIKzfpNyqBgVtd /XvXs4lh2km/MG8VaU+BzkwQ1FWD4DrBvclm2louOW1iA/nV0e+bPWR8X6XsPjtCkY7H 9UBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=OOLE7gp00HTmlSijkCP4EXpiXpFBDI8cz6zfvfv/vJM=; b=qhvRzPVLtv7eXI2ylBTypV1cbX/ej8tB2dY6l5o1PwWsphYAKXhHUWSTCH2U+uwr+D sVa0wgy4OCZQu/xBtFngTyi6NjLkmbqVikyRPFLg2l5vzyiEardD5srwDWuwYRS5+xM8 WjcpbEfru0gUyR4qH1CvSJu8SrK7RNNU8wf/ZGbun9kkccsCoVfRYloegS2QFCEEtmbr oyRfcIskls7VQbeWIkUjj023AthxOG5wXysNbouReUBrdtRjqDaQ5xm7+ba8PI5WTmAN MqKya10yLJnRq0jGSJpUWpLh8ug9Bg38mSHXeUK10WEn5EFQxc5KlOwLZLlaSjMFlXTs x4Kw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y40-v6si1768643pla.319.2018.02.02.05.18.16; Fri, 02 Feb 2018 05:18:16 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751767AbeBBNSO (ORCPT + 1 other); Fri, 2 Feb 2018 08:18:14 -0500 Received: from mout.kundenserver.de ([212.227.126.187]:56919 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751709AbeBBNSM (ORCPT ); Fri, 2 Feb 2018 08:18:12 -0500 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue003 [212.227.15.129]) with ESMTPA (Nemesis) id 0MDCnY-1eVUjd3qlY-00GVlt; Fri, 02 Feb 2018 14:12:50 +0100 From: Arnd Bergmann To: linux-scsi@vger.kernel.org, "James E . J . Bottomley" , "Martin K. Petersen" Cc: Nicolas Pitre , Andi Kleen , Arnd Bergmann , linux-kernel@vger.kernel.org Subject: [PATCH 3/6] scsi: sym53c416: avoid section mismatch with LTO Date: Fri, 2 Feb 2018 14:12:17 +0100 Message-Id: <20180202131225.1658853-4-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180202131225.1658853-1-arnd@arndb.de> References: <20180202131225.1658853-1-arnd@arndb.de> X-Provags-ID: V03:K0:nlqpScef+VnKmKfKY5WGznwFLfkiu6WqOqPaTPPhVr22f//NWIU Rz+xiBTELZ6R+t1J91VfnRmRcfHbWwBPxtd+epzs0vP61VgQB0FpLhxhGj31SfEnnHSC0Hg EuQb5X6dQcnWO0Jaw/FHvNT8y64RzJmKM+CkZvbvBPz9UhE+U88Ee+c+E+hfGQfCe2LbN1R LIPY2DqhcnHICjSQ2BG4Q== X-UI-Out-Filterresults: notjunk:1; V01:K0:awnMV8IkLbA=:dBYWJD77Cy3XnDIn9RLTfs fXrOpE7SyNxzGn5sT2719DMKbUb/PHiCNTT94JLPRf2thkqDqhC8gc5oFWKD/EjWZ4iLUqWbf pNCx10f3uuaWXGWqRNTC5b9QTqIO+3TLMVShE9ItQ/GMSBY+e3wYOyH6TjkTGksXj5fEwfBYx ByK3ITKw/Yi5KUGkTyqE0GzsGEtvJRldaVX6t5JLCD6VLXMbrkROSninT0wWTkhS3ej+aQmMn srhjOdxWivASR7A3KfiXngRsrbv+KQGLFCWqFh22miC03ouqYqUtYPYtScSiWyA17RbPbrlbO 94qnjdUuupqq95fT4LT7bH4WbVr8v5+RVRhOdwmI9UnieHOg1HT96+yHy/BTvxE9IwjR62XAr OSuUnYGWu+WC8N5PzjpV/pShMqinliDe0TRzRc123Mrr70/tyzkHhGReSNXF7AG5fZtEU5DhZ ad/FcplpJ3oxQNxwOrzalG9nYKhF0EokX++kIgGfEuPVRtw2gLHyhVMFNZpK6RQmdEfrrvk1T ewEB5EP1t3dcb26KbxapYBk4wvGdBwOlCAqF2FCe/V0MiTCLfNzMFA1S2VTIaI5C2TzeuebZx YHZ8zUwPcqRhImW3QA5jTPHNQFOF+T30FVD1QZSFO0pYoFVtuCdiWS4j4OaHpWvscImNLSJ4W NXzXiiVFb5jU2C4hfeMxdsXmAI3kVDCIQbwzBEL17cMeLfL8uHclXkSuQrqvVu+HRt1/fkYuf 6qhKvHYMQvOuhvyt43VPj0fPY8XkAIwwtLZLRw== Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Building with link time optimizations produces a false-postive section mismatch warning: WARNING: vmlinux.o(.data+0xf8c8): Section mismatch in reference from the variable driver_template.lto_priv.6915 to the function .init.text:sym53c416_detect() The variable driver_template.lto_priv.6915 references the function __init sym53c416_detect() If the reference is valid then annotate the variable with __init* or __refdata (see linux/init.h) or name the variable: *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console The ->detect callback is always entered from the init_this_scsi_driver() init function, but apparently LTO turns the optimized direct function call into an indirect call through a non-__initdata pointer. All drivers using init_this_scsi_driver() are for ancient hardware, and most don't mark the detect() callback as __init(), so I'm just removing the annotation here to kill off the warning instead of doing a larger rework. Signed-off-by: Arnd Bergmann --- drivers/scsi/sym53c416.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.9.0 diff --git a/drivers/scsi/sym53c416.c b/drivers/scsi/sym53c416.c index 5bdcbe8fa958..e68bcdc75bc3 100644 --- a/drivers/scsi/sym53c416.c +++ b/drivers/scsi/sym53c416.c @@ -608,7 +608,7 @@ static void sym53c416_probe(void) } } -int __init sym53c416_detect(struct scsi_host_template *tpnt) +int sym53c416_detect(struct scsi_host_template *tpnt) { unsigned long flags; struct Scsi_Host * shpnt = NULL; From patchwork Fri Feb 2 13:12:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 126705 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp631595ljc; Fri, 2 Feb 2018 05:13:50 -0800 (PST) X-Google-Smtp-Source: AH8x226UDgUIjFcL92465aWF3vLXaH3kzQWidvsvK6+2zQkgb1lmk/Ha+nkmqfvuXvOhKasLsZT8 X-Received: by 10.99.50.66 with SMTP id y63mr31074694pgy.157.1517577230699; Fri, 02 Feb 2018 05:13:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517577230; cv=none; d=google.com; s=arc-20160816; b=ZLV0TORJuDAdXBScX6G9hgfm5FYcautBFheo+GSpBnzhe4biRUH4rMOeq4/oh7ZNJb Dgs0ZVj0h81q+fm2iR3NOxxOX5x8Mml1O2DHO6c2THUm0e3ihqp6H8VvbbUlXQEA8jN3 OxXLl6+uud0mNEuffrKVgAalEn3ZMY3NOMzYlBnJOTAVCv+s7dQ9iZxujv7NzYvCCHdP m8GNCd1hanTEfFIkaRnZwEcrbAP/0Fdscphvlu6Tbib6prgoA5hF7QEXTMveEyHsikJY T0jlHPclkdr6w5s75Ow1Q8m6vvRQC92IxAe6AZ42X5IyiZYRmvlIXhH8dPe3FwVj+ZsO N7dQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=iHZa0EwITs9G3Ny/RgJvO5gchLdzHSsQfq9ahTFlMe4=; b=beRxE78Yba9P9Mpoz4dtoAHzxG/S8zOzyQnChB4xT3M6qdpD7FEdqnHjHJu3lWX5c6 B9lTioKXDBBBc+ed0KhfNz4nBMSsjnytpg04QasC/UEpZaLpvnK0rn1/CjjFUx05Iwko VI6PPJsIrMexv9R/yRL+y1B8ivtY5FTqEItQ3eZXjmAz/xMmS/g5cNFeYb/Hiep95gvn 32fvWHwYJPU0bYSF0S9272YpgqSofPS/h4+BCqe85jg4YqF+/WCICmz7AIAAdlndZQGR NhmUoUe8cx44d9k0XUVZcxH9qaxnMhQY3PRKCmSQcSRpX4hRvDXViTIFGuIuBW0vq/KI ukgg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s59-v6si1793914plb.699.2018.02.02.05.13.50; Fri, 02 Feb 2018 05:13:50 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751567AbeBBNNt (ORCPT + 1 other); Fri, 2 Feb 2018 08:13:49 -0500 Received: from mout.kundenserver.de ([212.227.126.131]:61939 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752018AbeBBNNd (ORCPT ); Fri, 2 Feb 2018 08:13:33 -0500 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue003 [212.227.15.129]) with ESMTPA (Nemesis) id 0MIAsE-1ejG6q1PiA-003ur9; Fri, 02 Feb 2018 14:13:18 +0100 From: Arnd Bergmann To: linux-scsi@vger.kernel.org, "James E . J . Bottomley" , QLogic-Storage-Upstream@cavium.com, "Martin K. Petersen" Cc: Nicolas Pitre , Andi Kleen , Arnd Bergmann , Chad Dupuis , Nilesh Javali , linux-kernel@vger.kernel.org Subject: [PATCH 4/6] scsi: qedf: fix LTO-enabled build Date: Fri, 2 Feb 2018 14:12:18 +0100 Message-Id: <20180202131225.1658853-5-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180202131225.1658853-1-arnd@arndb.de> References: <20180202131225.1658853-1-arnd@arndb.de> X-Provags-ID: V03:K0:XKhv13ABGqX4aYN41QKbFtJrLkp0iWr+AIds93sX+vcv4lFFe6U KUbh7FGJuJEHkCF3OcyOShsb/YN6VJ20TdhwtjjtpucA3IMO8MR6Gvr/vxSGxFvdihj+PRE HBd5YzFjr0zwAxOweTEHVgyeZKtIDlReRoVNJVM/4vbeaJVp+Z2pnZO08yNKWhGXki6yxvG dSujsbxqJlPP1nFtI+Miw== X-UI-Out-Filterresults: notjunk:1; V01:K0:wGzrPlugq/M=:GZMsKMrkuVtNWE/FqCcszu /9VJ0ab6K3fRP5uDCsQ9TfutUk4cginQBNMSoeiUJ6TSllFi47qAuBzPLhj6n4jth2MpPYezE nmT2zAMsYCLtf32gtVrA2x4W9HtP6GoQM+97dHoUPonGk3Z37+VzK5/+O3o9H9/NQwjkeQBxv BYpuL5sFu6sm5FqmbJ08AlsVvXA/G8Phy/12TAElnp+JEHfaTsdu6rGuIDMklybr7Jn0IDu8N k6rYvTwdQE2fLFtDhR8/hGfgBN/PAlcqqKDC8iykCABR21HJTmRRlVuLYempdVqyDy2yHMwei r5LJvlk94xJQhcuZF5GHv5Y3ZgCWCVZM2PTumo/iWTH5gTbELE9CE2fANSJIN6oqVdpPSE/oU ZkuMoOJ5UwZ/jdfVa3/lYdzBX2eWXj7TnHPAAzR/mUdis4PnM7OVvz3iRVPZRXaoW5ZCZIynv U2lwbFBlvvSXK1qmOMn/N+gSzItra8nGSjzOjpDMQolA5EHDvfmUoTFBgH3aW5aZdhtTWXIRg s0SZmBJQHKa00Sm4OQJdidisaff46vvtWtrVhGn2na/Da5WasHtKf+zH2srdp7xt8nHG9ZFxI 9ADfiwALbS7xSA8wBhmrYMe1oWIVX5GTwkc36NsXQLUZNQt47R9rY043bEcrFrfNC7blfpYpf R4Mws4+k6QXt7TFjOyymqEr9d/T5Y53UaALZ0psz2JMGFYipQd1/Gs0uVaMZUOWyFJj7PmnRS L6O0lDpCQU3oTKmuLm9ThkFnbud0ENyPbd76eA== Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org The prototype for qedf_dbg_fops/qedf_debugfs_ops doesn't match the definition, which causes the final link to fail with link-time optimizations: drivers/scsi/qedf/qedf_main.c:34: error: type of 'qedf_dbg_fops' does not match original declaration [-Werror=lto-type-mismatch] extern struct file_operations qedf_dbg_fops; drivers/scsi/qedf/qedf_debugfs.c:443: note: 'qedf_dbg_fops' was previously declared here const struct file_operations qedf_dbg_fops[] = { drivers/scsi/qedf/qedf_main.c:33: error: type of 'qedf_debugfs_ops' does not match original declaration [-Werror=lto-type-mismatch] extern struct qedf_debugfs_ops qedf_debugfs_ops; drivers/scsi/qedf/qedf_debugfs.c:102: note: 'qedf_debugfs_ops' was previously declared here struct qedf_debugfs_ops qedf_debugfs_ops[] = { This corrects the prototype and moves it into a shared header file where it belongs. The file operations can also be marked 'const' like the qedf_debugfs_ops. Signed-off-by: Arnd Bergmann --- drivers/scsi/qedf/qedf_dbg.h | 17 ++++++++++------- drivers/scsi/qedf/qedf_debugfs.c | 6 +++--- drivers/scsi/qedf/qedf_main.c | 8 +++----- 3 files changed, 16 insertions(+), 15 deletions(-) -- 2.9.0 diff --git a/drivers/scsi/qedf/qedf_dbg.h b/drivers/scsi/qedf/qedf_dbg.h index 50083cae84c3..77c27e888969 100644 --- a/drivers/scsi/qedf/qedf_dbg.h +++ b/drivers/scsi/qedf/qedf_dbg.h @@ -116,6 +116,14 @@ extern int qedf_create_sysfs_attr(struct Scsi_Host *shost, extern void qedf_remove_sysfs_attr(struct Scsi_Host *shost, struct sysfs_bin_attrs *iter); +struct qedf_debugfs_ops { + char *name; + struct qedf_list_of_funcs *qedf_funcs; +}; + +extern const struct qedf_debugfs_ops qedf_debugfs_ops[]; +extern const struct file_operations qedf_dbg_fops[]; + #ifdef CONFIG_DEBUG_FS /* DebugFS related code */ struct qedf_list_of_funcs { @@ -123,11 +131,6 @@ struct qedf_list_of_funcs { ssize_t (*oper_func)(struct qedf_dbg_ctx *qedf); }; -struct qedf_debugfs_ops { - char *name; - struct qedf_list_of_funcs *qedf_funcs; -}; - #define qedf_dbg_fileops(drv, ops) \ { \ .owner = THIS_MODULE, \ @@ -147,8 +150,8 @@ struct qedf_debugfs_ops { } extern void qedf_dbg_host_init(struct qedf_dbg_ctx *qedf, - struct qedf_debugfs_ops *dops, - struct file_operations *fops); + const struct qedf_debugfs_ops *dops, + const struct file_operations *fops); extern void qedf_dbg_host_exit(struct qedf_dbg_ctx *qedf); extern void qedf_dbg_init(char *drv_name); extern void qedf_dbg_exit(void); diff --git a/drivers/scsi/qedf/qedf_debugfs.c b/drivers/scsi/qedf/qedf_debugfs.c index 2b1ef3075e93..c539a7ae3a7e 100644 --- a/drivers/scsi/qedf/qedf_debugfs.c +++ b/drivers/scsi/qedf/qedf_debugfs.c @@ -23,8 +23,8 @@ static struct dentry *qedf_dbg_root; **/ void qedf_dbg_host_init(struct qedf_dbg_ctx *qedf, - struct qedf_debugfs_ops *dops, - struct file_operations *fops) + const struct qedf_debugfs_ops *dops, + const struct file_operations *fops) { char host_dirname[32]; struct dentry *file_dentry = NULL; @@ -99,7 +99,7 @@ qedf_dbg_exit(void) qedf_dbg_root = NULL; } -struct qedf_debugfs_ops qedf_debugfs_ops[] = { +const struct qedf_debugfs_ops qedf_debugfs_ops[] = { { "fp_int", NULL }, { "io_trace", NULL }, { "debug", NULL }, diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c index ccd9a08ea030..284ccb566b19 100644 --- a/drivers/scsi/qedf/qedf_main.c +++ b/drivers/scsi/qedf/qedf_main.c @@ -23,6 +23,7 @@ #include #include #include "qedf.h" +#include "qedf_dbg.h" #include const struct qed_fcoe_ops *qed_ops; @@ -30,9 +31,6 @@ const struct qed_fcoe_ops *qed_ops; static int qedf_probe(struct pci_dev *pdev, const struct pci_device_id *id); static void qedf_remove(struct pci_dev *pdev); -extern struct qedf_debugfs_ops qedf_debugfs_ops; -extern struct file_operations qedf_dbg_fops; - /* * Driver module parameters. */ @@ -3155,8 +3153,8 @@ static int __qedf_probe(struct pci_dev *pdev, int mode) } #ifdef CONFIG_DEBUG_FS - qedf_dbg_host_init(&(qedf->dbg_ctx), &qedf_debugfs_ops, - &qedf_dbg_fops); + qedf_dbg_host_init(&(qedf->dbg_ctx), qedf_debugfs_ops, + qedf_dbg_fops); #endif /* Start LL2 */ From patchwork Fri Feb 2 13:12:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 126708 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp636036ljc; Fri, 2 Feb 2018 05:19:24 -0800 (PST) X-Google-Smtp-Source: AH8x226LuVUDlhufdxiLJtycDJML0XJGlhV9a6yC6YOwTY3cG5z/9a4gn+fOa+98FMvg9RhGruxe X-Received: by 10.99.165.28 with SMTP id n28mr4458980pgf.103.1517577564498; Fri, 02 Feb 2018 05:19:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517577564; cv=none; d=google.com; s=arc-20160816; b=Ha35pgoWYeMTUp7ZMxkefZc+boKDfNJr/tuOmNEn2JmT3BW5v02/bxMSamZDzb1Jy/ cbzydl6UGaZ+3//K0NGRzCfOpIzvTUkuwXi2PNl2XKMV98Fk1V8+k6b4dro0CbZ2JlGd MhMZTIuHkMItNqFKpX6vSnlCd9STwn6MgjIpx1GovvHgIJgUnjPCRUTi9RKZArVyxTHI WJyTRfZxy9m3np9tnxh98bDuBHrr6XRdw33ah+dKcXMzoi8F6QsqYTZ6/mzauVWs3gma 3AJvXN5XoNB/5s3eWELBtrD06guqlCUwRLhuZNw1FKHXx7CypJGKZ5AJCN0By8kNQnt8 pXGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=o/Qy4ZbrgpnoWWyZuEvUs1pvXalSGSLgKQU7Ee4ESAQ=; b=YVDXs98U/8MbcouS/QwreeTL/I6kndB2awPs+1ljuy3J0llqNUzshqXLwdPT9SfpUK 94fUKQiUKdyxcWe3BbJ6yYNmi2/ZPldfH/cYIApJl/uEsqJMQZfuUTqwlmNpseu+Iw4L UD0RQsYZoVXvxQJ5VFLOO6Hht0HULRhLkIW/s8erUnoh8g3plFCsc/Ods0ki14Dvr1rY 6Rfxtcsr/BmsFiejXmRsg3In8OJwpcOKv6vyeybB3LKnpMeM6orA+QrUfs0QWhfVLXdO xeeVVLQ9JnimOniF5KR4CEJ4PfXPX5KDHwNxDVMcte7iKla2dEhx3qguXjp6Le2FIrn8 ssTQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y40-v6si1768643pla.319.2018.02.02.05.19.24; Fri, 02 Feb 2018 05:19:24 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751557AbeBBNTV (ORCPT + 1 other); Fri, 2 Feb 2018 08:19:21 -0500 Received: from mout.kundenserver.de ([212.227.126.187]:62784 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751416AbeBBNTU (ORCPT ); Fri, 2 Feb 2018 08:19:20 -0500 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue003 [212.227.15.129]) with ESMTPA (Nemesis) id 0MQs4Q-1eIknA2WfG-00ULgt; Fri, 02 Feb 2018 14:14:06 +0100 From: Arnd Bergmann To: linux-scsi@vger.kernel.org, "James E . J . Bottomley" , QLogic-Storage-Upstream@cavium.com, "Martin K. Petersen" Cc: Nicolas Pitre , Andi Kleen , Arnd Bergmann , Saurav Kashyap , "Dupuis, Chad" , Arun Easi , Nilesh Javali , linux-kernel@vger.kernel.org Subject: [PATCH 6/6] scsi: qedf: use correct strncpy() size Date: Fri, 2 Feb 2018 14:12:20 +0100 Message-Id: <20180202131225.1658853-7-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180202131225.1658853-1-arnd@arndb.de> References: <20180202131225.1658853-1-arnd@arndb.de> X-Provags-ID: V03:K0:+08KeQYkcmg6YFv+BV2i7zTvTI63paVPXItNfcWmGRcY8V0r0nQ u87dufChhWViRUHUnpCcSgKbRZAo83uhIDSeq+ISur782Yp4dVQONU4yLcNVqYMlkkkvDdL /VmtB0twYi1o91at6DVRjHhHuYjJO4sIBg+6JlV0bBH3YAk/F5x28jWrP/0lfwp5UpgzBtx 7/j5pSE2Vl7IIA/ztapCw== X-UI-Out-Filterresults: notjunk:1; V01:K0:SQV6o8aQpmg=:aSUoySMBcSFw7S4d8Fn5S4 owrQKGQU1l6FagNPVob/wxdgz/yvOR5Rqpv06YTqT1wOULGkzLofIr8TFgl7jxnmYyWzGqqJE HPP4wA874zSnACKg9icOZAAERZyHHOGTloFbF5UGj6VElP9mb1KfzyizXBJSgPoxo0OHF+/h8 yJnp588nRYrLEXA6n96w/KpW8n5vVOJheccJFcaiSbK2jhBeuB2e/7eGkaejRkBtH57yyQ8Z6 4rFMP1egg9S84sab229lBOWFtqzyqizkt4AIDgfvClCIfsPLT0dZ6VL1l7ex7vKYKHSF5xr81 n1BJDaz1nrXdPyUkC4rvTkivSZGpcmxqTzcWDVQWRWakZRfuABivgYf10Tr2WcR3120tihC7y vkw0ElR7faQ/py6sW8eqXDwfP6rA7UYpYScCVoXyjMTd9D4B21mrdY4XW3+Aeucn6Oqor9pxV n+UNdBzmujGCUvg5En6xmhVRk26KspAt5HfxK5SyHPGL+YiwZ44wQUfRSb6p5rkZlHwc2XO/W WEAYCsvkoBOK6xOjkOQB7rHyOFTWZ2xDrH97svyHauPoERPiw76XR+HgsvNhk5UhzfS8QyYfu K2y77xYnCFTCc+NfgeE58qGkl7Fq1FLtIkfb75nONoAnbiTWE4oYzBF4GWGS5/Ur85tjXeEGx yrCVYh+v6ksuflD81UcD3UzBl6RFMUMMs2xGipI/SfH6mjisYIBbkNJyIoF4+bV5tBEDn2I3H u5/uLMWjRvEguAi2EZALhdZs4wmopo5yuuC/rA== Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org gcc-8 warns during link-time optimization that the strncpy() call passes the size of the source buffer rather than the destination: drivers/scsi/qedf/qedf_dbg.c: In function 'qedf_uevent_emit': include/linux/string.h:253: error: 'strncpy' specified bound depends on the length of the source argument [-Werror=stringop-overflow=] This changes it to strscpy() with the correct length, guaranteeing a properly nul-terminated string of the right size. Signed-off-by: Arnd Bergmann --- drivers/scsi/qedf/qedf_dbg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.9.0 diff --git a/drivers/scsi/qedf/qedf_dbg.c b/drivers/scsi/qedf/qedf_dbg.c index e023f5d0dc12..bd1cef25a900 100644 --- a/drivers/scsi/qedf/qedf_dbg.c +++ b/drivers/scsi/qedf/qedf_dbg.c @@ -160,7 +160,7 @@ qedf_uevent_emit(struct Scsi_Host *shost, u32 code, char *msg) switch (code) { case QEDF_UEVENT_CODE_GRCDUMP: if (msg) - strncpy(event_string, msg, strlen(msg)); + strscpy(event_string, msg, sizeof(event_string)); else sprintf(event_string, "GRCDUMP=%u", shost->host_no); break;