Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751876AbbFYIUY (ORCPT ); Thu, 25 Jun 2015 04:20:24 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:50864 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751117AbbFYIUQ (ORCPT ); Thu, 25 Jun 2015 04:20:16 -0400 Date: Thu, 25 Jun 2015 11:19:42 +0300 From: Dan Carpenter To: Luis de Bethencourt Cc: Sudip Mukherjee , devel@driverdev.osuosl.org, Kirk Reiser , Greg Kroah-Hartman , speakup@linux-speakup.org, Melike Yurtoglu , linux-kernel@vger.kernel.org, Domagoj Trsan , Samuel Thibault , Chris Brannon Subject: Re: [PATCH] staging: speakup: replace simple_strtoul() with kstrtoint() Message-ID: <20150625081942.GX28762@mwanda> References: <20150623204711.GA18380@turing> <20150623225333.GQ28762@mwanda> <20150623231552.GA19085@turing> <20150624052330.GA3881@sudip-PC> <20150624101927.GB30628@goodgumbo.baconseed.org> <20150624174614.GA18762@goodgumbo.baconseed.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150624174614.GA18762@goodgumbo.baconseed.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: aserv0021.oracle.com [141.146.126.233] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 923 Lines: 24 Probably once you start writing a patch you will figure it out. :) keymap_store() is a crap function. We have the cp1 pointer that points to the end of two back to back 3 char arrays. The name cp1 is because it is the second copy of the cp buffer which is a copy of the buf buffer. Since it is a backwards array we use cp1[-3] where normally we would say array[0] and cp1[-1] to mean the last element in the array. We need around 6 characters in cp1, but we are only garaunteed to have 2. There is no checking. Lots of checkpatch.pl warnings. Just focus on cleaning up keymap_store() and hopefully at the end you can just delete spk_s2uchar(). regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/