From patchwork Mon May 9 19:22:25 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever III X-Patchwork-Id: 770242 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p49JMdLs002621 for ; Mon, 9 May 2011 19:22:39 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753462Ab1EITW3 (ORCPT ); Mon, 9 May 2011 15:22:29 -0400 Received: from mail-yx0-f174.google.com ([209.85.213.174]:39153 "EHLO mail-yx0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754116Ab1EITW2 (ORCPT ); Mon, 9 May 2011 15:22:28 -0400 Received: by yxs7 with SMTP id 7so1909710yxs.19 for ; Mon, 09 May 2011 12:22:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:from:subject:to:cc:date:message-id :in-reply-to:references:user-agent:mime-version:content-type :content-transfer-encoding; bh=xhQWu9fLdYGlxMAYWcELv44f05To8VZYD5+oCWGwLx8=; b=cdOxEhctciwJl1nqS/Gfydf/SqXUShso0chLsl6kJNmXEPuJe31rlNuPNO2z5digdH dVMwZ2Y8FnWrNukZeYnYjK9EjeUmnr2no4lL2lrI2jAtal58H8zUaHOdVpGH6Wzhq4Ax bm9e+3McP7SuTB+wTzOLngd1Tq6tGab/cZg94= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:from:subject:to:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-type:content-transfer-encoding; b=oOjmszb2rBJLKw4t3hsPLaoJ11G6c6vmCemv7tookDxTBoA4HJCMI8rxF/Rr2NK8Xh DX9IwCJLL26jLMQ+bvJpsRAUckldfbO6vXJVqu0SmZz+07DqS2vk34ePSR13cqOBYq1v 33Pp8jmbcu/VswvCCJERPLaATA7ix2shcmO1g= Received: by 10.146.175.19 with SMTP id x19mr5841637yae.16.1304968947711; Mon, 09 May 2011 12:22:27 -0700 (PDT) Received: from matisse.1015granger.net (adsl-99-26-161-222.dsl.sfldmi.sbcglobal.net [99.26.161.222]) by mx.google.com with ESMTPS id s11sm6625683anm.14.2011.05.09.12.22.26 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 09 May 2011 12:22:26 -0700 (PDT) From: Chuck Lever Subject: [PATCH 2/6] SUNRPC: Clean up use of curly braces in switch cases To: trond.myklebust@netapp.com Cc: linux-nfs@vger.kernel.org Date: Mon, 09 May 2011 15:22:25 -0400 Message-ID: <20110509192225.16449.92373.stgit@matisse.1015granger.net> In-Reply-To: <20110509191859.16449.73749.stgit@matisse.1015granger.net> References: <20110509191859.16449.73749.stgit@matisse.1015granger.net> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Mon, 09 May 2011 19:22:39 +0000 (UTC) Clean up. Preferred style is not to use curly braces around switch cases. I'm about to add another case that needs a third type cast. Signed-off-by: Chuck Lever --- net/sunrpc/clnt.c | 17 ++++++++--------- 1 files changed, 8 insertions(+), 9 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index 8d83f9d..b91f8f9 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c @@ -298,22 +298,21 @@ struct rpc_clnt *rpc_create(struct rpc_create_args *args) * up a string representation of the passed-in address. */ if (args->servername == NULL) { + struct sockaddr_in *sin = + (struct sockaddr_in *)args->address; + struct sockaddr_in6 *sin6 = + (struct sockaddr_in6 *)args->address; + servername[0] = '\0'; switch (args->address->sa_family) { - case AF_INET: { - struct sockaddr_in *sin = - (struct sockaddr_in *)args->address; + case AF_INET: snprintf(servername, sizeof(servername), "%pI4", &sin->sin_addr.s_addr); break; - } - case AF_INET6: { - struct sockaddr_in6 *sin = - (struct sockaddr_in6 *)args->address; + case AF_INET6: snprintf(servername, sizeof(servername), "%pI6", - &sin->sin6_addr); + &sin6->sin6_addr); break; - } default: /* caller wants default server name, but * address family isn't recognized. */