Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935399AbbI2SPL (ORCPT ); Tue, 29 Sep 2015 14:15:11 -0400 Received: from mezzanine.sirena.org.uk ([106.187.55.193]:54521 "EHLO mezzanine.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935331AbbI2SPH (ORCPT ); Tue, 29 Sep 2015 14:15:07 -0400 Date: Tue, 29 Sep 2015 19:14:55 +0100 From: Mark Brown To: Rasmus Villemoes Cc: Greg Kroah-Hartman , linux-kernel@vger.kernel.org Message-ID: <20150929181455.GB30445@sirena.org.uk> References: <1443479342-31621-1-git-send-email-linux@rasmusvillemoes.dk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="dTRY+exx+ndMGui/" Content-Disposition: inline In-Reply-To: <1443479342-31621-1-git-send-email-linux@rasmusvillemoes.dk> X-Cookie: NOBODY EXPECTS THE SPANISH INQUISITION! User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: 94.175.94.161 X-SA-Exim-Mail-From: broonie@sirena.org.uk Subject: Re: [PATCH 1/2] regmap: debugfs: remove bogus check X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on mezzanine.sirena.org.uk) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --dTRY+exx+ndMGui/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Sep 29, 2015 at 12:29:01AM +0200, Rasmus Villemoes wrote: > snprintf cannot return a negative value (unless map->dev->driver->name > happens to be over 2G long). So remove the bogus check. > ret = snprintf(buf, PAGE_SIZE, "%s\n", map->dev->driver->name); > - if (ret < 0) { > - kfree(buf); > - return ret; > - } It's hard to see a great value in removing error checking, even error checking that's currently unlikely to ever trigger... --dTRY+exx+ndMGui/ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJWCtUeAAoJECTWi3JdVIfQah0H/00teb+M4ZhB5FelmWu5W9ru jtvoR7jGjzU7oo7mNFiVqzwwc6sxdOzpJvZrlPk/p7V+03URPSniH/cMnQjup7qu lMgEyT8yLjXViobqE+nrtBzhEAjFy+9pgu7nzpt9sjxn4SuwWm4odYnk+ec2iuyQ 2T7abHs3MhTYTkn51fUEqNU0fGQY+GZQpn06D8SjiCYn/3pfrEuPCQ/lHNawTOu8 uNq1XjBTpIchBA0kdHLELY7BIMmkwxwQ3DBfLYxaSak8kr3/m7qpgteZOLJx/7ab 80CxXvQjU2OeuHaiNu8Vd08DjBsswL3+JtuohwLHbw8U1GhfwLntvn/5poEF7i0= =Uahu -----END PGP SIGNATURE----- --dTRY+exx+ndMGui/--