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=-14.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,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 C2F3CC282CA for ; Wed, 13 Feb 2019 02:46:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 906E42175B for ; Wed, 13 Feb 2019 02:46:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550025997; bh=MiVpQPI5Dii1NFEXqhPwjGEK41rgH2gUUNC9Re5xPVE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=mU/cPBAvPujVNPc8z6YDBBRfOjp6FdLs86nR5NsiILSm2z8Z2VCG8V6Hw9h+v1IV6 1S4uIshDJOdNmpOUUT7d7DJKpt4iKyIC8alZJYPNbclS1soHHmSOjAHUTJSICtOxnr 1iGxSDiomipPm/J8HzdIWALoJkd7MZyYioBfSQC4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389065AbfBMCkl (ORCPT ); Tue, 12 Feb 2019 21:40:41 -0500 Received: from mail.kernel.org ([198.145.29.99]:44410 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389054AbfBMCkk (ORCPT ); Tue, 12 Feb 2019 21:40:40 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D59A5222C2; Wed, 13 Feb 2019 02:40:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550025639; bh=MiVpQPI5Dii1NFEXqhPwjGEK41rgH2gUUNC9Re5xPVE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sUHa2Kzqx+UuVL4Huf0/vnir7AH9OoEP4aM2aGUK+mlH1FGyHKgklZyXngz70V8v3 PpDmol/ITeDQWJi2rZ1oMG+xnSUXDHFdo1TKbsdpeQj9qCm09ev+W+/rILbuz8eXEg V23Ca3xH/Gq3XMUPKjZ2XhxPpMcROPOtz5KT6xzI= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Nathan Chancellor , "David S . Miller" , Sasha Levin , netdev@vger.kernel.org Subject: [PATCH AUTOSEL 4.14 34/34] isdn: avm: Fix string plus integer warning from Clang Date: Tue, 12 Feb 2019 21:39:52 -0500 Message-Id: <20190213023952.21311-34-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190213023952.21311-1-sashal@kernel.org> References: <20190213023952.21311-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Nathan Chancellor [ 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(-) diff --git a/drivers/isdn/hardware/avm/b1.c b/drivers/isdn/hardware/avm/b1.c index b1833d08a5fe..40a099f33bfc 100644 --- a/drivers/isdn/hardware/avm/b1.c +++ b/drivers/isdn/hardware/avm/b1.c @@ -423,7 +423,7 @@ void b1_parse_version(avmctrl_info *cinfo) 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) -- 2.19.1