From patchwork Tue Jul 26 20:39:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emese Revfy X-Patchwork-Id: 9248807 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A289B6077C for ; Tue, 26 Jul 2016 20:21:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 94BED26B39 for ; Tue, 26 Jul 2016 20:21:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 89772272AA; Tue, 26 Jul 2016 20:21:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 20D2A26B39 for ; Tue, 26 Jul 2016 20:21:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756878AbcGZUVP (ORCPT ); Tue, 26 Jul 2016 16:21:15 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:33288 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753607AbcGZUVO (ORCPT ); Tue, 26 Jul 2016 16:21:14 -0400 Received: by mail-wm0-f65.google.com with SMTP id o80so3404006wme.0; Tue, 26 Jul 2016 13:21:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3qGPwcyKF1J2rGoM7dnPVQTKJLwzUAeFCfcM0XaeT48=; b=mLVlUuakQpOyG3pRi1blzueJpuT6Wgy8qQwsmUFyrRcoqZ65s4iodInaad0j5lLwdi MfzIGH7UBqAO2a7SsFyYrB7NpZyrYTpfLe5i2LvCAApL/EkzzS1zxsGqTSJ77RA6u+xd kWBohzgVP49BHDUpnTgPJRNmvD/7nD4BXgZkddqlN9X3DQvVYrW/w82oiGL1LMcJojId 9PM0Dhrvr1wxofkYjHvqWUPM/4SPUee9jIZ5bvp+6kusxTUvv63iXp+AVVyZ/0MIR1z8 Gr1NC7X2lIlpi8pvm9kILN7SGDjmMla1xlR9IYPZVYBr7nKCSyVIK336gHj/Xho4ymCC Er2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3qGPwcyKF1J2rGoM7dnPVQTKJLwzUAeFCfcM0XaeT48=; b=Ylc5ixCJMPkqMUy/8LkE21PRLOKHhp3wfECAoGyubRdRD7SbkHGAD0zYOlPzh0ncba 6hI8JnpluY/ar0mZwl5DFt/QnPux3W49qyYjStS9iH3kHJv51OyaQ91JtOxdiSZoeWb4 V8Fffi7aUYfcDnKpqkq8WjkRFWDlbpvMKfR95jRasdHLHtrgbyisX6nbEiKfNO41Lcbw 9gGp1spnY+MjvkL3B3BpZGKuaO8z01T72BRwZ2Azd9/7dE96Tutrl1lJpwEoAVkPs7Ry cJdvPkij32m7PLZp8kcuMbOM39yu/yGQcuMMgkKoXTBUBA1D+ogAhtSaIyU3+9JDvQHn LlNQ== X-Gm-Message-State: AEkoouv6GHqHkd+MmzV/4crkMougwLvfhGHjCmXP0yY272zP20boztdI8BJ+1dJs2l6u8w== X-Received: by 10.194.107.33 with SMTP id gz1mr25935733wjb.178.1469564472357; Tue, 26 Jul 2016 13:21:12 -0700 (PDT) Received: from vakond.lan (beleg.madhouse-project.org. [128.199.36.147]) by smtp.gmail.com with ESMTPSA id k186sm32186620wmd.13.2016.07.26.13.21.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Jul 2016 13:21:11 -0700 (PDT) Date: Tue, 26 Jul 2016 22:39:35 +0200 From: Emese Revfy To: kernel-hardening@lists.openwall.com Cc: pageexec@freemail.hu, spender@grsecurity.net, mmarek@suse.com, keescook@chromium.org, linux-kernel@vger.kernel.org, yamada.masahiro@socionext.com, linux-kbuild@vger.kernel.org, minipli@ld-linux.so, linux@armlinux.org.uk, catalin.marinas@arm.com, linux@rasmusvillemoes.dk, david.brown@linaro.org, benh@kernel.crashing.org, tglx@linutronix.de, akpm@linux-foundation.org, jlayton@poochiereds.net, arnd@arndb.de, sam@ravnborg.org, isdn@linux-pingi.de Subject: [PATCH v3 3/7] Constify some function parameters Message-Id: <20160726223935.403f0994a64a6f72ef91b4f1@gmail.com> In-Reply-To: <20160726223541.513ce76f6de65389da6a6abe@gmail.com> References: <20160726223541.513ce76f6de65389da6a6abe@gmail.com> X-Mailer: Sylpheed 3.5.0 (GTK+ 2.24.30; x86_64-pc-linux-gnu) Mime-Version: 1.0 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Initify needs const pointer types, the initify plugin caught some __printf arguments that weren't const yet. Signed-off-by: Emese Revfy --- drivers/isdn/hisax/config.c | 16 ++++++++-------- drivers/isdn/hisax/hisax.h | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/isdn/hisax/config.c b/drivers/isdn/hisax/config.c index bf04d2a..2d12c6c 100644 --- a/drivers/isdn/hisax/config.c +++ b/drivers/isdn/hisax/config.c @@ -659,7 +659,7 @@ int jiftime(char *s, long mark) static u_char tmpbuf[HISAX_STATUS_BUFSIZE]; -void VHiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt, +void VHiSax_putstatus(struct IsdnCardState *cs, char *head, const char *fmt, va_list args) { /* if head == NULL the fmt contains the full info */ @@ -669,23 +669,24 @@ void VHiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt, u_char *p; isdn_ctrl ic; int len; + const u_char *data; if (!cs) { printk(KERN_WARNING "HiSax: No CardStatus for message"); return; } spin_lock_irqsave(&cs->statlock, flags); - p = tmpbuf; if (head) { + p = tmpbuf; p += jiftime(p, jiffies); p += sprintf(p, " %s", head); p += vsprintf(p, fmt, args); *p++ = '\n'; *p = 0; len = p - tmpbuf; - p = tmpbuf; + data = tmpbuf; } else { - p = fmt; + data = fmt; len = strlen(fmt); } if (len > HISAX_STATUS_BUFSIZE) { @@ -699,13 +700,12 @@ void VHiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt, if (i >= len) i = len; len -= i; - memcpy(cs->status_write, p, i); + memcpy(cs->status_write, data, i); cs->status_write += i; if (cs->status_write > cs->status_end) cs->status_write = cs->status_buf; - p += i; if (len) { - memcpy(cs->status_write, p, len); + memcpy(cs->status_write, data + i, len); cs->status_write += len; } #ifdef KERNELSTACK_DEBUG @@ -729,7 +729,7 @@ void VHiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt, } } -void HiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt, ...) +void HiSax_putstatus(struct IsdnCardState *cs, char *head, const char *fmt, ...) { va_list args; diff --git a/drivers/isdn/hisax/hisax.h b/drivers/isdn/hisax/hisax.h index 6ead6314..338d040 100644 --- a/drivers/isdn/hisax/hisax.h +++ b/drivers/isdn/hisax/hisax.h @@ -1288,9 +1288,9 @@ int jiftime(char *s, long mark); int HiSax_command(isdn_ctrl *ic); int HiSax_writebuf_skb(int id, int chan, int ack, struct sk_buff *skb); __printf(3, 4) -void HiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt, ...); +void HiSax_putstatus(struct IsdnCardState *cs, char *head, const char *fmt, ...); __printf(3, 0) -void VHiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt, va_list args); +void VHiSax_putstatus(struct IsdnCardState *cs, char *head, const char *fmt, va_list args); void HiSax_reportcard(int cardnr, int sel); int QuickHex(char *txt, u_char *p, int cnt); void LogFrame(struct IsdnCardState *cs, u_char *p, int size);