From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5F45EC43381 for ; Fri, 22 Mar 2019 11:20:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2DD9221917 for ; Fri, 22 Mar 2019 11:20:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553253609; bh=LziKSwt+Dw5L7W1/cxScyx010gFulz6QLfl8dJlZxeg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=aT4TLgB/q8iHPHwRYklnKusbTZJOrPKPMvqiJctVoe2t6fZGLvscr8/Frcv5EZ2u1 IKn6y7LZA+RUoBnK2aH5WGKF4IRqkzQurnjQhkPtszyZQ20jUN0Wix/ee6oCLiX6dH lEipHcN5dRTx8QDme+w27JCFo5+fDMKb7w57siAU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728284AbfCVLUD (ORCPT ); Fri, 22 Mar 2019 07:20:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:46404 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728265AbfCVLT6 (ORCPT ); Fri, 22 Mar 2019 07:19:58 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8E9CD218A2; Fri, 22 Mar 2019 11:19:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553253598; bh=LziKSwt+Dw5L7W1/cxScyx010gFulz6QLfl8dJlZxeg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hn4oWqJbzdX90kpM8Zrh+sxXL9WUvbxapb5uJ9GvgRKVXMZY17azoZjHHylxMkM3a ZknhSt16eJDVox/4o8xHB8a0hH4Wqjd5O88KM9Oog+9aJxpgYWj3AzxuhHclNzDFae s3zDL6Zbw65VbS0KFBQoIy55J59RY0auYJ6s4jXo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nick Desaulniers , Nathan Chancellor , "David S. Miller" , Sasha Levin Subject: [PATCH 3.18 017/134] isdn: avm: Fix string plus integer warning from Clang Date: Fri, 22 Mar 2019 12:13:50 +0100 Message-Id: <20190322111211.219857374@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190322111210.465931067@linuxfoundation.org> References: <20190322111210.465931067@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.18-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 7afa81c55fca0cad589722cb4bce698b4803b0e1 ] A recent commit in Clang expanded the -Wstring-plus-int warning, showing some odd behavior in this file. drivers/isdn/hardware/avm/b1.c:426:30: warning: adding 'int' to a string does not append to the string [-Wstring-plus-int] cinfo->version[j] = "\0\0" + 1; ~~~~~~~^~~ drivers/isdn/hardware/avm/b1.c:426:30: note: use array indexing to silence this warning cinfo->version[j] = "\0\0" + 1; ^ & [ ] 1 warning generated. This is equivalent to just "\0". Nick pointed out that it is smarter to use "" instead of "\0" because "" is used elsewhere in the kernel and can be deduplicated at the linking stage. Link: https://github.com/ClangBuiltLinux/linux/issues/309 Suggested-by: Nick Desaulniers Signed-off-by: Nathan Chancellor Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/isdn/hardware/avm/b1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/isdn/hardware/avm/b1.c +++ b/drivers/isdn/hardware/avm/b1.c @@ -423,7 +423,7 @@ void b1_parse_version(avmctrl_info *cinf int i, j; for (j = 0; j < AVM_MAXVERSION; j++) - cinfo->version[j] = "\0\0" + 1; + cinfo->version[j] = ""; for (i = 0, j = 0; j < AVM_MAXVERSION && i < cinfo->versionlen; j++, i += cinfo->versionbuf[i] + 1)