Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935087AbeAHQnF (ORCPT + 1 other); Mon, 8 Jan 2018 11:43:05 -0500 Received: from mail-oi0-f51.google.com ([209.85.218.51]:34790 "EHLO mail-oi0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932623AbeAHQnD (ORCPT ); Mon, 8 Jan 2018 11:43:03 -0500 X-Google-Smtp-Source: ACJfBos+1t0NhldkWS0MJO7Ex+tAdj+CU+dKwIgar7FbHVdnbHBq43jvfjwV9kMS1JwHquHQRkrN4rM6+chu7ngJI6A= MIME-Version: 1.0 In-Reply-To: <1515415753-10534-1-git-send-email-wangxiongfeng2@huawei.com> References: <1515415753-10534-1-git-send-email-wangxiongfeng2@huawei.com> From: Arnd Bergmann Date: Mon, 8 Jan 2018 17:43:02 +0100 X-Google-Sender-Auth: _WaW65pyVZKtJIheq4GOF0cIkdM Message-ID: Subject: Re: [PATCH] scsi: mptfusion: use strlcpy() instead of strncpy() To: Xiongfeng Wang Cc: Suganath Prabu Subramani , MPT-FusionLinux.pdl@broadcom.com, linux-scsi , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Mon, Jan 8, 2018 at 1:49 PM, Xiongfeng Wang wrote: > From: Xiongfeng Wang > > gcc-8 reports > > drivers/message/fusion/mptbase.c: In function 'mpt_display_event_info': > ./include/linux/string.h:245:9: warning: '__builtin_strncpy' specified > bound 100 equals destination size [-Wstringop-truncation] > > We need to use strlcpy() to make sure the dest string is > nul-terminated. > > Signed-off-by: Xiongfeng Wang Looks correct to me, Acked-by: Arnd Bergmann